sleep_def.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * Copyright (c) 2023, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SLEEP_DEF_H
  7. #define SLEEP_DEF_H
  8. /*
  9. * Auto generated by DE, please DO NOT modify this file directly.
  10. */
  11. /* --- SPM Flag Define --- */
  12. #define SPM_FLAG_DISABLE_CPU_PDN (1U << 0)
  13. #define SPM_FLAG_DISABLE_INFRA_PDN (1U << 1)
  14. #define SPM_FLAG_DISABLE_DDRPHY_PDN (1U << 2)
  15. #define SPM_FLAG_DISABLE_VCORE_DVS (1U << 3)
  16. #define SPM_FLAG_DISABLE_VCORE_DFS (1U << 4)
  17. #define SPM_FLAG_DISABLE_COMMON_SCENARIO (1U << 5)
  18. #define SPM_FLAG_DISABLE_BUS_CLK_OFF (1U << 6)
  19. #define SPM_FLAG_DISABLE_ARMPLL_OFF (1U << 7)
  20. #define SPM_FLAG_KEEP_CSYSPWRACK_HIGH (1U << 8)
  21. #define SPM_FLAG_ENABLE_LVTS_WORKAROUND (1U << 9)
  22. #define SPM_FLAG_RUN_COMMON_SCENARIO (1U << 10)
  23. #define SPM_FLAG_PERI_ON_IN_SUSPEND (1U << 11)
  24. #define SPM_FLAG_ENABLE_SPM_DBG_WDT_DUMP (1U << 12)
  25. #define SPM_FLAG_USE_SRCCLKENO2 (1U << 13)
  26. #define SPM_FLAG_ENABLE_6315_CTRL (1U << 14)
  27. #define SPM_FLAG_ENABLE_TIA_WORKAROUND (1U << 15)
  28. #define SPM_FLAG_DISABLE_SYSRAM_SLEEP (1U << 16)
  29. #define SPM_FLAG_DISABLE_SSPM_SRAM_SLEEP (1U << 17)
  30. #define SPM_FLAG_DISABLE_MCUPM_SRAM_SLEEP (1U << 18)
  31. #define SPM_FLAG_DISABLE_DRAMC_ISSUE_CMD (1U << 19)
  32. #define SPM_FLAG_ENABLE_VOLTAGE_BIN (1U << 20)
  33. #define SPM_FLAG_RESERVED_BIT21 (1U << 21)
  34. #define SPM_FLAG_DISABLE_DRAMC_MCU_SRAM_SLEEP (1U << 22)
  35. #define SPM_FLAG_DISABLE_DRAMC_MD32_BACKUP (1U << 23)
  36. #define SPM_FLAG_RESERVED_BIT24 (1U << 24)
  37. #define SPM_FLAG_RESERVED_BIT25 (1U << 25)
  38. #define SPM_FLAG_RESERVED_BIT26 (1U << 26)
  39. #define SPM_FLAG_VTCXO_STATE (1U << 27)
  40. #define SPM_FLAG_INFRA_STATE (1U << 28)
  41. #define SPM_FLAG_APSRC_STATE (1U << 29)
  42. #define SPM_FLAG_VRF18_STATE (1U << 30)
  43. #define SPM_FLAG_DDREN_STATE (1U << 31)
  44. /* --- SPM Flag1 Define --- */
  45. #define SPM_FLAG1_DISABLE_AXI_BUS_TO_26M (1U << 0)
  46. #define SPM_FLAG1_DISABLE_SYSPLL_OFF (1U << 1)
  47. #define SPM_FLAG1_DISABLE_PWRAP_CLK_SWITCH (1U << 2)
  48. #define SPM_FLAG1_DISABLE_ULPOSC_OFF (1U << 3)
  49. #define SPM_FLAG1_FW_SET_ULPOSC_ON (1U << 4)
  50. #define SPM_FLAG1_RESERVED_BIT5 (1U << 5)
  51. #define SPM_FLAG1_ENABLE_REKICK (1U << 6)
  52. #define SPM_FLAG1_RESERVED_BIT7 (1U << 7)
  53. #define SPM_FLAG1_RESERVED_BIT8 (1U << 8)
  54. #define SPM_FLAG1_RESERVED_BIT9 (1U << 9)
  55. #define SPM_FLAG1_DISABLE_SRCLKEN_LOW (1U << 10)
  56. #define SPM_FLAG1_DISABLE_SCP_CLK_SWITCH (1U << 11)
  57. #define SPM_FLAG1_RESERVED_BIT12 (1U << 12)
  58. #define SPM_FLAG1_RESERVED_BIT13 (1U << 13)
  59. #define SPM_FLAG1_RESERVED_BIT14 (1U << 14)
  60. #define SPM_FLAG1_RESERVED_BIT15 (1U << 15)
  61. #define SPM_FLAG1_RESERVED_BIT16 (1U << 16)
  62. #define SPM_FLAG1_RESERVED_BIT17 (1U << 17)
  63. #define SPM_FLAG1_RESERVED_BIT18 (1U << 18)
  64. #define SPM_FLAG1_RESERVED_BIT19 (1U << 19)
  65. #define SPM_FLAG1_DISABLE_DEVAPC_SRAM_SLEEP (1U << 20)
  66. #define SPM_FLAG1_RESERVED_BIT21 (1U << 21)
  67. #define SPM_FLAG1_ENABLE_VS1_VOTER (1U << 22)
  68. #define SPM_FLAG1_ENABLE_VS2_VOTER (1U << 23)
  69. #define SPM_FLAG1_DISABLE_SCP_VREQ_MASK_CONTROL (1U << 24)
  70. #define SPM_FLAG1_RESERVED_BIT25 (1U << 25)
  71. #define SPM_FLAG1_RESERVED_BIT26 (1U << 26)
  72. #define SPM_FLAG1_RESERVED_BIT27 (1U << 27)
  73. #define SPM_FLAG1_RESERVED_BIT28 (1U << 28)
  74. #define SPM_FLAG1_RESERVED_BIT29 (1U << 29)
  75. #define SPM_FLAG1_RESERVED_BIT30 (1U << 30)
  76. #define SPM_FLAG1_RESERVED_BIT31 (1U << 31)
  77. /* --- SPM DEBUG Define --- */
  78. #define SPM_DBG_DEBUG_IDX_26M_WAKE (1U << 0)
  79. #define SPM_DBG_DEBUG_IDX_26M_SLEEP (1U << 1)
  80. #define SPM_DBG_DEBUG_IDX_INFRA_WAKE (1U << 2)
  81. #define SPM_DBG_DEBUG_IDX_INFRA_SLEEP (1U << 3)
  82. #define SPM_DBG_DEBUG_IDX_APSRC_WAKE (1U << 4)
  83. #define SPM_DBG_DEBUG_IDX_APSRC_SLEEP (1U << 5)
  84. #define SPM_DBG_DEBUG_IDX_VRF18_WAKE (1U << 6)
  85. #define SPM_DBG_DEBUG_IDX_VRF18_SLEEP (1U << 7)
  86. #define SPM_DBG_DEBUG_IDX_DDREN_WAKE (1U << 8)
  87. #define SPM_DBG_DEBUG_IDX_DDREN_SLEEP (1U << 9)
  88. #define SPM_DBG_DEBUG_IDX_DRAM_SREF_ABORT_IN_APSRC (1U << 10)
  89. #define SPM_DBG_DEBUG_IDX_MCUPM_SRAM_STATE (1U << 11)
  90. #define SPM_DBG_DEBUG_IDX_SSPM_SRAM_STATE (1U << 12)
  91. #define SPM_DBG_DEBUG_IDX_DRAM_SREF_ABORT_IN_DDREN (1U << 13)
  92. #define SPM_DBG_DEBUG_IDX_DRAMC_MCU_SRAM_STATE (1U << 14)
  93. #define SPM_DBG_DEBUG_IDX_SYSRAM_SLP (1U << 15)
  94. #define SPM_DBG_DEBUG_IDX_SYSRAM_ON (1U << 16)
  95. #define SPM_DBG_DEBUG_IDX_MCUPM_SRAM_SLP (1U << 17)
  96. #define SPM_DBG_DEBUG_IDX_MCUPM_SRAM_ON (1U << 18)
  97. #define SPM_DBG_DEBUG_IDX_SSPM_SRAM_SLP (1U << 19)
  98. #define SPM_DBG_DEBUG_IDX_SSPM_SRAM_ON (1U << 20)
  99. #define SPM_DBG_DEBUG_IDX_DRAMC_MCU_SRAM_SLP (1U << 21)
  100. #define SPM_DBG_DEBUG_IDX_DRAMC_MCU_SRAM_ON (1U << 22)
  101. #define SPM_DBG_DEBUG_IDX_SCP_VCORE_0P575V (1U << 23)
  102. #define SPM_DBG_DEBUG_IDX_SCP_VCORE_0P600V (1U << 24)
  103. #define SPM_DBG_DEBUG_IDX_SCP_VCORE_0P650V (1U << 25)
  104. #define SPM_DBG_DEBUG_IDX_SCP_VCORE_0P725V (1U << 26)
  105. #define SPM_DBG_DEBUG_IDX_SPM_GO_WAKEUP_NOW (1U << 27)
  106. #define SPM_DBG_DEBUG_IDX_VTCXO_STATE (1U << 28)
  107. #define SPM_DBG_DEBUG_IDX_INFRA_STATE (1U << 29)
  108. #define SPM_DBG_DEBUG_IDX_VRR18_STATE (1U << 30)
  109. #define SPM_DBG_DEBUG_IDX_APSRC_STATE (1U << 31)
  110. /* --- SPM DEBUG1 Define --- */
  111. #define SPM_DBG1_DEBUG_IDX_CURRENT_IS_LP (1U << 0)
  112. #define SPM_DBG1_DEBUG_IDX_VCORE_DVFS_START (1U << 1)
  113. #define SPM_DBG1_DEBUG_IDX_SYSPLL_OFF (1U << 2)
  114. #define SPM_DBG1_DEBUG_IDX_SYSPLL_ON (1U << 3)
  115. #define SPM_DBG1_DEBUG_IDX_CURRENT_IS_VCORE_DVFS (1U << 4)
  116. #define SPM_DBG1_DEBUG_IDX_INFRA_MTCMOS_OFF (1U << 5)
  117. #define SPM_DBG1_DEBUG_IDX_INFRA_MTCMOS_ON (1U << 6)
  118. #define SPM_DBG1_DEBUG_IDX_VRCXO_SLEEP_ABORT (1U << 7)
  119. #define SPM_DBG1_RESERVED_BIT8 (1U << 8)
  120. #define SPM_DBG1_DEBUG_IDX_INFRA_SUB_MTCMOS_OFF (1U << 9)
  121. #define SPM_DBG1_DEBUG_IDX_INFRA_SUB_MTCMOS_ON (1U << 10)
  122. #define SPM_DBG1_DEBUG_IDX_PWRAP_CLK_TO_ULPOSC (1U << 11)
  123. #define SPM_DBG1_DEBUG_IDX_PWRAP_CLK_TO_26M (1U << 12)
  124. #define SPM_DBG1_DEBUG_IDX_SCP_CLK_TO_32K (1U << 13)
  125. #define SPM_DBG1_DEBUG_IDX_SCP_CLK_TO_26M (1U << 14)
  126. #define SPM_DBG1_DEBUG_IDX_BUS_CLK_OFF (1U << 15)
  127. #define SPM_DBG1_DEBUG_IDX_BUS_CLK_ON (1U << 16)
  128. #define SPM_DBG1_DEBUG_IDX_SRCLKEN2_LOW (1U << 17)
  129. #define SPM_DBG1_DEBUG_IDX_SRCLKEN2_HIGH (1U << 18)
  130. #define SPM_DBG1_RESERVED_BIT19 (1U << 19)
  131. #define SPM_DBG1_DEBUG_IDX_ULPOSC_IS_OFF_BUT_SHOULD_ON (1U << 20)
  132. #define SPM_DBG1_DEBUG_IDX_6315_LOW (1U << 21)
  133. #define SPM_DBG1_DEBUG_IDX_6315_HIGH (1U << 22)
  134. #define SPM_DBG1_DEBUG_IDX_PWRAP_SLEEP_ACK_LOW_ABORT (1U << 23)
  135. #define SPM_DBG1_DEBUG_IDX_PWRAP_SLEEP_ACK_HIGH_ABORT (1U << 24)
  136. #define SPM_DBG1_DEBUG_IDX_EMI_SLP_IDLE_ABORT (1U << 25)
  137. #define SPM_DBG1_DEBUG_IDX_SCP_SLP_ACK_LOW_ABORT (1U << 26)
  138. #define SPM_DBG1_DEBUG_IDX_SCP_SLP_ACK_HIGH_ABORT (1U << 27)
  139. #define SPM_DBG1_DEBUG_IDX_SPM_DVFS_CMD_RDY_ABORT (1U << 28)
  140. #define SPM_DBG1_RESERVED_BIT29 (1U << 29)
  141. #define SPM_DBG1_RESERVED_BIT30 (1U << 30)
  142. #define SPM_DBG1_RESERVED_BIT31 (1U << 31)
  143. /*
  144. * Macro and Inline
  145. */
  146. #define is_cpu_pdn(flags) ((flags) & SPM_FLAG_DIS_CPU_PDN == 0)
  147. #define is_infra_pdn(flags) ((flags) & SPM_FLAG_DIS_INFRA_PDN == 0)
  148. #define is_ddrphy_pdn(flags) ((flags) & SPM_FLAG_DIS_DDRPHY_PDN == 0)
  149. #endif /* SLEEP_DEF_H */