zynqmp_pm_defs.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /*
  2. * Copyright (c) 2013-2022, Arm Limited and Contributors. All rights reserved.
  3. * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. /* ZynqMP power management enums and defines */
  8. #ifndef ZYNQMP_PM_DEFS_H
  9. #define ZYNQMP_PM_DEFS_H
  10. /*********************************************************************
  11. * Macro definitions
  12. ********************************************************************/
  13. /*
  14. * Version number is a 32bit value, like:
  15. * (PM_VERSION_MAJOR << 16) | PM_VERSION_MINOR
  16. */
  17. #define PM_VERSION_MAJOR 1U
  18. #define PM_VERSION_MINOR 1U
  19. #define PM_VERSION ((PM_VERSION_MAJOR << 16U) | PM_VERSION_MINOR)
  20. /*
  21. * PM API versions
  22. */
  23. /* Expected version of firmware APIs */
  24. #define FW_API_BASE_VERSION (1U)
  25. /* Expected version of firmware API for feature check */
  26. #define FW_API_VERSION_2 (2U)
  27. /* Version of APIs implemented in TF-A */
  28. #define TFA_API_BASE_VERSION (1U)
  29. /* Updating the QUERY_DATA API versioning as the bitmask functionality
  30. * support is added in the v2.*/
  31. #define TFA_API_QUERY_DATA_VERSION (2U)
  32. /* Capabilities for RAM */
  33. #define PM_CAP_ACCESS 0x1U
  34. #define PM_CAP_CONTEXT 0x2U
  35. /* APU processor states */
  36. #define PM_PROC_STATE_FORCEDOFF 0U
  37. #define PM_PROC_STATE_ACTIVE 1U
  38. #define PM_PROC_STATE_SLEEP 2U
  39. #define PM_PROC_STATE_SUSPENDING 3U
  40. #define PM_SET_SUSPEND_MODE 0xa02
  41. /*********************************************************************
  42. * Enum definitions
  43. ********************************************************************/
  44. enum pm_node_id {
  45. NODE_UNKNOWN = 0,
  46. NODE_APU,
  47. NODE_APU_0,
  48. NODE_APU_1,
  49. NODE_APU_2,
  50. NODE_APU_3,
  51. NODE_RPU,
  52. NODE_RPU_0,
  53. NODE_RPU_1,
  54. NODE_PLD,
  55. NODE_FPD,
  56. NODE_OCM_BANK_0,
  57. NODE_OCM_BANK_1,
  58. NODE_OCM_BANK_2,
  59. NODE_OCM_BANK_3,
  60. NODE_TCM_0_A,
  61. NODE_TCM_0_B,
  62. NODE_TCM_1_A,
  63. NODE_TCM_1_B,
  64. NODE_L2,
  65. NODE_GPU_PP_0,
  66. NODE_GPU_PP_1,
  67. NODE_USB_0,
  68. NODE_USB_1,
  69. NODE_TTC_0,
  70. NODE_TTC_1,
  71. NODE_TTC_2,
  72. NODE_TTC_3,
  73. NODE_SATA,
  74. NODE_ETH_0,
  75. NODE_ETH_1,
  76. NODE_ETH_2,
  77. NODE_ETH_3,
  78. NODE_UART_0,
  79. NODE_UART_1,
  80. NODE_SPI_0,
  81. NODE_SPI_1,
  82. NODE_I2C_0,
  83. NODE_I2C_1,
  84. NODE_SD_0,
  85. NODE_SD_1,
  86. NODE_DP,
  87. NODE_GDMA,
  88. NODE_ADMA,
  89. NODE_NAND,
  90. NODE_QSPI,
  91. NODE_GPIO,
  92. NODE_CAN_0,
  93. NODE_CAN_1,
  94. NODE_EXTERN,
  95. NODE_APLL,
  96. NODE_VPLL,
  97. NODE_DPLL,
  98. NODE_RPLL,
  99. NODE_IOPLL,
  100. NODE_DDR,
  101. NODE_IPI_APU,
  102. NODE_IPI_RPU_0,
  103. NODE_GPU,
  104. NODE_PCIE,
  105. NODE_PCAP,
  106. NODE_RTC,
  107. NODE_LPD,
  108. NODE_VCU,
  109. NODE_IPI_RPU_1,
  110. NODE_IPI_PL_0,
  111. NODE_IPI_PL_1,
  112. NODE_IPI_PL_2,
  113. NODE_IPI_PL_3,
  114. NODE_PL,
  115. NODE_GEM_TSU,
  116. NODE_SWDT_0,
  117. NODE_SWDT_1,
  118. NODE_CSU,
  119. NODE_PJTAG,
  120. NODE_TRACE,
  121. NODE_TESTSCAN,
  122. NODE_PMU,
  123. NODE_MAX,
  124. };
  125. enum pm_request_ack {
  126. REQ_ACK_NO = 1,
  127. REQ_ACK_BLOCKING,
  128. REQ_ACK_NON_BLOCKING,
  129. };
  130. enum pm_suspend_reason {
  131. SUSPEND_REASON_PU_REQ = 201,
  132. SUSPEND_REASON_ALERT,
  133. SUSPEND_REASON_SYS_SHUTDOWN,
  134. };
  135. enum pm_ram_state {
  136. PM_RAM_STATE_OFF = 1,
  137. PM_RAM_STATE_RETENTION,
  138. PM_RAM_STATE_ON,
  139. };
  140. /**
  141. * enum pm_boot_status - enum represents the boot status of the PM.
  142. * @PM_INITIAL_BOOT: boot is a fresh system startup.
  143. * @PM_RESUME: boot is a resume.
  144. * @PM_BOOT_ERROR: error, boot cause cannot be identified.
  145. *
  146. */
  147. enum pm_boot_status {
  148. PM_INITIAL_BOOT,
  149. PM_RESUME,
  150. PM_BOOT_ERROR,
  151. };
  152. /**
  153. * enum pm_shutdown_type - enum represents the shutdown type of the PM.
  154. * @PMF_SHUTDOWN_TYPE_SHUTDOWN: shutdown.
  155. * @PMF_SHUTDOWN_TYPE_RESET: reset/reboot.
  156. * @PMF_SHUTDOWN_TYPE_SETSCOPE_ONLY: set the shutdown/reboot scope.
  157. *
  158. */
  159. enum pm_shutdown_type {
  160. PMF_SHUTDOWN_TYPE_SHUTDOWN,
  161. PMF_SHUTDOWN_TYPE_RESET,
  162. PMF_SHUTDOWN_TYPE_SETSCOPE_ONLY,
  163. };
  164. /**
  165. * enum pm_shutdown_subtype - enum represents the shutdown subtype of the PM.
  166. * @PMF_SHUTDOWN_SUBTYPE_SUBSYSTEM: shutdown/reboot APU subsystem only.
  167. * @PMF_SHUTDOWN_SUBTYPE_PS_ONLY: shutdown/reboot entire PS (but not PL).
  168. * @PMF_SHUTDOWN_SUBTYPE_SYSTEM: shutdown/reboot entire system.
  169. *
  170. */
  171. enum pm_shutdown_subtype {
  172. PMF_SHUTDOWN_SUBTYPE_SUBSYSTEM,
  173. PMF_SHUTDOWN_SUBTYPE_PS_ONLY,
  174. PMF_SHUTDOWN_SUBTYPE_SYSTEM,
  175. };
  176. /**
  177. * enum pm_pll_mode - enum represents the mode of the PLL.
  178. * @PM_PLL_MODE_RESET: PLL is in reset (not locked).
  179. * @PM_PLL_MODE_INTEGER: PLL is locked in integer mode.
  180. * @PM_PLL_MODE_FRACTIONAL: PLL is locked in fractional mode.
  181. * @PM_PLL_MODE_MAX: Represents the maximum mode value for the PLL.
  182. */
  183. enum pm_pll_mode {
  184. PM_PLL_MODE_RESET,
  185. PM_PLL_MODE_INTEGER,
  186. PM_PLL_MODE_FRACTIONAL,
  187. PM_PLL_MODE_MAX,
  188. };
  189. /**
  190. * enum pm_clock_div_id - enum represents the clock division identifiers in the
  191. * PM.
  192. * @PM_CLOCK_DIV0_ID: Clock divider 0.
  193. * @PM_CLOCK_DIV1_ID: Clock divider 1.
  194. */
  195. enum pm_clock_div_id {
  196. PM_CLOCK_DIV0_ID,
  197. PM_CLOCK_DIV1_ID,
  198. };
  199. #endif /* ZYNQMP_PM_DEFS_H */