xref: /rk3399_ARM-atf/plat/allwinner/common/include/sunxi_private.h (revision b23ab8eb3f09c191a6285c6072cb1340e9779920)
14ec1a239SAndre Przywara /*
2a1d349beSSamuel Holland  * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved.
34ec1a239SAndre Przywara  *
44ec1a239SAndre Przywara  * SPDX-License-Identifier: BSD-3-Clause
54ec1a239SAndre Przywara  */
64ec1a239SAndre Przywara 
74ec1a239SAndre Przywara #ifndef SUNXI_PRIVATE_H
84ec1a239SAndre Przywara #define SUNXI_PRIVATE_H
94ec1a239SAndre Przywara 
10fe753c97SSamuel Holland #include <lib/psci/psci.h>
11fe753c97SSamuel Holland 
124ec1a239SAndre Przywara void sunxi_configure_mmu_el3(int flags);
134ec1a239SAndre Przywara 
145d4bd66dSSamuel Holland void sunxi_cpu_on(u_register_t mpidr);
15a1d349beSSamuel Holland void sunxi_cpu_power_off_others(void);
16a1d349beSSamuel Holland void sunxi_cpu_power_off_self(void);
17818e6732SSamuel Holland void sunxi_power_down(void);
184ec1a239SAndre Przywara 
19*b23ab8ebSAndre Przywara #if SUNXI_PSCI_USE_NATIVE
20fe753c97SSamuel Holland void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops);
21*b23ab8ebSAndre Przywara #else
22*b23ab8ebSAndre Przywara static inline void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops)
23*b23ab8ebSAndre Przywara {
24*b23ab8ebSAndre Przywara }
25*b23ab8ebSAndre Przywara #endif
26*b23ab8ebSAndre Przywara #if SUNXI_PSCI_USE_SCPI
27fe753c97SSamuel Holland int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops);
28*b23ab8ebSAndre Przywara #else
29*b23ab8ebSAndre Przywara static inline int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops)
30*b23ab8ebSAndre Przywara {
31*b23ab8ebSAndre Przywara 	return -1;
32*b23ab8ebSAndre Przywara }
33*b23ab8ebSAndre Przywara #endif
34fe753c97SSamuel Holland int sunxi_validate_ns_entrypoint(uintptr_t ns_entrypoint);
35fe753c97SSamuel Holland 
36df301601SAndre Przywara int sunxi_pmic_setup(uint16_t socid, const void *fdt);
374ec1a239SAndre Przywara void sunxi_security_setup(void);
384ec1a239SAndre Przywara 
394ec1a239SAndre Przywara uint16_t sunxi_read_soc_id(void);
407020dca0SAndre Przywara void sunxi_set_gpio_out(char port, int pin, bool level_high);
41d5ddf67aSAndre Przywara int sunxi_init_platform_r_twi(uint16_t socid, bool use_rsb);
425cffedceSSamuel Holland void sunxi_execute_arisc_code(uint32_t *code, size_t size, uint16_t param);
434ec1a239SAndre Przywara 
444ec1a239SAndre Przywara #endif /* SUNXI_PRIVATE_H */
45