px30_def.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef __PX30_DEF_H__
  7. #define __PX30_DEF_H__
  8. #define MAJOR_VERSION (1)
  9. #define MINOR_VERSION (0)
  10. #define SIZE_K(n) ((n) * 1024)
  11. #define SIZE_M(n) ((n) * 1024 * 1024)
  12. #define WITH_16BITS_WMSK(bits) (0xffff0000 | (bits))
  13. /* Special value used to verify platform parameters from BL2 to BL3-1 */
  14. #define RK_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
  15. #define PMU_BASE 0xff000000
  16. #define PMU_SIZE SIZE_K(64)
  17. #define PMUGRF_BASE 0xff010000
  18. #define PMUGRF_SIZE SIZE_K(64)
  19. #define PMUSRAM_BASE 0xff020000
  20. #define PMUSRAM_SIZE SIZE_K(64)
  21. #define PMUSRAM_RSIZE SIZE_K(8)
  22. #define UART0_BASE 0xff030000
  23. #define UART0_SIZE SIZE_K(64)
  24. #define GPIO0_BASE 0xff040000
  25. #define GPIO0_SIZE SIZE_K(64)
  26. #define PMUSGRF_BASE 0xff050000
  27. #define PMUSGRF_SIZE SIZE_K(64)
  28. #define INTSRAM_BASE 0xff0e0000
  29. #define INTSRAM_SIZE SIZE_K(64)
  30. #define SGRF_BASE 0xff11c000
  31. #define SGRF_SIZE SIZE_K(16)
  32. #define GIC400_BASE 0xff130000
  33. #define GIC400_SIZE SIZE_K(64)
  34. #define GRF_BASE 0xff140000
  35. #define GRF_SIZE SIZE_K(64)
  36. #define UART1_BASE 0xff158000
  37. #define UART1_SIZE SIZE_K(64)
  38. #define UART2_BASE 0xff160000
  39. #define UART2_SIZE SIZE_K(64)
  40. #define UART3_BASE 0xff168000
  41. #define UART3_SIZE SIZE_K(64)
  42. #define UART5_BASE 0xff178000
  43. #define UART5_SIZE SIZE_K(64)
  44. #define I2C0_BASE 0xff180000
  45. #define I2C0_SIZE SIZE_K(64)
  46. #define PWM0_BASE 0xff200000
  47. #define PWM0_SIZE SIZE_K(32)
  48. #define PWM1_BASE 0xff208000
  49. #define PWM1_SIZE SIZE_K(32)
  50. #define NTIME_BASE 0xff210000
  51. #define NTIME_SIZE SIZE_K(64)
  52. #define STIME_BASE 0xff220000
  53. #define STIME_SIZE SIZE_K(64)
  54. #define DCF_BASE 0xff230000
  55. #define DCF_SIZE SIZE_K(64)
  56. #define GPIO1_BASE 0xff250000
  57. #define GPIO1_SIZE SIZE_K(64)
  58. #define GPIO2_BASE 0xff260000
  59. #define GPIO2_SIZE SIZE_K(64)
  60. #define GPIO3_BASE 0xff270000
  61. #define GPIO3_SIZE SIZE_K(64)
  62. #define DDR_PHY_BASE 0xff2a0000
  63. #define DDR_PHY_SIZE SIZE_K(64)
  64. #define CRU_BASE 0xff2b0000
  65. #define CRU_SIZE SIZE_K(32)
  66. #define CRU_BOOST_BASE 0xff2b8000
  67. #define CRU_BOOST_SIZE SIZE_K(16)
  68. #define PMUCRU_BASE 0xff2bc000
  69. #define PMUCRU_SIZE SIZE_K(16)
  70. #define VOP_BASE 0xff460000
  71. #define VOP_SIZE SIZE_K(16)
  72. #define SERVER_MSCH_BASE 0xff530000
  73. #define SERVER_MSCH_SIZE SIZE_K(64)
  74. #define FIREWALL_DDR_BASE 0xff534000
  75. #define FIREWALL_DDR_SIZE SIZE_K(16)
  76. #define DDR_UPCTL_BASE 0xff600000
  77. #define DDR_UPCTL_SIZE SIZE_K(64)
  78. #define DDR_MNTR_BASE 0xff610000
  79. #define DDR_MNTR_SIZE SIZE_K(64)
  80. #define DDR_STDBY_BASE 0xff620000
  81. #define DDR_STDBY_SIZE SIZE_K(64)
  82. #define DDRGRF_BASE 0xff630000
  83. #define DDRGRF_SIZE SIZE_K(32)
  84. /**************************************************************************
  85. * UART related constants
  86. **************************************************************************/
  87. #define PX30_UART_BASE UART2_BASE
  88. #define PX30_BAUDRATE 1500000
  89. #define PX30_UART_CLOCK 24000000
  90. /******************************************************************************
  91. * System counter frequency related constants
  92. ******************************************************************************/
  93. #define SYS_COUNTER_FREQ_IN_TICKS 24000000
  94. #define SYS_COUNTER_FREQ_IN_MHZ 24
  95. /******************************************************************************
  96. * GIC-400 & interrupt handling related constants
  97. ******************************************************************************/
  98. /* Base rk_platform compatible GIC memory map */
  99. #define PX30_GICD_BASE (GIC400_BASE + 0x1000)
  100. #define PX30_GICC_BASE (GIC400_BASE + 0x2000)
  101. #define PX30_GICR_BASE 0 /* no GICR in GIC-400 */
  102. /******************************************************************************
  103. * sgi, ppi
  104. ******************************************************************************/
  105. #define RK_IRQ_SEC_PHY_TIMER 29
  106. #define RK_IRQ_SEC_SGI_0 8
  107. #define RK_IRQ_SEC_SGI_1 9
  108. #define RK_IRQ_SEC_SGI_2 10
  109. #define RK_IRQ_SEC_SGI_3 11
  110. #define RK_IRQ_SEC_SGI_4 12
  111. #define RK_IRQ_SEC_SGI_5 13
  112. #define RK_IRQ_SEC_SGI_6 14
  113. #define RK_IRQ_SEC_SGI_7 15
  114. /*
  115. * Define a list of Group 0 interrupts.
  116. */
  117. #define PLAT_RK_GICV2_G0_IRQS \
  118. INTR_PROP_DESC(RK_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, \
  119. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL), \
  120. INTR_PROP_DESC(RK_IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY, \
  121. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL)
  122. #define SHARE_MEM_BASE 0x100000/* [1MB, 1MB+60K]*/
  123. #define SHARE_MEM_PAGE_NUM 15
  124. #define SHARE_MEM_SIZE SIZE_K(SHARE_MEM_PAGE_NUM * 4)
  125. #define DDR_PARAM_BASE 0x02000000
  126. #define DDR_PARAM_SIZE SIZE_K(4)
  127. #endif /* __PLAT_DEF_H__ */