rk3588_def.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /*
  2. * Copyright (c) 2024, Rockchip, Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef __PLAT_DEF_H__
  7. #define __PLAT_DEF_H__
  8. #define SIZE_K(n) ((n) * 1024)
  9. #define WITH_16BITS_WMSK(bits) (0xffff0000 | (bits))
  10. /* Special value used to verify platform parameters from BL2 to BL3-1 */
  11. #define RK_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
  12. #define UMCTL0_BASE 0xf7000000
  13. #define UMCTL1_BASE 0xf8000000
  14. #define UMCTL2_BASE 0xf9000000
  15. #define UMCTL3_BASE 0xfa000000
  16. #define GIC600_BASE 0xfe600000
  17. #define GIC600_SIZE SIZE_K(64)
  18. #define DAPLITE_BASE 0xfd100000
  19. #define PMU0SGRF_BASE 0xfd580000
  20. #define PMU1SGRF_BASE 0xfd582000
  21. #define BUSSGRF_BASE 0xfd586000
  22. #define DSUSGRF_BASE 0xfd587000
  23. #define PMU0GRF_BASE 0xfd588000
  24. #define PMU1GRF_BASE 0xfd58a000
  25. #define SYSGRF_BASE 0xfd58c000
  26. #define BIGCORE0GRF_BASE 0xfd590000
  27. #define BIGCORE1GRF_BASE 0xfd592000
  28. #define LITCOREGRF_BASE 0xfd594000
  29. #define DSUGRF_BASE 0xfd598000
  30. #define DDR01GRF_BASE 0xfd59c000
  31. #define DDR23GRF_BASE 0xfd59d000
  32. #define CENTERGRF_BASE 0xfd59e000
  33. #define GPUGRF_BASE 0xfd5a0000
  34. #define NPUGRF_BASE 0xfd5a2000
  35. #define USBGRF_BASE 0xfd5ac000
  36. #define PHPGRF_BASE 0xfd5b0000
  37. #define PCIE3PHYGRF_BASE 0xfd5b8000
  38. #define USB2PHY0_GRF_BASE 0xfd5d0000
  39. #define USB2PHY1_GRF_BASE 0xfd5d4000
  40. #define USB2PHY2_GRF_BASE 0xfd5d8000
  41. #define USB2PHY3_GRF_BASE 0xfd5dc000
  42. #define PMU0IOC_BASE 0xfd5f0000
  43. #define PMU1IOC_BASE 0xfd5f4000
  44. #define BUSIOC_BASE 0xfd5f8000
  45. #define VCCIO1_4_IOC_BASE 0xfd5f9000
  46. #define VCCIO3_5_IOC_BASE 0xfd5fa000
  47. #define VCCIO2_IOC_BASE 0xfd5fb000
  48. #define VCCIO6_IOC_BASE 0xfd5fc000
  49. #define SRAM_BASE 0xff000000
  50. #define PMUSRAM_BASE 0xff100000
  51. #define PMUSRAM_SIZE SIZE_K(128)
  52. #define PMUSRAM_RSIZE SIZE_K(64)
  53. #define CRU_BASE 0xfd7c0000
  54. #define PHP_CRU_BASE 0xfd7c8000
  55. #define SCRU_BASE 0xfd7d0000
  56. #define BUSSCRU_BASE 0xfd7d8000
  57. #define PMU1SCRU_BASE 0xfd7e0000
  58. #define PMU1CRU_BASE 0xfd7f0000
  59. #define DDR0CRU_BASE 0xfd800000
  60. #define DDR1CRU_BASE 0xfd804000
  61. #define DDR2CRU_BASE 0xfd808000
  62. #define DDR3CRU_BASE 0xfd80c000
  63. #define BIGCORE0CRU_BASE 0xfd810000
  64. #define BIGCORE1CRU_BASE 0xfd812000
  65. #define LITCRU_BASE 0xfd814000
  66. #define DSUCRU_BASE 0xfd818000
  67. #define I2C0_BASE 0xfd880000
  68. #define UART0_BASE 0xfd890000
  69. #define GPIO0_BASE 0xfd8a0000
  70. #define PWM0_BASE 0xfd8b0000
  71. #define PMUPVTM_BASE 0xfd8c0000
  72. #define TIMER_HP_BASE 0xfd8c8000
  73. #define PMU0_BASE 0xfd8d0000
  74. #define PMU1_BASE 0xfd8d4000
  75. #define PMU2_BASE 0xfd8d8000
  76. #define PMU_BASE PMU0_BASE
  77. #define PMUWDT_BASE 0xfd8e0000
  78. #define PMUTIMER_BASE 0xfd8f0000
  79. #define OSC_CHK_BASE 0xfd9b0000
  80. #define VOP_BASE 0xfdd90000
  81. #define HDMIRX_BASE 0xfdee0000
  82. #define MSCH0_BASE 0xfe000000
  83. #define MSCH1_BASE 0xfe002000
  84. #define MSCH2_BASE 0xfe004000
  85. #define MSCH3_BASE 0xfe006000
  86. #define FIREWALL_DSU_BASE 0xfe010000
  87. #define FIREWALL_DDR_BASE 0xfe030000
  88. #define FIREWALL_SYSMEM_BASE 0xfe038000
  89. #define DDRPHY0_BASE 0xfe0c0000
  90. #define DDRPHY1_BASE 0xfe0d0000
  91. #define DDRPHY2_BASE 0xfe0e0000
  92. #define DDRPHY3_BASE 0xfe0f0000
  93. #define TIMER_DDR_BASE 0xfe118000
  94. #define KEYLADDER_BASE 0xfe380000
  95. #define CRYPTO_S_BASE 0xfe390000
  96. #define OTP_S_BASE 0xfe3a0000
  97. #define DCF_BASE 0xfe3c0000
  98. #define STIMER0_BASE 0xfe3d0000
  99. #define WDT_S_BASE 0xfe3e0000
  100. #define CRYPTO_S_BY_KEYLAD_BASE 0xfe420000
  101. #define NSTIMER0_BASE 0xfeae0000
  102. #define NSTIMER1_BASE 0xfeae8000
  103. #define WDT_NS_BASE 0xfeaf0000
  104. #define UART1_BASE 0xfeb40000
  105. #define UART2_BASE 0xfeb50000
  106. #define UART3_BASE 0xfeb60000
  107. #define UART4_BASE 0xfeb70000
  108. #define UART5_BASE 0xfeb80000
  109. #define UART6_BASE 0xfeb90000
  110. #define UART7_BASE 0xfeba0000
  111. #define UART8_BASE 0xfebb0000
  112. #define UART9_BASE 0xfebc0000
  113. #define GPIO1_BASE 0xfec20000
  114. #define GPIO2_BASE 0xfec30000
  115. #define GPIO3_BASE 0xfec40000
  116. #define GPIO4_BASE 0xfec50000
  117. #define MAILBOX1_BASE 0xfec70000
  118. #define OTP_NS_BASE 0xfecc0000
  119. #define INTMUX0_DDR_BASE 0Xfecf8000
  120. #define INTMUX1_DDR_BASE 0Xfecfc000
  121. #define STIMER1_BASE 0xfed30000
  122. /**************************************************************************
  123. * sys sram allocation
  124. **************************************************************************/
  125. #define SRAM_ENTRY_BASE SRAM_BASE
  126. #define SRAM_PMUM0_SHMEM_BASE (SRAM_ENTRY_BASE + SIZE_K(3))
  127. #define SRAM_LD_BASE (SRAM_ENTRY_BASE + SIZE_K(4))
  128. #define SRAM_LD_SIZE SIZE_K(64)
  129. #define SRAM_LD_SP (SRAM_LD_BASE + SRAM_LD_SIZE -\
  130. 128)
  131. /**************************************************************************
  132. * share mem region allocation: 1M~2M
  133. **************************************************************************/
  134. #define DDR_SHARE_MEM SIZE_K(1024)
  135. #define DDR_SHARE_SIZE SIZE_K(64)
  136. #define SHARE_MEM_BASE DDR_SHARE_MEM
  137. #define SHARE_MEM_PAGE_NUM 15
  138. #define SHARE_MEM_SIZE SIZE_K(SHARE_MEM_PAGE_NUM * 4)
  139. #define SCMI_SHARE_MEM_BASE (SHARE_MEM_BASE + SHARE_MEM_SIZE)
  140. #define SCMI_SHARE_MEM_SIZE SIZE_K(4)
  141. #define SMT_BUFFER_BASE SCMI_SHARE_MEM_BASE
  142. #define SMT_BUFFER0_BASE SMT_BUFFER_BASE
  143. /**************************************************************************
  144. * UART related constants
  145. **************************************************************************/
  146. #define RK_DBG_UART_BASE UART2_BASE
  147. #define RK_DBG_UART_BAUDRATE 1500000
  148. #define RK_DBG_UART_CLOCK 24000000
  149. /******************************************************************************
  150. * System counter frequency related constants
  151. ******************************************************************************/
  152. #define SYS_COUNTER_FREQ_IN_TICKS 24000000
  153. #define SYS_COUNTER_FREQ_IN_MHZ 24
  154. /******************************************************************************
  155. * GIC-600 & interrupt handling related constants
  156. ******************************************************************************/
  157. /* Base rk_platform compatible GIC memory map */
  158. #define PLAT_GICD_BASE GIC600_BASE
  159. #define PLAT_GICC_BASE 0
  160. #define PLAT_GICR_BASE (GIC600_BASE + 0x80000)
  161. #define PLAT_GICITS0_BASE 0xfe640000
  162. #define PLAT_GICITS1_BASE 0xfe660000
  163. /******************************************************************************
  164. * sgi, ppi
  165. ******************************************************************************/
  166. #define RK_IRQ_SEC_SGI_0 8
  167. #define RK_IRQ_SEC_SGI_1 9
  168. #define RK_IRQ_SEC_SGI_2 10
  169. #define RK_IRQ_SEC_SGI_3 11
  170. #define RK_IRQ_SEC_SGI_4 12
  171. #define RK_IRQ_SEC_SGI_5 13
  172. #define RK_IRQ_SEC_SGI_6 14
  173. #define RK_IRQ_SEC_SGI_7 15
  174. #define RK_IRQ_SEC_PHY_TIMER 29
  175. /*
  176. * Define a list of Group 1 Secure and Group 0 interrupts as per GICv3
  177. * terminology. On a GICv2 system or mode, the lists will be merged and treated
  178. * as Group 0 interrupts.
  179. */
  180. #define PLAT_RK_GICV3_G1S_IRQS \
  181. INTR_PROP_DESC(RK_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, \
  182. INTR_GROUP1S, GIC_INTR_CFG_LEVEL)
  183. #define PLAT_RK_GICV3_G0_IRQS \
  184. INTR_PROP_DESC(RK_IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY, \
  185. INTR_GROUP0, GIC_INTR_CFG_LEVEL)
  186. /******************************************************************************
  187. * pm reg region memory
  188. ******************************************************************************/
  189. #define ROCKCHIP_PM_REG_REGION_MEM_SIZE SIZE_K(4)
  190. #endif /* __PLAT_DEF_H__ */