pm_node.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /*
  2. * Copyright (c) 2019, Xilinx, Inc. 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. /* Versal PM nodes enums and defines */
  8. #ifndef PM_NODE_H
  9. #define PM_NODE_H
  10. /*********************************************************************
  11. * Macro definitions
  12. ********************************************************************/
  13. #define NODE_CLASS_SHIFT 26U
  14. #define NODE_SUBCLASS_SHIFT 20U
  15. #define NODE_TYPE_SHIFT 14U
  16. #define NODE_INDEX_SHIFT 0U
  17. #define NODE_CLASS_MASK_BITS GENMASK_32(5, 0)
  18. #define NODE_SUBCLASS_MASK_BITS GENMASK_32(5, 0)
  19. #define NODE_TYPE_MASK_BITS GENMASK_32(5, 0)
  20. #define NODE_INDEX_MASK_BITS GENMASK_32(13, 0)
  21. #define NODE_CLASS_MASK (NODE_CLASS_MASK_BITS << NODE_CLASS_SHIFT)
  22. #define NODE_SUBCLASS_MASK (NODE_SUBCLASS_MASK_BITS << NODE_SUBCLASS_SHIFT)
  23. #define NODE_TYPE_MASK (NODE_TYPE_MASK_BITS << NODE_TYPE_SHIFT)
  24. #define NODE_INDEX_MASK (NODE_INDEX_MASK_BITS << NODE_INDEX_SHIFT)
  25. #define NODEID(CLASS, SUBCLASS, TYPE, INDEX) \
  26. ((((CLASS) & NODE_CLASS_MASK_BITS) << NODE_CLASS_SHIFT) | \
  27. (((SUBCLASS) & NODE_SUBCLASS_MASK_BITS) << NODE_SUBCLASS_SHIFT) | \
  28. (((TYPE) & NODE_TYPE_MASK_BITS) << NODE_TYPE_SHIFT) | \
  29. (((INDEX) & NODE_INDEX_MASK_BITS) << NODE_INDEX_SHIFT))
  30. #define NODECLASS(ID) (((ID) & NODE_CLASS_MASK) >> NODE_CLASS_SHIFT)
  31. #define NODESUBCLASS(ID) (((ID) & NODE_SUBCLASS_MASK) >> \
  32. NODE_SUBCLASS_SHIFT)
  33. #define NODETYPE(ID) (((ID) & NODE_TYPE_MASK) >> NODE_TYPE_SHIFT)
  34. #define NODEINDEX(ID) (((ID) & NODE_INDEX_MASK) >> NODE_INDEX_SHIFT)
  35. /*********************************************************************
  36. * Enum definitions
  37. ********************************************************************/
  38. /* Node class types */
  39. enum pm_node_class {
  40. XPM_NODECLASS_MIN,
  41. XPM_NODECLASS_POWER,
  42. XPM_NODECLASS_CLOCK,
  43. XPM_NODECLASS_RESET,
  44. XPM_NODECLASS_MEMIC,
  45. XPM_NODECLASS_STMIC,
  46. XPM_NODECLASS_DEVICE,
  47. XPM_NODECLASS_MAX
  48. };
  49. enum pm_device_node_subclass {
  50. /* Device types */
  51. XPM_NODESUBCL_DEV_CORE = 1,
  52. XPM_NODESUBCL_DEV_PERIPH,
  53. XPM_NODESUBCL_DEV_MEM,
  54. XPM_NODESUBCL_DEV_SOC,
  55. XPM_NODESUBCL_DEV_MEM_CTRLR,
  56. XPM_NODESUBCL_DEV_PHY,
  57. };
  58. enum pm_device_node_type {
  59. /* Device types */
  60. XPM_NODETYPE_DEV_CORE_PMC = 1,
  61. XPM_NODETYPE_DEV_CORE_PSM,
  62. XPM_NODETYPE_DEV_CORE_APU,
  63. XPM_NODETYPE_DEV_CORE_RPU,
  64. XPM_NODETYPE_DEV_OCM,
  65. XPM_NODETYPE_DEV_TCM,
  66. XPM_NODETYPE_DEV_L2CACHE,
  67. XPM_NODETYPE_DEV_DDR,
  68. XPM_NODETYPE_DEV_PERIPH,
  69. XPM_NODETYPE_DEV_SOC,
  70. XPM_NODETYPE_DEV_GT,
  71. };
  72. /* Device node Indexes */
  73. enum pm_device_node_idx {
  74. /* Device nodes */
  75. XPM_NODEIDX_DEV_MIN = 0x0,
  76. /* Processor devices */
  77. XPM_NODEIDX_DEV_PMC_PROC = 0x1,
  78. XPM_NODEIDX_DEV_PSM_PROC = 0x2,
  79. XPM_NODEIDX_DEV_ACPU_0 = 0x3,
  80. XPM_NODEIDX_DEV_ACPU_1 = 0x4,
  81. XPM_NODEIDX_DEV_RPU0_0 = 0x5,
  82. XPM_NODEIDX_DEV_RPU0_1 = 0x6,
  83. /* Memory devices */
  84. XPM_NODEIDX_DEV_OCM_0 = 0x7,
  85. XPM_NODEIDX_DEV_OCM_1 = 0x8,
  86. XPM_NODEIDX_DEV_OCM_2 = 0x9,
  87. XPM_NODEIDX_DEV_OCM_3 = 0xA,
  88. XPM_NODEIDX_DEV_TCM_0_A = 0xB,
  89. XPM_NODEIDX_DEV_TCM_0_B = 0xC,
  90. XPM_NODEIDX_DEV_TCM_1_A = 0xD,
  91. XPM_NODEIDX_DEV_TCM_1_B = 0xE,
  92. XPM_NODEIDX_DEV_L2_BANK_0 = 0xF,
  93. XPM_NODEIDX_DEV_DDR_0 = 0x10,
  94. XPM_NODEIDX_DEV_DDR_1 = 0x11,
  95. XPM_NODEIDX_DEV_DDR_2 = 0x12,
  96. XPM_NODEIDX_DEV_DDR_3 = 0x13,
  97. XPM_NODEIDX_DEV_DDR_4 = 0x14,
  98. XPM_NODEIDX_DEV_DDR_5 = 0x15,
  99. XPM_NODEIDX_DEV_DDR_6 = 0x16,
  100. XPM_NODEIDX_DEV_DDR_7 = 0x17,
  101. /* LPD Peripheral devices */
  102. XPM_NODEIDX_DEV_USB_0 = 0x18,
  103. XPM_NODEIDX_DEV_GEM_0 = 0x19,
  104. XPM_NODEIDX_DEV_GEM_1 = 0x1A,
  105. XPM_NODEIDX_DEV_SPI_0 = 0x1B,
  106. XPM_NODEIDX_DEV_SPI_1 = 0x1C,
  107. XPM_NODEIDX_DEV_I2C_0 = 0x1D,
  108. XPM_NODEIDX_DEV_I2C_1 = 0x1E,
  109. XPM_NODEIDX_DEV_CAN_FD_0 = 0x1F,
  110. XPM_NODEIDX_DEV_CAN_FD_1 = 0x20,
  111. XPM_NODEIDX_DEV_UART_0 = 0x21,
  112. XPM_NODEIDX_DEV_UART_1 = 0x22,
  113. XPM_NODEIDX_DEV_GPIO = 0x23,
  114. XPM_NODEIDX_DEV_TTC_0 = 0x24,
  115. XPM_NODEIDX_DEV_TTC_1 = 0x25,
  116. XPM_NODEIDX_DEV_TTC_2 = 0x26,
  117. XPM_NODEIDX_DEV_TTC_3 = 0x27,
  118. XPM_NODEIDX_DEV_SWDT_LPD = 0x28,
  119. /* FPD Peripheral devices */
  120. XPM_NODEIDX_DEV_SWDT_FPD = 0x29,
  121. /* PMC Peripheral devices */
  122. XPM_NODEIDX_DEV_OSPI = 0x2A,
  123. XPM_NODEIDX_DEV_QSPI = 0x2B,
  124. XPM_NODEIDX_DEV_GPIO_PMC = 0x2C,
  125. XPM_NODEIDX_DEV_I2C_PMC = 0x2D,
  126. XPM_NODEIDX_DEV_SDIO_0 = 0x2E,
  127. XPM_NODEIDX_DEV_SDIO_1 = 0x2F,
  128. XPM_NODEIDX_DEV_PL_0 = 0x30,
  129. XPM_NODEIDX_DEV_PL_1 = 0x31,
  130. XPM_NODEIDX_DEV_PL_2 = 0x32,
  131. XPM_NODEIDX_DEV_PL_3 = 0x33,
  132. XPM_NODEIDX_DEV_RTC = 0x34,
  133. XPM_NODEIDX_DEV_ADMA_0 = 0x35,
  134. XPM_NODEIDX_DEV_ADMA_1 = 0x36,
  135. XPM_NODEIDX_DEV_ADMA_2 = 0x37,
  136. XPM_NODEIDX_DEV_ADMA_3 = 0x38,
  137. XPM_NODEIDX_DEV_ADMA_4 = 0x39,
  138. XPM_NODEIDX_DEV_ADMA_5 = 0x3A,
  139. XPM_NODEIDX_DEV_ADMA_6 = 0x3B,
  140. XPM_NODEIDX_DEV_ADMA_7 = 0x3C,
  141. XPM_NODEIDX_DEV_IPI_0 = 0x3D,
  142. XPM_NODEIDX_DEV_IPI_1 = 0x3E,
  143. XPM_NODEIDX_DEV_IPI_2 = 0x3F,
  144. XPM_NODEIDX_DEV_IPI_3 = 0x40,
  145. XPM_NODEIDX_DEV_IPI_4 = 0x41,
  146. XPM_NODEIDX_DEV_IPI_5 = 0x42,
  147. XPM_NODEIDX_DEV_IPI_6 = 0x43,
  148. /* Entire SoC */
  149. XPM_NODEIDX_DEV_SOC = 0x44,
  150. /* DDR memory controllers */
  151. XPM_NODEIDX_DEV_DDRMC_0 = 0x45,
  152. XPM_NODEIDX_DEV_DDRMC_1 = 0x46,
  153. XPM_NODEIDX_DEV_DDRMC_2 = 0x47,
  154. XPM_NODEIDX_DEV_DDRMC_3 = 0x48,
  155. /* GT devices */
  156. XPM_NODEIDX_DEV_GT_0 = 0x49,
  157. XPM_NODEIDX_DEV_GT_1 = 0x4A,
  158. XPM_NODEIDX_DEV_GT_2 = 0x4B,
  159. XPM_NODEIDX_DEV_GT_3 = 0x4C,
  160. XPM_NODEIDX_DEV_GT_4 = 0x4D,
  161. XPM_NODEIDX_DEV_GT_5 = 0x4E,
  162. XPM_NODEIDX_DEV_GT_6 = 0x4F,
  163. XPM_NODEIDX_DEV_GT_7 = 0x50,
  164. XPM_NODEIDX_DEV_GT_8 = 0x51,
  165. XPM_NODEIDX_DEV_GT_9 = 0x52,
  166. XPM_NODEIDX_DEV_GT_10 = 0x53,
  167. #if defined(PLAT_versal_net)
  168. XPM_NODEIDX_DEV_ACPU_0_0 = 0xAF,
  169. XPM_NODEIDX_DEV_ACPU_0_1 = 0xB0,
  170. XPM_NODEIDX_DEV_ACPU_0_2 = 0xB1,
  171. XPM_NODEIDX_DEV_ACPU_0_3 = 0xB2,
  172. XPM_NODEIDX_DEV_ACPU_1_0 = 0xB3,
  173. XPM_NODEIDX_DEV_ACPU_1_1 = 0xB4,
  174. XPM_NODEIDX_DEV_ACPU_1_2 = 0xB5,
  175. XPM_NODEIDX_DEV_ACPU_1_3 = 0xB6,
  176. XPM_NODEIDX_DEV_ACPU_2_0 = 0xB7,
  177. XPM_NODEIDX_DEV_ACPU_2_1 = 0xB8,
  178. XPM_NODEIDX_DEV_ACPU_2_2 = 0xB9,
  179. XPM_NODEIDX_DEV_ACPU_2_3 = 0xBA,
  180. XPM_NODEIDX_DEV_ACPU_3_0 = 0xBB,
  181. XPM_NODEIDX_DEV_ACPU_3_1 = 0xBC,
  182. XPM_NODEIDX_DEV_ACPU_3_2 = 0xBD,
  183. XPM_NODEIDX_DEV_ACPU_3_3 = 0xBE,
  184. XPM_NODEIDX_DEV_RPU_A_0 = 0xBF,
  185. XPM_NODEIDX_DEV_RPU_A_1 = 0xC0,
  186. XPM_NODEIDX_DEV_RPU_B_0 = 0xC1,
  187. XPM_NODEIDX_DEV_RPU_B_1 = 0xC2,
  188. XPM_NODEIDX_DEV_OCM_0_0 = 0xC3,
  189. XPM_NODEIDX_DEV_OCM_0_1 = 0xC4,
  190. XPM_NODEIDX_DEV_OCM_0_2 = 0xC5,
  191. XPM_NODEIDX_DEV_OCM_0_3 = 0xC6,
  192. XPM_NODEIDX_DEV_OCM_1_0 = 0xC7,
  193. XPM_NODEIDX_DEV_OCM_1_1 = 0xC8,
  194. XPM_NODEIDX_DEV_OCM_1_2 = 0xC9,
  195. XPM_NODEIDX_DEV_OCM_1_3 = 0xCA,
  196. XPM_NODEIDX_DEV_TCM_A_0A = 0xCB,
  197. XPM_NODEIDX_DEV_TCM_A_0B = 0xCC,
  198. XPM_NODEIDX_DEV_TCM_A_0C = 0xCD,
  199. XPM_NODEIDX_DEV_TCM_A_1A = 0xCE,
  200. XPM_NODEIDX_DEV_TCM_A_1B = 0xCF,
  201. XPM_NODEIDX_DEV_TCM_A_1C = 0xD0,
  202. XPM_NODEIDX_DEV_TCM_B_0A = 0xD1,
  203. XPM_NODEIDX_DEV_TCM_B_0B = 0xD2,
  204. XPM_NODEIDX_DEV_TCM_B_0C = 0xD3,
  205. XPM_NODEIDX_DEV_TCM_B_1A = 0xD4,
  206. XPM_NODEIDX_DEV_TCM_B_1B = 0xD5,
  207. XPM_NODEIDX_DEV_TCM_B_1C = 0xD6,
  208. XPM_NODEIDX_DEV_USB_1 = 0xD7,
  209. XPM_NODEIDX_DEV_PMC_WWDT = 0xD8,
  210. XPM_NODEIDX_DEV_LPD_SWDT_0 = 0xD9,
  211. XPM_NODEIDX_DEV_LPD_SWDT_1 = 0xDA,
  212. XPM_NODEIDX_DEV_FPD_SWDT_0 = 0xDB,
  213. XPM_NODEIDX_DEV_FPD_SWDT_1 = 0xDC,
  214. XPM_NODEIDX_DEV_FPD_SWDT_2 = 0xDD,
  215. XPM_NODEIDX_DEV_FPD_SWDT_3 = 0xDE,
  216. #endif
  217. XPM_NODEIDX_DEV_MAX,
  218. };
  219. #endif /* PM_NODE_H */