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 19b23ab8ebSAndre Przywara #if SUNXI_PSCI_USE_NATIVE 20fe753c97SSamuel Holland void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops); 21b23ab8ebSAndre Przywara #else 22b23ab8ebSAndre Przywara static inline void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops) 23b23ab8ebSAndre Przywara { 24b23ab8ebSAndre Przywara } 25b23ab8ebSAndre Przywara #endif 26b23ab8ebSAndre Przywara #if SUNXI_PSCI_USE_SCPI 27fe753c97SSamuel Holland int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops); 28b23ab8ebSAndre Przywara #else 29b23ab8ebSAndre Przywara static inline int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops) 30b23ab8ebSAndre Przywara { 31b23ab8ebSAndre Przywara return -1; 32b23ab8ebSAndre Przywara } 33b23ab8ebSAndre 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 44*0be10ee3SAndre Przywara #ifdef SUNXI_BL31_IN_DRAM 45*0be10ee3SAndre Przywara void sunxi_prepare_dtb(void *fdt); 46*0be10ee3SAndre Przywara #else 47*0be10ee3SAndre Przywara static inline void sunxi_prepare_dtb(void *fdt) 48*0be10ee3SAndre Przywara { 49*0be10ee3SAndre Przywara } 50*0be10ee3SAndre Przywara #endif 51*0be10ee3SAndre Przywara 524ec1a239SAndre Przywara #endif /* SUNXI_PRIVATE_H */ 53