Samuel Holland | b856664 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 1 | /* |
Samuel Holland | 91bcab9 | 2021-01-24 06:37:29 -0600 | [diff] [blame] | 2 | * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved. |
Samuel Holland | b856664 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Andre Przywara | 456208a | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 7 | #ifndef SUNXI_PRIVATE_H |
| 8 | #define SUNXI_PRIVATE_H |
Samuel Holland | b856664 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 9 | |
Samuel Holland | 365966c | 2022-01-22 23:37:12 -0600 | [diff] [blame] | 10 | #include <common/fdt_fixup.h> |
| 11 | |
Samuel Holland | ad6f6ca | 2021-01-16 00:56:48 -0600 | [diff] [blame] | 12 | #include <lib/psci/psci.h> |
| 13 | |
Samuel Holland | 365966c | 2022-01-22 23:37:12 -0600 | [diff] [blame] | 14 | extern const struct psci_cpu_idle_state sunxi_idle_states[]; |
| 15 | |
Samuel Holland | b856664 | 2017-08-12 04:07:39 -0500 | [diff] [blame] | 16 | void sunxi_configure_mmu_el3(int flags); |
Andre Przywara | 456208a | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 17 | |
Samuel Holland | c629daf | 2019-02-17 15:33:33 -0600 | [diff] [blame] | 18 | void sunxi_cpu_on(u_register_t mpidr); |
Samuel Holland | 91bcab9 | 2021-01-24 06:37:29 -0600 | [diff] [blame] | 19 | void sunxi_cpu_power_off_others(void); |
| 20 | void sunxi_cpu_power_off_self(void); |
Samuel Holland | fa4d935 | 2019-10-20 15:06:57 -0500 | [diff] [blame] | 21 | void sunxi_power_down(void); |
Icenowy Zheng | 7508bef | 2018-07-21 20:41:12 +0800 | [diff] [blame] | 22 | |
Andre Przywara | 50bb417 | 2021-01-20 00:09:44 +0000 | [diff] [blame] | 23 | #if SUNXI_PSCI_USE_NATIVE |
Samuel Holland | ad6f6ca | 2021-01-16 00:56:48 -0600 | [diff] [blame] | 24 | void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops); |
Andre Przywara | 50bb417 | 2021-01-20 00:09:44 +0000 | [diff] [blame] | 25 | #else |
| 26 | static inline void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops) |
| 27 | { |
| 28 | } |
| 29 | #endif |
| 30 | #if SUNXI_PSCI_USE_SCPI |
Samuel Holland | 365966c | 2022-01-22 23:37:12 -0600 | [diff] [blame] | 31 | bool sunxi_psci_is_scpi(void); |
Samuel Holland | ad6f6ca | 2021-01-16 00:56:48 -0600 | [diff] [blame] | 32 | int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops); |
Andre Przywara | 50bb417 | 2021-01-20 00:09:44 +0000 | [diff] [blame] | 33 | #else |
Samuel Holland | 365966c | 2022-01-22 23:37:12 -0600 | [diff] [blame] | 34 | static inline bool sunxi_psci_is_scpi(void) |
| 35 | { |
| 36 | return false; |
| 37 | } |
Andre Przywara | 50bb417 | 2021-01-20 00:09:44 +0000 | [diff] [blame] | 38 | static inline int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops) |
| 39 | { |
| 40 | return -1; |
| 41 | } |
| 42 | #endif |
Samuel Holland | ad6f6ca | 2021-01-16 00:56:48 -0600 | [diff] [blame] | 43 | int sunxi_validate_ns_entrypoint(uintptr_t ns_entrypoint); |
| 44 | |
Andre Przywara | 4e4b1e6 | 2018-09-08 19:18:37 +0100 | [diff] [blame] | 45 | int sunxi_pmic_setup(uint16_t socid, const void *fdt); |
Andre Przywara | 1381547 | 2018-06-01 02:01:39 +0100 | [diff] [blame] | 46 | void sunxi_security_setup(void); |
| 47 | |
Andre Przywara | 456208a | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 48 | uint16_t sunxi_read_soc_id(void); |
Andre Przywara | 435464d | 2018-10-14 12:03:23 +0100 | [diff] [blame] | 49 | void sunxi_set_gpio_out(char port, int pin, bool level_high); |
Andre Przywara | 6753776 | 2018-10-14 22:13:53 +0100 | [diff] [blame] | 50 | int sunxi_init_platform_r_twi(uint16_t socid, bool use_rsb); |
Samuel Holland | ac684b9 | 2019-10-20 14:18:48 -0500 | [diff] [blame] | 51 | void sunxi_execute_arisc_code(uint32_t *code, size_t size, uint16_t param); |
Icenowy Zheng | bd57eb5 | 2018-07-22 21:52:50 +0800 | [diff] [blame] | 52 | |
Andre Przywara | 9de1222 | 2021-12-19 13:39:40 +0000 | [diff] [blame] | 53 | #if SUNXI_AMEND_DTB |
Andre Przywara | fb83833 | 2020-12-14 12:06:24 +0000 | [diff] [blame] | 54 | void sunxi_prepare_dtb(void *fdt); |
| 55 | #else |
| 56 | static inline void sunxi_prepare_dtb(void *fdt) |
| 57 | { |
| 58 | } |
| 59 | #endif |
| 60 | |
Andre Przywara | 456208a | 2018-10-14 12:02:02 +0100 | [diff] [blame] | 61 | #endif /* SUNXI_PRIVATE_H */ |