pmu.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PMU_H
  7. #define PMU_H
  8. /* Allocate sp reginon in pmusram */
  9. #define PSRAM_SP_SIZE 0x80
  10. #define PSRAM_SP_BOTTOM (PSRAM_SP_TOP - PSRAM_SP_SIZE)
  11. /*****************************************************************************
  12. * pmu con,reg
  13. *****************************************************************************/
  14. #define PMU_WAKEUP_CFG0 0x0
  15. #define PMU_WAKEUP_CFG1 0x4
  16. #define PMU_PWRDN_CON 0x8
  17. #define PMU_PWRDN_ST 0xc
  18. #define PMU_PWRMODE_CON 0x18
  19. #define PMU_BUS_IDE_REQ 0x10
  20. #define PMU_BUS_IDE_ST 0x14
  21. #define PMU_OSC_CNT 0x20
  22. #define PMU_PLL_CNT 0x24
  23. #define PMU_STABL_CNT 0x28
  24. #define PMU_DDRIO0_PWR_CNT 0x2c
  25. #define PMU_DDRIO1_PWR_CNT 0x30
  26. #define PMU_WKUPRST_CNT 0x44
  27. #define PMU_SFT_CON 0x48
  28. #define PMU_PWRMODE_CON1 0x90
  29. enum pmu_pdid {
  30. PD_CPU0 = 0,
  31. PD_CPU1,
  32. PD_CPU2,
  33. PD_CPU3,
  34. PD_BUS = 5,
  35. PD_PERI,
  36. PD_VIO,
  37. PD_VIDEO,
  38. PD_GPU,
  39. PD_SCU = 11,
  40. PD_HEVC = 14,
  41. PD_END
  42. };
  43. enum pmu_bus_ide {
  44. bus_ide_req_bus = 0,
  45. bus_ide_req_peri,
  46. bus_ide_req_gpu,
  47. bus_ide_req_video,
  48. bus_ide_req_vio,
  49. bus_ide_req_core,
  50. bus_ide_req_alive,
  51. bus_ide_req_dma,
  52. bus_ide_req_cpup,
  53. bus_ide_req_hevc,
  54. bus_ide_req_end
  55. };
  56. enum pmu_pwrmode {
  57. pmu_mode_en = 0,
  58. pmu_mode_core_src_gt,
  59. pmu_mode_glb_int_dis,
  60. pmu_mode_l2_flush_en,
  61. pmu_mode_bus_pd,
  62. pmu_mode_cpu0_pd,
  63. pmu_mode_scu_pd,
  64. pmu_mode_pll_pd = 7,
  65. pmu_mode_chip_pd,
  66. pmu_mode_pwr_off_comb,
  67. pmu_mode_pmu_alive_use_lf,
  68. pmu_mode_pmu_use_lf,
  69. pmu_mode_osc_dis = 12,
  70. pmu_mode_input_clamp,
  71. pmu_mode_wkup_rst,
  72. pmu_mode_sref0_enter,
  73. pmu_mode_sref1_enter,
  74. pmu_mode_ddrio0_ret,
  75. pmu_mode_ddrio1_ret,
  76. pmu_mode_ddrc0_gt,
  77. pmu_mode_ddrc1_gt,
  78. pmu_mode_ddrio0_ret_deq,
  79. pmu_mode_ddrio1_ret_deq,
  80. };
  81. enum pmu_pwrmode1 {
  82. pmu_mode_clr_bus = 0,
  83. pmu_mode_clr_core,
  84. pmu_mode_clr_cpup,
  85. pmu_mode_clr_alive,
  86. pmu_mode_clr_dma,
  87. pmu_mode_clr_peri,
  88. pmu_mode_clr_gpu,
  89. pmu_mode_clr_video,
  90. pmu_mode_clr_hevc,
  91. pmu_mode_clr_vio
  92. };
  93. enum pmu_sft_con {
  94. pmu_sft_ddrio0_ret_cfg = 6,
  95. pmu_sft_ddrio1_ret_cfg = 9,
  96. pmu_sft_l2flsh = 15,
  97. };
  98. enum pmu_wakeup_cfg1 {
  99. pmu_armint_wakeup_en = 0,
  100. pmu_gpio_wakeup_negedge,
  101. pmu_sdmmc0_wakeup_en,
  102. pmu_gpioint_wakeup_en,
  103. };
  104. enum pmu_bus_idle_st {
  105. pmu_idle_bus = 0,
  106. pmu_idle_peri,
  107. pmu_idle_gpu,
  108. pmu_idle_video,
  109. pmu_idle_vio,
  110. pmu_idle_core,
  111. pmu_idle_alive,
  112. pmu_idle_dma,
  113. pmu_idle_cpup,
  114. pmu_idle_hevc,
  115. pmu_idle_ack_bus = 16,
  116. pmu_idle_ack_peri,
  117. pmu_idle_ack_gpu,
  118. pmu_idle_ack_video,
  119. pmu_idle_ack_vio,
  120. pmu_idle_ack_core,
  121. pmu_idle_ack_alive,
  122. pmu_idle_ack_dma,
  123. pmu_idle_ack_cpup,
  124. pmu_idle_ack_hevc,
  125. };
  126. #define CHECK_CPU_WFIE_BASE (0)
  127. #define clstl_cpu_wfe -1
  128. #define clstb_cpu_wfe -1
  129. #define CKECK_WFEI_MSK 0
  130. #define PD_CTR_LOOP 500
  131. #define CHK_CPU_LOOP 500
  132. #define MAX_WAIT_CONUT 1000
  133. #endif /* PMU_H */