rk3328_def.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef RK3328_DEF_H
  7. #define RK3328_DEF_H
  8. #define MAJOR_VERSION (1)
  9. #define MINOR_VERSION (2)
  10. #define SIZE_K(n) ((n) * 1024)
  11. /* Special value used to verify platform parameters from BL2 to BL3-1 */
  12. #define RK_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
  13. #define UART0_BASE 0xff110000
  14. #define UART0_SIZE SIZE_K(64)
  15. #define UART1_BASE 0xff120000
  16. #define UART1_SIZE SIZE_K(64)
  17. #define UART2_BASE 0xff130000
  18. #define UART2_SIZE SIZE_K(64)
  19. #define PMU_BASE 0xff140000
  20. #define PMU_SIZE SIZE_K(64)
  21. #define SGRF_BASE 0xff0d0000
  22. #define SGRF_SIZE SIZE_K(64)
  23. #define CRU_BASE 0xff440000
  24. #define CRU_SIZE SIZE_K(64)
  25. #define GRF_BASE 0xff100000
  26. #define GRF_SIZE SIZE_K(64)
  27. #define GPIO0_BASE 0xff210000
  28. #define GPIO0_SIZE SIZE_K(32)
  29. #define GPIO1_BASE 0xff220000
  30. #define GPIO1_SIZE SIZE_K(32)
  31. #define GPIO2_BASE 0xff230000
  32. #define GPIO2_SIZE SIZE_K(64)
  33. #define GPIO3_BASE 0xff240000
  34. #define GPIO3_SIZE SIZE_K(64)
  35. #define STIME_BASE 0xff1d0000
  36. #define STIME_SIZE SIZE_K(64)
  37. #define INTMEM_BASE 0xff090000
  38. #define INTMEM_SIZE SIZE_K(32)
  39. #define SRAM_LDS_BASE (INTMEM_BASE + SIZE_K(4))
  40. #define SRAM_LDS_SIZE (INTMEM_SIZE - SIZE_K(4))
  41. #define PMUSRAM_BASE INTMEM_BASE
  42. #define PMUSRAM_SIZE SIZE_K(4)
  43. #define PMUSRAM_RSIZE SIZE_K(4)
  44. #define VOP_BASE 0xff370000
  45. #define VOP_SIZE SIZE_K(16)
  46. #define DDR_PHY_BASE 0xff400000
  47. #define DDR_PHY_SIZE SIZE_K(4)
  48. #define SERVER_MSCH_BASE 0xff720000
  49. #define SERVER_MSCH_SIZE SIZE_K(4)
  50. #define DDR_UPCTL_BASE 0xff780000
  51. #define DDR_UPCTL_SIZE SIZE_K(12)
  52. #define DDR_MONITOR_BASE 0xff790000
  53. #define DDR_MONITOR_SIZE SIZE_K(4)
  54. #define FIREWALL_DDR_BASE 0xff7c0000
  55. #define FIREWALL_DDR_SIZE SIZE_K(64)
  56. #define FIREWALL_CFG_BASE 0xff7d0000
  57. #define FIREWALL_CFG_SIZE SIZE_K(64)
  58. #define GIC400_BASE 0xff810000
  59. #define GIC400_SIZE SIZE_K(64)
  60. #define DDR_GRF_BASE 0xff798000
  61. #define DDR_GRF_SIZE SIZE_K(16)
  62. #define PWM_BASE 0xff1b0000
  63. #define PWM_SIZE SIZE_K(64)
  64. #define DDR_PARAM_BASE 0x02000000
  65. #define DDR_PARAM_SIZE SIZE_K(4)
  66. #define EFUSE8_BASE 0xff260000
  67. #define EFUSE8_SIZE SIZE_K(4)
  68. #define EFUSE32_BASE 0xff0b0000
  69. #define EFUSE32_SIZE SIZE_K(4)
  70. /**************************************************************************
  71. * UART related constants
  72. **************************************************************************/
  73. #define RK3328_BAUDRATE 1500000
  74. #define RK3328_UART_CLOCK 24000000
  75. /******************************************************************************
  76. * System counter frequency related constants
  77. ******************************************************************************/
  78. #define SYS_COUNTER_FREQ_IN_TICKS 24000000U
  79. #define SYS_COUNTER_FREQ_IN_MHZ 24
  80. /******************************************************************************
  81. * GIC-400 & interrupt handling related constants
  82. ******************************************************************************/
  83. /* Base rk_platform compatible GIC memory map */
  84. #define RK3328_GICD_BASE (GIC400_BASE + 0x1000)
  85. #define RK3328_GICC_BASE (GIC400_BASE + 0x2000)
  86. #define RK3328_GICR_BASE 0 /* no GICR in GIC-400 */
  87. /******************************************************************************
  88. * sgi, ppi
  89. ******************************************************************************/
  90. #define RK_IRQ_SEC_PHY_TIMER 29
  91. #define RK_IRQ_SEC_SGI_0 8
  92. #define RK_IRQ_SEC_SGI_1 9
  93. #define RK_IRQ_SEC_SGI_2 10
  94. #define RK_IRQ_SEC_SGI_3 11
  95. #define RK_IRQ_SEC_SGI_4 12
  96. #define RK_IRQ_SEC_SGI_5 13
  97. #define RK_IRQ_SEC_SGI_6 14
  98. #define RK_IRQ_SEC_SGI_7 15
  99. /*
  100. * Define a list of Group 0 interrupts.
  101. */
  102. #define PLAT_RK_GICV2_G0_IRQS \
  103. INTR_PROP_DESC(RK_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, \
  104. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL), \
  105. INTR_PROP_DESC(RK_IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY, \
  106. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL)
  107. #define SHARE_MEM_BASE 0x100000/* [1MB, 1MB+60K]*/
  108. #define SHARE_MEM_PAGE_NUM 15
  109. #define SHARE_MEM_SIZE SIZE_K(SHARE_MEM_PAGE_NUM * 4)
  110. #endif /* RK3328_DEF_H */