hisi_pwrc.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef HISI_PWRC_H
  7. #define HISI_PWRC_H
  8. #include <hi3660.h>
  9. #include <hi3660_crg.h>
  10. #define PCTRL_BASE (PCTRL_REG_BASE)
  11. #define CRG_BASE (CRG_REG_BASE)
  12. #define SOC_CRGPERIPH_A53_PDCEN_ADDR(base) ((base) + (0x260))
  13. #define SOC_CRGPERIPH_MAIA_PDCEN_ADDR(base) ((base) + (0x300))
  14. #define SOC_PCTRL_RESOURCE0_LOCK_ADDR(base) ((base) + (0x400))
  15. #define SOC_PCTRL_RESOURCE0_UNLOCK_ADDR(base) ((base) + (0x404))
  16. #define SOC_PCTRL_RESOURCE0_LOCK_ST_ADDR(base) ((base) + (0x408))
  17. #define SOC_PCTRL_RESOURCE1_LOCK_ADDR(base) ((base) + (0x40C))
  18. #define SOC_PCTRL_RESOURCE1_UNLOCK_ADDR(base) ((base) + (0x410))
  19. #define SOC_PCTRL_RESOURCE1_LOCK_ST_ADDR(base) ((base) + (0x414))
  20. #define SOC_PCTRL_RESOURCE2_LOCK_ADDR(base) ((base) + (0x418))
  21. #define SOC_SCTRL_SCBAKDATA3_ADDR(base) ((base) + (0x418))
  22. #define SOC_SCTRL_SCBAKDATA8_ADDR(base) ((base) + (0x42C))
  23. #define SOC_SCTRL_SCBAKDATA9_ADDR(base) ((base) + (0x430))
  24. #define SOC_ACPU_SCTRL_BASE_ADDR (0xFFF0A000)
  25. void hisi_cpuidle_lock(unsigned int cluster, unsigned int core);
  26. void hisi_cpuidle_unlock(unsigned int cluster, unsigned int core);
  27. void hisi_set_cpuidle_flag(unsigned int cluster, unsigned int core);
  28. void hisi_clear_cpuidle_flag(unsigned int cluster, unsigned int core);
  29. void hisi_set_cpu_boot_flag(unsigned int cluster, unsigned int core);
  30. void hisi_clear_cpu_boot_flag(unsigned int cluster, unsigned int core);
  31. int cluster_is_powered_on(unsigned int cluster);
  32. void hisi_enter_core_idle(unsigned int cluster, unsigned int core);
  33. void hisi_enter_cluster_idle(unsigned int cluster, unsigned int core);
  34. int hisi_test_ap_suspend_flag(void);
  35. void hisi_enter_ap_suspend(unsigned int cluster, unsigned int core);
  36. /* pdc api */
  37. void hisi_pdc_mask_cluster_wakeirq(unsigned int cluster);
  38. int hisi_test_pwrdn_allcores(unsigned int cluster, unsigned int core);
  39. void hisi_disable_pdc(unsigned int cluster);
  40. void hisi_enable_pdc(unsigned int cluster);
  41. void hisi_powerup_core(unsigned int cluster, unsigned int core);
  42. void hisi_powerdn_core(unsigned int cluster, unsigned int core);
  43. void hisi_powerup_cluster(unsigned int cluster, unsigned int core);
  44. void hisi_powerdn_cluster(unsigned int cluster, unsigned int core);
  45. unsigned int hisi_test_cpu_down(unsigned int cluster, unsigned int core);
  46. #endif /* HISI_PWRC_H */