sleep_def.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * Copyright (c) 2022, 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_SSPM_INFRA_SLEEP_MODE (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_RESERVED_BIT14 (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_RESERVED_BIT19 (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_SRAM_EVENT (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_DDREN_STATE (1U << 27)
  40. #define SPM_FLAG_VTCXO_STATE (1U << 28)
  41. #define SPM_FLAG_INFRA_STATE (1U << 29)
  42. #define SPM_FLAG_VRF18_STATE (1U << 30)
  43. #define SPM_FLAG_APSRC_STATE (1U << 31)
  44. #define SPM_FLAG_SYSTEM_POWER_STATE (1U << 28)
  45. /* --- SPM Flag1 Define --- */
  46. #define SPM_FLAG1_DISABLE_AXI_BUS_TO_26M (1U << 0)
  47. #define SPM_FLAG1_DISABLE_SYSPLL_OFF (1U << 1)
  48. #define SPM_FLAG1_DISABLE_PWRAP_CLK_SWITCH (1U << 2)
  49. #define SPM_FLAG1_DISABLE_ULPOSC_OFF (1U << 3)
  50. #define SPM_FLAG1_FW_SET_ULPOSC_ON (1U << 4)
  51. #define SPM_FLAG1_RESERVED_BIT5 (1U << 5)
  52. #define SPM_FLAG1_ENABLE_REKICK (1U << 6)
  53. #define SPM_FLAG1_RESERVED_BIT7 (1U << 7)
  54. #define SPM_FLAG1_RESERVED_BIT8 (1U << 8)
  55. #define SPM_FLAG1_RESERVED_BIT9 (1U << 9)
  56. #define SPM_FLAG1_DISABLE_SRCLKEN_LOW (1U << 10)
  57. #define SPM_FLAG1_DISABLE_SCP_CLK_SWITCH (1U << 11)
  58. #define SPM_FLAG1_RESERVED_BIT12 (1U << 12)
  59. #define SPM_FLAG1_RESERVED_BIT13 (1U << 13)
  60. #define SPM_FLAG1_RESERVED_BIT14 (1U << 14)
  61. #define SPM_FLAG1_RESERVED_BIT15 (1U << 15)
  62. #define SPM_FLAG1_RESERVED_BIT16 (1U << 16)
  63. #define SPM_FLAG1_RESERVED_BIT17 (1U << 17)
  64. #define SPM_FLAG1_RESERVED_BIT18 (1U << 18)
  65. #define SPM_FLAG1_RESERVED_BIT19 (1U << 19)
  66. #define SPM_FLAG1_DISABLE_DEVAPC_SRAM_SLEEP (1U << 20)
  67. #define SPM_FLAG1_RESERVED_BIT21 (1U << 21)
  68. #define SPM_FLAG1_RESERVED_BIT22 (1U << 22)
  69. #define SPM_FLAG1_RESERVED_BIT23 (1U << 23)
  70. #define SPM_FLAG1_DISABLE_SCP_VREQ_MASK_CONTROL (1U << 24)
  71. #define SPM_FLAG1_RESERVED_BIT25 (1U << 25)
  72. #define SPM_FLAG1_RESERVED_BIT26 (1U << 26)
  73. #define SPM_FLAG1_RESERVED_BIT27 (1U << 27)
  74. #define SPM_FLAG1_RESERVED_BIT28 (1U << 28)
  75. #define SPM_FLAG1_RESERVED_BIT29 (1U << 29)
  76. #define SPM_FLAG1_RESERVED_BIT30 (1U << 30)
  77. #define SPM_FLAG1_ENABLE_MCUPM_OFF (1U << 31)
  78. /* --- SPM DEBUG Define --- */
  79. #define SPM_DBG_DEBUG_IDX_26M_WAKE (1U << 0)
  80. #define SPM_DBG_DEBUG_IDX_26M_SLEEP (1U << 1)
  81. #define SPM_DBG_DEBUG_IDX_INFRA_WAKE (1U << 2)
  82. #define SPM_DBG_DEBUG_IDX_INFRA_SLEEP (1U << 3)
  83. #define SPM_DBG_DEBUG_IDX_APSRC_WAKE (1U << 4)
  84. #define SPM_DBG_DEBUG_IDX_APSRC_SLEEP (1U << 5)
  85. #define SPM_DBG_DEBUG_IDX_VRF18_WAKE (1U << 6)
  86. #define SPM_DBG_DEBUG_IDX_VRF18_SLEEP (1U << 7)
  87. #define SPM_DBG_DEBUG_IDX_DDREN_WAKE (1U << 8)
  88. #define SPM_DBG_DEBUG_IDX_DDREN_SLEEP (1U << 9)
  89. #define SPM_DBG_DEBUG_IDX_DRAM_SREF_ABORT_IN_APSRC (1U << 10)
  90. #define SPM_DBG_DEBUG_IDX_MCUPM_SRAM_STATE (1U << 11)
  91. #define SPM_DBG_DEBUG_IDX_SSPM_SRAM_STATE (1U << 12)
  92. #define SPM_DBG_DEBUG_IDX_DRAM_SREF_ABORT_IN_DDREN (1U << 13)
  93. #define SPM_DBG_DEBUG_IDX_DRAMC_MCU_SRAM_STATE (1U << 14)
  94. #define SPM_DBG_DEBUG_IDX_SYSRAM_SLP (1U << 15)
  95. #define SPM_DBG_DEBUG_IDX_SYSRAM_ON (1U << 16)
  96. #define SPM_DBG_DEBUG_IDX_MCUPM_SRAM_SLP (1U << 17)
  97. #define SPM_DBG_DEBUG_IDX_MCUPM_SRAM_ON (1U << 18)
  98. #define SPM_DBG_DEBUG_IDX_SSPM_SRAM_SLP (1U << 19)
  99. #define SPM_DBG_DEBUG_IDX_SSPM_SRAM_ON (1U << 20)
  100. #define SPM_DBG_DEBUG_IDX_DRAMC_MCU_SRAM_SLP (1U << 21)
  101. #define SPM_DBG_DEBUG_IDX_DRAMC_MCU_SRAM_ON (1U << 22)
  102. #define SPM_DBG_DEBUG_IDX_APSRC_SLEEP_ABORT (1U << 23)
  103. #define SPM_DBG_DEBUG_IDX_SPM_GO_WAKEUP_NOW (1U << 27)
  104. #define SPM_DBG_DEBUG_IDX_VTCXO_STATE (1U << 28)
  105. #define SPM_DBG_DEBUG_IDX_INFRA_STATE (1U << 29)
  106. #define SPM_DBG_DEBUG_IDX_VRR18_STATE (1U << 30)
  107. #define SPM_DBG_DEBUG_IDX_APSRC_STATE (1U << 31)
  108. /* --- SPM DEBUG1 Define --- */
  109. #define SPM_DBG1_DEBUG_IDX_CURRENT_IS_LP (1U << 0)
  110. #define SPM_DBG1_DEBUG_IDX_VCORE_DVFS_START (1U << 1)
  111. #define SPM_DBG1_DEBUG_IDX_SYSPLL_OFF (1U << 2)
  112. #define SPM_DBG1_DEBUG_IDX_SYSPLL_ON (1U << 3)
  113. #define SPM_DBG1_DEBUG_IDX_CURRENT_IS_VCORE_DVFS (1U << 4)
  114. #define SPM_DBG1_DEBUG_IDX_INFRA_MTCMOS_OFF (1U << 5)
  115. #define SPM_DBG1_DEBUG_IDX_INFRA_MTCMOS_ON (1U << 6)
  116. #define SPM_DBG1_DEBUG_IDX_VRCXO_SLEEP_ABORT (1U << 7)
  117. #define SPM_DBG1_RESERVED_BIT8 (1U << 8)
  118. #define SPM_DBG1_DEBUG_IDX_PWRAP_CLK_TO_ULPOSC (1U << 11)
  119. #define SPM_DBG1_DEBUG_IDX_PWRAP_CLK_TO_26M (1U << 12)
  120. #define SPM_DBG1_DEBUG_IDX_SCP_CLK_TO_32K (1U << 13)
  121. #define SPM_DBG1_DEBUG_IDX_SCP_CLK_TO_26M (1U << 14)
  122. #define SPM_DBG1_DEBUG_IDX_BUS_CLK_OFF (1U << 15)
  123. #define SPM_DBG1_DEBUG_IDX_BUS_CLK_ON (1U << 16)
  124. #define SPM_DBG1_DEBUG_IDX_SRCLKEN2_LOW (1U << 17)
  125. #define SPM_DBG1_DEBUG_IDX_SRCLKEN2_HIGH (1U << 18)
  126. #define SPM_DBG1_DEBUG_IDX_MCUPM_WAKE_IRQ (1U << 19)
  127. #define SPM_DBG1_DEBUG_IDX_ULPOSC_IS_OFF_BUT_SHOULD_ON (1U << 20)
  128. #define SPM_DBG1_DEBUG_IDX_PWRAP_SLEEP_ACK_LOW_ABORT (1U << 23)
  129. #define SPM_DBG1_DEBUG_IDX_PWRAP_SLEEP_ACK_HIGH_ABORT (1U << 24)
  130. #define SPM_DBG1_DEBUG_IDX_EMI_SLP_IDLE_ABORT (1U << 25)
  131. #define SPM_DBG1_DEBUG_IDX_SCP_SLP_ACK_LOW_ABORT (1U << 26)
  132. #define SPM_DBG1_DEBUG_IDX_SCP_SLP_ACK_HIGH_ABORT (1U << 27)
  133. #define SPM_DBG1_DEBUG_IDX_SPM_DVFS_CMD_RDY_ABORT (1U << 28)
  134. #define SPM_DBG1_DEBUG_IDX_SPM_TIMER_RST_DVFS (1U << 29)
  135. #define SPM_DBG1_DEBUG_IDX_SPM_DISABLE_DDREN_EVENT (1U << 30)
  136. #define MCUPM_RESTORE (1U << 31)
  137. /* Macro and Inline */
  138. #define is_cpu_pdn(flags) (((flags) & SPM_FLAG_DISABLE_CPU_PDN) == 0U)
  139. #define is_infra_pdn(flags) (((flags) & SPM_FLAG_DISABLE_INFRA_PDN) == 0U)
  140. #define is_ddrphy_pdn(flags) (((flags) & SPM_FLAG_DISABLE_DDRPHY_PDN) == 0U)
  141. #endif /* SLEEP_DEF_H */