rk3288_def.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef RK3288_DEF_H
  7. #define RK3288_DEF_H
  8. /* Special value used to verify platform parameters from BL2 to BL31 */
  9. #define RK_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
  10. #define SIZE_K(n) ((n) * 1024)
  11. #define SIZE_M(n) ((n) * 1024 * 1024)
  12. #define SRAM_TEXT_LIMIT (4 * 1024)
  13. #define SRAM_DATA_LIMIT (4 * 1024)
  14. #define DDR_PCTL0_BASE 0xff610000
  15. #define DDR_PCTL0_SIZE SIZE_K(64)
  16. #define DDR_PHY0_BASE 0xff620000
  17. #define DDR_PHY0_SIZE SIZE_K(64)
  18. #define DDR_PCTL1_BASE 0xff630000
  19. #define DDR_PCTL1_SIZE SIZE_K(64)
  20. #define DDR_PHY1_BASE 0xff640000
  21. #define DDR_PHY1_SIZE SIZE_K(64)
  22. #define UART0_BASE 0xff180000
  23. #define UART0_SIZE SIZE_K(64)
  24. #define UART1_BASE 0xff190000
  25. #define UART1_SIZE SIZE_K(64)
  26. #define UART2_BASE 0xff690000
  27. #define UART2_SIZE SIZE_K(64)
  28. #define UART3_BASE 0xff1b0000
  29. #define UART3_SIZE SIZE_K(64)
  30. #define UART4_BASE 0xff1c0000
  31. #define UART4_SIZE SIZE_K(64)
  32. /* 96k instead of 64k? */
  33. #define SRAM_BASE 0xff700000
  34. #define SRAM_SIZE SIZE_K(64)
  35. #define PMUSRAM_BASE 0xff720000
  36. #define PMUSRAM_SIZE SIZE_K(4)
  37. #define PMUSRAM_RSIZE SIZE_K(4)
  38. #define PMU_BASE 0xff730000
  39. #define PMU_SIZE SIZE_K(64)
  40. #define SGRF_BASE 0xff740000
  41. #define SGRF_SIZE SIZE_K(64)
  42. #define CRU_BASE 0xff760000
  43. #define CRU_SIZE SIZE_K(64)
  44. #define GRF_BASE 0xff770000
  45. #define GRF_SIZE SIZE_K(64)
  46. /* timer 6+7 can be set as secure in SGRF */
  47. #define STIME_BASE 0xff810000
  48. #define STIME_SIZE SIZE_K(64)
  49. #define SERVICE_BUS_BASE 0xffac0000
  50. #define SERVICE_BUS_SIZE SIZE_K(64)
  51. #define TZPC_BASE 0xffb00000
  52. #define TZPC_SIZE SIZE_K(64)
  53. #define GIC400_BASE 0xffc00000
  54. #define GIC400_SIZE SIZE_K(64)
  55. #define CORE_AXI_BUS_BASE 0xffd00000
  56. #define CORE_AXI_BUS_SIZE SIZE_M(1)
  57. #define COLD_BOOT_BASE 0xffff0000
  58. /**************************************************************************
  59. * UART related constants
  60. **************************************************************************/
  61. #define RK3288_BAUDRATE 115200
  62. #define RK3288_UART_CLOCK 24000000
  63. /******************************************************************************
  64. * System counter frequency related constants
  65. ******************************************************************************/
  66. #define SYS_COUNTER_FREQ_IN_TICKS 24000000
  67. /******************************************************************************
  68. * GIC-400 & interrupt handling related constants
  69. ******************************************************************************/
  70. /* Base rk_platform compatible GIC memory map */
  71. #define RK3288_GICD_BASE (GIC400_BASE + 0x1000)
  72. #define RK3288_GICC_BASE (GIC400_BASE + 0x2000)
  73. #define RK3288_GICR_BASE 0 /* no GICR in GIC-400 */
  74. /******************************************************************************
  75. * sgi, ppi
  76. ******************************************************************************/
  77. #define RK_IRQ_SEC_PHY_TIMER 29
  78. /* what are these, and are they present on rk3288? */
  79. #define RK_IRQ_SEC_SGI_0 8
  80. #define RK_IRQ_SEC_SGI_1 9
  81. #define RK_IRQ_SEC_SGI_2 10
  82. #define RK_IRQ_SEC_SGI_3 11
  83. #define RK_IRQ_SEC_SGI_4 12
  84. #define RK_IRQ_SEC_SGI_5 13
  85. #define RK_IRQ_SEC_SGI_6 14
  86. #define RK_IRQ_SEC_SGI_7 15
  87. /*
  88. * Define a list of Group 0 interrupts.
  89. */
  90. #define PLAT_RK_GICV2_G0_IRQS \
  91. INTR_PROP_DESC(RK_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, \
  92. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL), \
  93. INTR_PROP_DESC(RK_IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY, \
  94. GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL)
  95. #endif /* RK3288_DEF_H */