crmu_def.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /*
  2. * Copyright (c) 2019-2020, Broadcom
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CRMU_DEF_H
  7. #define CRMU_DEF_H
  8. #define CRMU_REGS_BASE 0x66410000
  9. /* 32 kB IDRAM */
  10. #define CRMU_IDRAM_BASE_ADDR CRMU_REGS_BASE
  11. #define CRMU_IDRAM_SIZE 0x8000
  12. /* 4 kB Scratch RAM */
  13. #define CRMU_SRAM_BASE (CRMU_IDRAM_BASE_ADDR + CRMU_IDRAM_SIZE)
  14. #define CRMU_SRAM_SIZE 0x1000
  15. #define CRMU_RESERVED_SPACE 0x3000
  16. #define CRMU_CORE_BASE (CRMU_SRAM_BASE + CRMU_SRAM_SIZE + \
  17. CRMU_RESERVED_SPACE)
  18. #define CRMU_SHARED_SRAM_BASE CRMU_SRAM_BASE
  19. #define CRMU_SHARED_SRAM_SIZE 0x200
  20. #define CRMU_CFG_BASE (CRMU_SHARED_SRAM_BASE + \
  21. CRMU_SHARED_SRAM_SIZE)
  22. #define CRMU_PWR_GOOD_STATUS CRMU_CORE_BASE
  23. #define CRMU_PWR_GOOD_STATUS__BBL_POWER_GOOD 0
  24. #define CRMU_ISO_CELL_CONTROL (CRMU_CORE_BASE + 0x4)
  25. #define CRMU_ISO_CELL_CONTROL__CRMU_ISO_PDBBL 16
  26. #define CRMU_ISO_CELL_CONTROL__CRMU_ISO_PDBBL_TAMPER 24
  27. #define CRMU_SPRU_SOURCE_SEL_STAT (CRMU_CORE_BASE + 0xc)
  28. #define CRMU_SPRU_SOURCE_SEL_STAT__SPRU_SOURCE_SELECT 0
  29. #define BSTI_BASE (CRMU_CORE_BASE + 0x28)
  30. #define BSTI_CONTROL_OFFSET BSTI_BASE
  31. #define BSTI_COMMAND_OFFSET (BSTI_BASE + 0x4)
  32. #define OCOTP_REGS_BASE (CRMU_CORE_BASE + 0x400)
  33. #define CRMU_TCI_BASE (CRMU_CORE_BASE + 0x800)
  34. #define CRMU_SWREG_STATUS_ADDR (CRMU_TCI_BASE + 0x0c)
  35. #define CRMU_CHIP_OTPC_STATUS (CRMU_TCI_BASE + 0x10)
  36. #define CRMU_CHIP_OTPC_STATUS__OTP_BISR_LOAD_DONE 19
  37. #define CRMU_BISR_PDG_MASK (CRMU_TCI_BASE + 0x4c)
  38. #define CRMU_BISR_PDG_MASK__CRMU_BISR_IHOST0 2
  39. #define CRMU_BISR_PDG_MASK__CRMU_BISR_IHOST1 3
  40. #define CRMU_BISR_PDG_MASK__CRMU_BISR_IHOST2 4
  41. #define CRMU_BISR_PDG_MASK__CRMU_BISR_IHOST3 0
  42. #define CRMU_POWER_POLL (CRMU_TCI_BASE + 0x60)
  43. #define CRMU_OTP_STATUS CRMU_POWER_POLL
  44. #define CRMU_OTP_STATUS_BIT 1
  45. #define CRMU_DDR_PHY_AON_CTRL (CRMU_TCI_BASE + 0x64)
  46. #define CRMU_DDRPHY2_HW_RESETN_R BIT(21)
  47. #define CRMU_DDRPHY2_PWROKIN_PHY_R BIT(20)
  48. #define CRMU_DDRPHY2_PWRONIN_PHY_R BIT(19)
  49. #define CRMU_DDRPHY2_ISO_PHY_DFI_R BIT(18)
  50. #define CRMU_DDRPHY2_ISO_PHY_REGS_R BIT(17)
  51. #define CRMU_DDRPHY2_ISO_PHY_PLL_R BIT(16)
  52. #define CRMU_DDRPHY1_HW_RESETN_R BIT(13)
  53. #define CRMU_DDRPHY1_PWROKIN_PHY_R BIT(12)
  54. #define CRMU_DDRPHY1_PWRONIN_PHY_R BIT(11)
  55. #define CRMU_DDRPHY1_ISO_PHY_DFI_R BIT(10)
  56. #define CRMU_DDRPHY1_ISO_PHY_REGS_R BIT(9)
  57. #define CRMU_DDRPHY1_ISO_PHY_PLL_R BIT(8)
  58. #define CRMU_DDRPHY0_HW_RESETN_R BIT(5)
  59. #define CRMU_DDRPHY0_PWROKIN_PHY_R BIT(4)
  60. #define CRMU_DDRPHY0_PWRONIN_PHY_R BIT(3)
  61. #define CRMU_DDRPHY0_ISO_PHY_DFI_R BIT(2)
  62. #define CRMU_DDRPHY0_ISO_PHY_REGS_R BIT(1)
  63. #define CRMU_DDRPHY0_ISO_PHY_PLL_R BIT(0)
  64. #define CRMU_EMEM_RESET_N_R BIT(16)
  65. #define CRMU_EMEM_PRESET_N_R BIT(0)
  66. #define CRMU_SWREG_CTRL_ADDR (CRMU_TCI_BASE + 0x6c)
  67. #define CRMU_AON_CTRL1 (CRMU_TCI_BASE + 0x70)
  68. #define CRMU_AON_CTRL1__LCPLL1_ISO_IN 18
  69. #define CRMU_AON_CTRL1__LCPLL1_PWRON_LDO 19
  70. #define CRMU_AON_CTRL1__LCPLL1_PWR_ON 20
  71. #define CRMU_AON_CTRL1__LCPLL0_ISO_IN 21
  72. #define CRMU_AON_CTRL1__LCPLL0_PWRON_LDO 22
  73. #define CRMU_AON_CTRL1__LCPLL0_PWR_ON 23
  74. #define CRMU_PCIE_LCPLL_PWR_ON_SHIFT 29
  75. #define CRMU_PCIE_LCPLL_PWR_ON_MASK BIT(CRMU_PCIE_LCPLL_PWR_ON_SHIFT)
  76. #define CRMU_PCIE_LCPLL_PWRON_LDO_SHIFT 28
  77. #define CRMU_PCIE_LCPLL_PWRON_LDO_MASK BIT(CRMU_PCIE_LCPLL_PWRON_LDO_SHIFT)
  78. #define CRMU_PCIE_LCPLL_ISO_IN_SHIFT 27
  79. #define CRMU_PCIE_LCPLL_ISO_IN_MASK BIT(CRMU_PCIE_LCPLL_ISO_IN_SHIFT)
  80. #define CRMU_MASTER_AXI_ARUSER_CONFIG (CRMU_TCI_BASE + 0x74)
  81. #define CRMU_MASTER_AXI_AWUSER_CONFIG (CRMU_TCI_BASE + 0x78)
  82. #define CRMU_DDR_PHY_AON_CTRL_1 (CRMU_TCI_BASE + 0x8c)
  83. #define CDRU_BASE_ADDR (CRMU_CORE_BASE + 0x1000)
  84. #define CDRU_MISC_RESET_CONTROL CDRU_BASE_ADDR
  85. #define CDRU_MISC_RESET_CONTROL_TS_RESET_N 16
  86. #define CDRU_MISC_RESET_CONTROL__CDRU_USBSS_RESET_N 14
  87. #define CDRU_MISC_RESET_CONTROL__CDRU_SATA_RESET_N_R 15
  88. #define CDRU_MISC_RESET_CONTROL__CDRU_MHB_RESET_N_R 13
  89. #define CDRU_MISC_RESET_CONTROL__CDRU_PCIE_RESET_N_R 3
  90. #define CDRU_MISC_RESET_CONTROL__CDRU_PM_RESET_N_R 2
  91. #define CDRU_MISC_RESET_CONTROL__CDRU_NITRO_RESET_N_R 1
  92. #define CDRU_PROC_EVENT_CLEAR (CDRU_BASE_ADDR + 0x48)
  93. #define CDRU_PROC_EVENT_CLEAR__IH0_CDRU_STANDBYWFIL2 0
  94. #define CDRU_PROC_EVENT_CLEAR__IH0_CDRU_STANDBYWFI 3
  95. #define CDRU_PROC_EVENT_CLEAR__IH1_CDRU_STANDBYWFIL2 5
  96. #define CDRU_PROC_EVENT_CLEAR__IH1_CDRU_STANDBYWFI 8
  97. #define CDRU_PROC_EVENT_CLEAR__IH2_CDRU_STANDBYWFIL2 10
  98. #define CDRU_PROC_EVENT_CLEAR__IH2_CDRU_STANDBYWFI 13
  99. #define CDRU_PROC_EVENT_CLEAR__IH3_CDRU_STANDBYWFIL2 15
  100. #define CDRU_PROC_EVENT_CLEAR__IH3_CDRU_STANDBYWFI 18
  101. #define CDRU_CHIP_STRAP_CTRL (CDRU_BASE_ADDR + 0x50)
  102. #define CDRU_CHIP_STRAP_CTRL__SOFTWARE_OVERRIDE 31
  103. #define CDRU_CHIP_IO_PAD_CONTROL (CDRU_BASE_ADDR + 0x58)
  104. #define CDRU_CHIP_IO_PAD_CONTROL__CDRU_IOMUX_FORCE_PDN_R 8
  105. #define CDRU_CHIP_IO_PAD_CONTROL__CDRU_IOMUX_FORCE_PAD_IN_R 0
  106. #define CDRU_CHIP_STRAP_DATA_LSW (CDRU_BASE_ADDR + 0x5c)
  107. #define CDRU_CHIP_STRAP_DATA_LSW__BISR_BYPASS_MODE 18
  108. #define CDRU_CHIP_STRAP_DATA_LSW__NIC_MODE_MASK BIT(8)
  109. #define CDRU_CHIP_STRAP_DATA_LSW_PAD_USB_MODE BIT(26)
  110. #define CDRU_CHIP_STRAP_DATA (CDRU_BASE_ADDR + 0x5c)
  111. #define CDRU_DDR0_CONTROL_OFFSET (CDRU_BASE_ADDR + 0xb8)
  112. #define CDRU_DDR1_CONTROL_OFFSET (CDRU_BASE_ADDR + 0xbc)
  113. #define CDRU_DDR2_CONTROL_OFFSET (CDRU_BASE_ADDR + 0xc0)
  114. #define CRMU_SW_POR_RESET_CTRL (CDRU_BASE_ADDR + 0x100)
  115. #define CDRU_GENPLL2_CONTROL1 (CDRU_BASE_ADDR + 0x1b0)
  116. #define CDRU_GENPLL2_CONTROL1__CHNL6_FS4_CLK BIT(11)
  117. #define CDRU_GENPLL5_CONTROL1 (CDRU_BASE_ADDR + 0x24c)
  118. #define CDRU_GENPLL5_CONTROL1__CHNL0_DME_CLK BIT(6)
  119. #define CDRU_GENPLL5_CONTROL1__CHNL1_CRYPTO_AE_CLK BIT(7)
  120. #define CDRU_GENPLL5_CONTROL1__CHNL2_RAID_AE_CLK BIT(8)
  121. #define CDRU_NITRO_CONTROL (CDRU_BASE_ADDR + 0x2c4)
  122. #define CDRU_NITRO_CONTROL__CDRU_NITRO_SEC_MODE_R 20
  123. #define CDRU_NITRO_CONTROL__CDRU_NITRO_SEC_OVERRIDE_R 16
  124. #define CDRU_MISC_CLK_ENABLE_CONTROL (CDRU_BASE_ADDR + 0x2c8)
  125. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_EMEM2_CLK_EN_R 11
  126. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_EMEM1_CLK_EN_R 10
  127. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_EMEM0_CLK_EN_R 9
  128. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_SATA_CLK_EN_R 8
  129. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_USBSS_CLK_EN_R 7
  130. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_MHB_CLK_EN_R 6
  131. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_HSLS_CLK_EN_R 5
  132. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_SCR_CLK_EN_R 4
  133. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_FS4_CLK_EN_R 3
  134. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_PCIE_CLK_EN_R 2
  135. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_PM_CLK_EN_R 1
  136. #define CDRU_MISC_CLK_ENABLE_CONTROL__CDRU_NITRO_CLK_EN_R 0
  137. #define CDRU_CCN_REGISTER_CONTROL_1 (CDRU_BASE_ADDR + 0x324)
  138. #define CDRU_CCN_REGISTER_CONTROL_1__D2XS_PD_EMEM0_BIT 6
  139. #define CDRU_CCN_REGISTER_CONTROL_1__D2XS_PD_EMEM1_BIT 5
  140. #define CDRU_CCN_REGISTER_CONTROL_1__D2XS_PD_EMEM2_BIT 4
  141. #define CDRU_CHIP_TOP_SPARE_REG0 (CDRU_BASE_ADDR + 0x378)
  142. #define CDRU_CHIP_TOP_SPARE_REG1 (CDRU_BASE_ADDR + 0x37c)
  143. #define CENTRAL_TIMER_BASE (CRMU_CORE_BASE + 0x5000)
  144. #define CENTRAL_TIMER_CTRL (CENTRAL_TIMER_BASE + 0x0)
  145. #define CENTRAL_TIMER_GET_L (CENTRAL_TIMER_BASE + 0x4)
  146. #define CENTRAL_TIMER_GET_L0 (CENTRAL_TIMER_BASE + 0x8) /* SCR STM */
  147. #define CENTRAL_TIMER_GET_L1 (CENTRAL_TIMER_BASE + 0xC) /* FS STM */
  148. #define CENTRAL_TIMER_GET_L2 (CENTRAL_TIMER_BASE + 0x10) /* iHost0 */
  149. #define CENTRAL_TIMER_GET_L3 (CENTRAL_TIMER_BASE + 0x14) /* iHost1 */
  150. #define CENTRAL_TIMER_GET_L4 (CENTRAL_TIMER_BASE + 0x18) /* iHost2 */
  151. #define CENTRAL_TIMER_GET_L5 (CENTRAL_TIMER_BASE + 0x1C) /* iHost3 */
  152. #define CENTRAL_TIMER_GET_H (CENTRAL_TIMER_BASE + 0x28)
  153. #define CENTRAL_TIMER_SAT_TMR_ENA (CENTRAL_TIMER_BASE + 0x34)
  154. #define CENTRAL_TIMER_GET_IHOST_ENA_BASE (CENTRAL_TIMER_GET_L2)
  155. #define CRMU_WDT_REGS_BASE (CRMU_CORE_BASE + 0x6000)
  156. #define CRMU_MAIL_BOX0 (CRMU_CORE_BASE + 0x8024)
  157. #define CRMU_MAIL_BOX1 (CRMU_CORE_BASE + 0x8028)
  158. #define CRMU_READ_MAIL_BOX0 (CRMU_CORE_BASE + 0x802c)
  159. #define CRMU_READ_MAIL_BOX1 (CRMU_CORE_BASE + 0x8030)
  160. #define AP_TO_SCP_MAILBOX1 CRMU_MAIL_BOX1
  161. #define SCP_TO_AP_MAILBOX1 CRMU_READ_MAIL_BOX1
  162. #define CRMU_IHOST_POWER_CONFIG (CRMU_CORE_BASE + 0x8038)
  163. #define CRMU_RESET_EVENT_LOG (CRMU_CORE_BASE + 0x8064)
  164. #define CRMU_SOFT_RESET_CTRL (CRMU_CORE_BASE + 0x8090)
  165. #define CRMU_SOFT_RESET_CTRL__SOFT_PWR_UP_RST 0
  166. #define CRMU_SOFT_RESET_CTRL__SOFT_SYS_RST 1
  167. #define CRMU_SPARE_REG_0 (CRMU_CORE_BASE + 0x80b8)
  168. #define CRMU_SPARE_REG_1 (CRMU_CORE_BASE + 0x80bc)
  169. #define CRMU_SPARE_REG_2 (CRMU_CORE_BASE + 0x80c0)
  170. #define CRMU_SPARE_REG_3 (CRMU_CORE_BASE + 0x80c4)
  171. #define CRMU_SPARE_REG_4 (CRMU_CORE_BASE + 0x80c8)
  172. #define CRMU_SPARE_REG_5 (CRMU_CORE_BASE + 0x80cc)
  173. #define CRMU_CORE_ADDR_RANGE0_LOW (CRMU_CORE_BASE + 0x8c30)
  174. #define CRMU_CORE_ADDR_RANGE1_LOW (CRMU_CORE_BASE + 0x8c38)
  175. #define CRMU_CORE_ADDR_RANGE2_LOW (CRMU_CORE_BASE + 0x8c40)
  176. #define CRMU_IHOST_SW_PERSISTENT_REG0 (CRMU_CORE_BASE + 0x8c54)
  177. #define CRMU_IHOST_SW_PERSISTENT_REG1 (CRMU_CORE_BASE + 0x8c58)
  178. #define CRMU_IHOST_SW_PERSISTENT_REG2 (CRMU_CORE_BASE + 0x8c5c)
  179. #define CRMU_IHOST_SW_PERSISTENT_REG3 (CRMU_CORE_BASE + 0x8c60)
  180. #define CRMU_IHOST_SW_PERSISTENT_REG4 (CRMU_CORE_BASE + 0x8c64)
  181. #define CRMU_IHOST_SW_PERSISTENT_REG5 (CRMU_CORE_BASE + 0x8c68)
  182. #define CRMU_IHOST_SW_PERSISTENT_REG6 (CRMU_CORE_BASE + 0x8c6c)
  183. #define CRMU_IHOST_SW_PERSISTENT_REG7 (CRMU_CORE_BASE + 0x8c70)
  184. #define CRMU_BBL_AUTH_CHECK (CRMU_CORE_BASE + 0x8c78)
  185. #define CRMU_SOTP_NEUTRALIZE_ENABLE (CRMU_CORE_BASE + 0x8c84)
  186. #define CRMU_IHOST_SW_PERSISTENT_REG8 (CRMU_CORE_BASE + 0x8c88)
  187. #define CRMU_IHOST_SW_PERSISTENT_REG9 (CRMU_CORE_BASE + 0x8c8c)
  188. #define CRMU_IHOST_SW_PERSISTENT_REG10 (CRMU_CORE_BASE + 0x8c90)
  189. #define CRMU_IHOST_SW_PERSISTENT_REG11 (CRMU_CORE_BASE + 0x8c94)
  190. #define CNT_CONTROL_BASE (CRMU_CORE_BASE + 0x9000)
  191. #define CNTCR (CNT_CONTROL_BASE)
  192. #define CNTCR__EN BIT(0)
  193. #define SPRU_BBL_WDATA (CRMU_CORE_BASE + 0xa000)
  194. #define SPRU_BBL_CMD (CRMU_CORE_BASE + 0xa004)
  195. #define SPRU_BBL_CMD__IND_SOFT_RST_N 10
  196. #define SPRU_BBL_CMD__IND_WR 11
  197. #define SPRU_BBL_CMD__BBL_ADDR_R 0
  198. #define SPRU_BBL_CMD__IND_RD 12
  199. #define SPRU_BBL_CMD__BBL_ADDR_R 0
  200. #define SPRU_BBL_STATUS (CRMU_CORE_BASE + 0xa008)
  201. #define SPRU_BBL_STATUS__ACC_DONE 0
  202. #define SPRU_BBL_RDATA (CRMU_CORE_BASE + 0xa00c)
  203. #endif /* CRMU_DEF_H */