Samuel Holland | 5803258 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 1 | /* |
Samuel Holland | a1d349b | 2021-01-24 06:37:29 -0600 | [diff] [blame] | 2 | * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved. |
Samuel Holland | 5803258 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Andre Przywara | 4ec1a23 | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 7 | #ifndef SUNXI_PRIVATE_H |
| 8 | #define SUNXI_PRIVATE_H |
Samuel Holland | 5803258 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 9 | |
Samuel Holland | fe753c9 | 2021-01-16 00:56:48 -0600 | [diff] [blame] | 10 | #include <lib/psci/psci.h> |
| 11 | |
Samuel Holland | 5803258 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 12 | void sunxi_configure_mmu_el3(int flags); |
Andre Przywara | 4ec1a23 | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 13 | |
Samuel Holland | 5d4bd66 | 2019-02-17 15:33:33 -0600 | [diff] [blame] | 14 | void sunxi_cpu_on(u_register_t mpidr); |
Samuel Holland | a1d349b | 2021-01-24 06:37:29 -0600 | [diff] [blame] | 15 | void sunxi_cpu_power_off_others(void); |
| 16 | void sunxi_cpu_power_off_self(void); |
Samuel Holland | 818e673 | 2019-10-20 15:06:57 -0500 | [diff] [blame] | 17 | void sunxi_power_down(void); |
Andre Przywara | 4ec1a23 | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 18 | |
Andre Przywara | b23ab8e | 2021-01-20 00:09:44 +0000 | [diff] [blame] | 19 | #if SUNXI_PSCI_USE_NATIVE |
Samuel Holland | fe753c9 | 2021-01-16 00:56:48 -0600 | [diff] [blame] | 20 | void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops); |
Andre Przywara | b23ab8e | 2021-01-20 00:09:44 +0000 | [diff] [blame] | 21 | #else |
| 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 |
Samuel Holland | fe753c9 | 2021-01-16 00:56:48 -0600 | [diff] [blame] | 27 | int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops); |
Andre Przywara | b23ab8e | 2021-01-20 00:09:44 +0000 | [diff] [blame] | 28 | #else |
| 29 | static inline int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops) |
| 30 | { |
| 31 | return -1; |
| 32 | } |
| 33 | #endif |
Samuel Holland | fe753c9 | 2021-01-16 00:56:48 -0600 | [diff] [blame] | 34 | int sunxi_validate_ns_entrypoint(uintptr_t ns_entrypoint); |
| 35 | |
Andre Przywara | df30160 | 2018-09-08 19:18:37 +0100 | [diff] [blame] | 36 | int sunxi_pmic_setup(uint16_t socid, const void *fdt); |
Andre Przywara | 4ec1a23 | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 37 | void sunxi_security_setup(void); |
Samuel Holland | 5803258 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 38 | |
Andre Przywara | c4143b7 | 2018-06-22 00:47:08 +0100 | [diff] [blame] | 39 | uint16_t sunxi_read_soc_id(void); |
Andre Przywara | 7020dca | 2018-10-14 12:03:23 +0100 | [diff] [blame] | 40 | void sunxi_set_gpio_out(char port, int pin, bool level_high); |
Andre Przywara | d5ddf67 | 2018-10-14 22:13:53 +0100 | [diff] [blame] | 41 | int sunxi_init_platform_r_twi(uint16_t socid, bool use_rsb); |
Samuel Holland | 5cffedc | 2019-10-20 14:18:48 -0500 | [diff] [blame] | 42 | void sunxi_execute_arisc_code(uint32_t *code, size_t size, uint16_t param); |
Icenowy Zheng | 7c26b6e | 2018-07-21 20:41:12 +0800 | [diff] [blame] | 43 | |
Andre Przywara | 0be10ee | 2020-12-14 12:06:24 +0000 | [diff] [blame] | 44 | #ifdef SUNXI_BL31_IN_DRAM |
| 45 | void sunxi_prepare_dtb(void *fdt); |
| 46 | #else |
| 47 | static inline void sunxi_prepare_dtb(void *fdt) |
| 48 | { |
| 49 | } |
| 50 | #endif |
| 51 | |
Andre Przywara | 4ec1a23 | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 52 | #endif /* SUNXI_PRIVATE_H */ |