sunxi_private.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SUNXI_PRIVATE_H
  7. #define SUNXI_PRIVATE_H
  8. #include <common/fdt_fixup.h>
  9. #include <lib/psci/psci.h>
  10. extern const struct psci_cpu_idle_state sunxi_idle_states[];
  11. void sunxi_configure_mmu_el3(int flags);
  12. void sunxi_cpu_on(u_register_t mpidr);
  13. void sunxi_cpu_power_off_others(void);
  14. void sunxi_cpu_power_off_self(void);
  15. void sunxi_power_down(void);
  16. #if SUNXI_PSCI_USE_NATIVE
  17. void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops);
  18. #else
  19. static inline void sunxi_set_native_psci_ops(const plat_psci_ops_t **psci_ops)
  20. {
  21. }
  22. #endif
  23. #if SUNXI_PSCI_USE_SCPI
  24. bool sunxi_psci_is_scpi(void);
  25. int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops);
  26. #else
  27. static inline bool sunxi_psci_is_scpi(void)
  28. {
  29. return false;
  30. }
  31. static inline int sunxi_set_scpi_psci_ops(const plat_psci_ops_t **psci_ops)
  32. {
  33. return -1;
  34. }
  35. #endif
  36. int sunxi_validate_ns_entrypoint(uintptr_t ns_entrypoint);
  37. int sunxi_pmic_setup(uint16_t socid, const void *fdt);
  38. void sunxi_security_setup(void);
  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. #if SUNXI_AMEND_DTB
  44. void sunxi_prepare_dtb(void *fdt);
  45. #else
  46. static inline void sunxi_prepare_dtb(void *fdt)
  47. {
  48. }
  49. #endif
  50. #ifdef PLAT_sun50i_h616
  51. void sunxi_soc_fdt_fixup(void *dtb);
  52. #else
  53. static inline void sunxi_soc_fdt_fixup(void *dtb)
  54. {
  55. }
  56. #endif
  57. #endif /* SUNXI_PRIVATE_H */