1 /*
2  * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef SUNXI_PRIVATE_H
8 #define SUNXI_PRIVATE_H
9 
10 #include <lib/psci/psci.h>
11 
12 void sunxi_configure_mmu_el3(int flags);
13 
14 void sunxi_cpu_on(u_register_t mpidr);
15 void sunxi_cpu_power_off_others(void);
16 void sunxi_cpu_power_off_self(void);
17 void sunxi_power_down(void);
18 
19 #if SUNXI_PSCI_USE_NATIVE
20 void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops);
21 #else
sunxi_set_native_psci_ops(const plat_psci_ops_t ** psci_ops)22 static inline void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops)
23 {
24 }
25 #endif
26 #if SUNXI_PSCI_USE_SCPI
27 int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops);
28 #else
sunxi_set_scpi_psci_ops(const plat_psci_ops_t ** psci_ops)29 static inline int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops)
30 {
31 	return -1;
32 }
33 #endif
34 int sunxi_validate_ns_entrypoint(uintptr_t ns_entrypoint);
35 
36 int sunxi_pmic_setup(uint16_t socid, const void *fdt);
37 void sunxi_security_setup(void);
38 
39 uint16_t sunxi_read_soc_id(void);
40 void sunxi_set_gpio_out(char port, int pin, bool level_high);
41 int sunxi_init_platform_r_twi(uint16_t socid, bool use_rsb);
42 void sunxi_execute_arisc_code(uint32_t *code, size_t size, uint16_t param);
43 
44 #ifdef SUNXI_BL31_IN_DRAM
45 void sunxi_prepare_dtb(void *fdt);
46 #else
sunxi_prepare_dtb(void * fdt)47 static inline void sunxi_prepare_dtb(void *fdt)
48 {
49 }
50 #endif
51 
52 #endif /* SUNXI_PRIVATE_H */
53