xrdc_config.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * Copyright 2020-2024 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <xrdc.h>
  7. #define SP(X) ((X) << 9)
  8. #define SU(X) ((X) << 6)
  9. #define NP(X) ((X) << 3)
  10. #define NU(X) ((X) << 0)
  11. #define RWX 7
  12. #define RW 6
  13. #define R 4
  14. #define X 1
  15. struct xrdc_mda_config imx8ulp_mda[] = {
  16. { 0, 7, MDA_SA_PT }, /* A core */
  17. { 1, 1, MDA_SA_NS }, /* DMA1 */
  18. { 2, 1, MDA_SA_NS }, /* USB */
  19. { 3, 1, MDA_SA_NS }, /* PXP-> .M10 */
  20. { 4, 1, MDA_SA_NS }, /* ENET */
  21. { 5, 1, MDA_SA_PT }, /* CAAM */
  22. { 6, 1, MDA_SA_NS }, /* USDHC0 */
  23. { 7, 1, MDA_SA_NS }, /* USDHC1 */
  24. { 8, 1, MDA_SA_NS }, /* USDHC2 */
  25. { 9, 2, MDA_SA_NS }, /* HIFI4 */
  26. { 10, 3, MDA_SA_NS }, /* GPU3D */
  27. { 11, 3, MDA_SA_NS }, /* GPU2D */
  28. { 12, 3, MDA_SA_NS }, /* EPDC */
  29. { 13, 3, MDA_SA_NS }, /* DCNano */
  30. { 14, 3, MDA_SA_NS }, /* ISI */
  31. { 15, 3, MDA_SA_NS }, /* PXP->NIC_LPAV.M0 */
  32. { 16, 3, MDA_SA_NS }, /* DMA2 */
  33. };
  34. #ifdef SPD_opteed
  35. #define TEE_SHM_SIZE 0x400000
  36. #else
  37. #define TEE_SHM_SIZE 0x0
  38. #endif
  39. #if defined(SPD_opteed) || defined(SPD_trusty)
  40. #define DRAM_MEM_0_START (0x80000000)
  41. #define DRAM_MEM_0_SIZE (BL32_BASE - 0x80000000)
  42. #define DRAM_MEM_1_START (BL32_BASE)
  43. #define DRAM_MEM_1_SIZE (BL32_SIZE - TEE_SHM_SIZE)
  44. #ifndef SPD_trusty
  45. #define DRAM_MEM_2_START (DRAM_MEM_1_START + DRAM_MEM_1_SIZE)
  46. #define DRAM_MEM_2_SIZE (0x80000000 - DRAM_MEM_1_SIZE - DRAM_MEM_0_SIZE)
  47. #else
  48. #define SECURE_HEAP_START (0xA9600000)
  49. #define SECURE_HEAP_SIZE (0x6000000)
  50. #define DRAM_MEM_END (0x100000000)
  51. #define DRAM_MEM_2_START (DRAM_MEM_1_START + DRAM_MEM_1_SIZE)
  52. #define DRAM_MEM_2_SIZE (SECURE_HEAP_START - DRAM_MEM_2_START)
  53. #define DRAM_MEM_3_START (DRAM_MEM_2_START + DRAM_MEM_2_SIZE)
  54. #define DRAM_MEM_3_SIZE (SECURE_HEAP_SIZE)
  55. #define DRAM_MEM_4_START (DRAM_MEM_3_START + DRAM_MEM_3_SIZE)
  56. #define DRAM_MEM_4_SIZE (DRAM_MEM_END - DRAM_MEM_4_START)
  57. #endif
  58. #endif
  59. struct xrdc_mrc_config imx8ulp_mrc[] = {
  60. { 0, 0, 0x0, 0x30000, {0, 0, 0, 0, 0, 0, 0, 1}, {0xfff, 0} }, /* ROM1 */
  61. { 1, 0, 0x60000000, 0x10000000, {1, 1, 0, 0, 1, 0, 1, 1}, {0xfff, 0} }, /* Flexspi2 */
  62. { 2, 0, 0x22020000, 0x40000, {1, 1, 0, 0, 1, 0, 1, 1}, {0xfff, 0} }, /* SRAM2 */
  63. { 3, 0, 0x22010000, 0x10000, {1, 1, 0, 0, 1, 0, 1, 1}, {0xfff, 0} }, /* SRAM0 */
  64. #if defined(SPD_opteed) || defined(SPD_trusty)
  65. { 4, 0, DRAM_MEM_0_START, DRAM_MEM_0_SIZE, {0, 1, 0, 0, 0, 0, 0, 1}, {0xfff, 0} }, /* DRAM for A35, DMA1, USDHC0*/
  66. { 4, 1, DRAM_MEM_1_START, DRAM_MEM_1_SIZE, {0, 1, 0, 0, 0, 0, 0, 1}, {0xfc0, 0} }, /* TEE DRAM for A35, DMA1, USDHC0*/
  67. { 4, 2, DRAM_MEM_2_START, DRAM_MEM_2_SIZE, {0, 1, 0, 0, 0, 0, 0, 1}, {0xfff, 0} }, /* DRAM for A35, DMA1, USDHC0*/
  68. #ifdef SPD_trusty
  69. { 4, 3, DRAM_MEM_3_START, DRAM_MEM_3_SIZE, {0, 1, 0, 0, 0, 0, 0, 1}, {0xfc0, 0} }, /* DRAM for A35, DMA1, USDHC0*/
  70. { 4, 4, DRAM_MEM_4_START, DRAM_MEM_4_SIZE, {0, 1, 0, 0, 0, 0, 0, 1}, {0xfff, 0} }, /* DRAM for A35, DMA1, USDHC0*/
  71. #endif
  72. { 5, 0, DRAM_MEM_0_START, DRAM_MEM_0_SIZE, {0, 1, 0, 0, 0, 0, 0, 0}, {0xfff, 0} }, /* DRAM for NIC_PER */
  73. { 5, 1, DRAM_MEM_1_START, DRAM_MEM_1_SIZE, {0, 1, 0, 0, 0, 0, 0, 0}, {0xfc0, 0} }, /* TEE DRAM for NIC_PER */
  74. { 5, 2, DRAM_MEM_2_START, DRAM_MEM_2_SIZE, {0, 1, 0, 0, 0, 0, 0, 0}, {0xfff, 0} }, /* DRAM for NIC_PER */
  75. #ifdef SPD_trusty
  76. { 5, 3, DRAM_MEM_3_START, DRAM_MEM_3_SIZE, {0, 1, 0, 0, 0, 0, 0, 0}, {0xfc0, 0} }, /* DRAM for NIC_PER */
  77. { 5, 4, DRAM_MEM_4_START, DRAM_MEM_4_SIZE, {0, 1, 0, 0, 0, 0, 0, 0}, {0xfff, 0} }, /* DRAM for NIC_PER */
  78. #endif
  79. #ifdef SPD_trusty
  80. { 6, 0, DRAM_MEM_0_START, DRAM_MEM_0_SIZE, {1, 1, 0, 2, 1, 0, 1, 1}, {0xfff, 0x93f} }, /* DRAM for LPAV and RTD*/
  81. { 6, 1, DRAM_MEM_1_START, DRAM_MEM_1_SIZE, {1, 1, 0, 1, 1, 0, 1, 1}, {0xfc0, 0} }, /* TEE DRAM for LPAV and RTD*/
  82. { 6, 2, DRAM_MEM_2_START, DRAM_MEM_2_SIZE, {1, 1, 0, 2, 1, 0, 1, 1}, {0xfff, 0x93f} }, /* DRAM for LPAV and RTD*/
  83. { 6, 3, DRAM_MEM_3_START, DRAM_MEM_3_SIZE, {1, 1, 0, 1, 1, 0, 1, 1}, {0xfc0, 0} }, /* DRAM for LPAV and RTD*/
  84. { 6, 4, DRAM_MEM_4_START, DRAM_MEM_4_SIZE, {1, 1, 0, 2, 1, 0, 1, 1}, {0xfff, 0x93f} }, /* DRAM for LPAV and RTD*/
  85. #else
  86. { 6, 0, DRAM_MEM_0_START, DRAM_MEM_0_SIZE, {1, 1, 0, 1, 1, 0, 1, 1}, {0xfff, 0} }, /* DRAM for LPAV and RTD*/
  87. { 6, 1, DRAM_MEM_1_START, DRAM_MEM_1_SIZE, {1, 1, 0, 1, 1, 0, 1, 1}, {0xfc0, 0} }, /* TEE DRAM for LPAV and RTD*/
  88. { 6, 2, DRAM_MEM_2_START, DRAM_MEM_2_SIZE, {1, 1, 0, 1, 1, 0, 1, 1}, {0xfff, 0} }, /* DRAM for LPAV and RTD*/
  89. #endif
  90. #else
  91. { 4, 0, 0x80000000, 0x80000000, {0, 1, 0, 0, 0, 0, 0, 1}, {0xfff, 0} }, /* DRAM for A35, DMA1, USDHC0*/
  92. { 5, 0, 0x80000000, 0x80000000, {0, 1, 0, 0, 0, 0, 0, 0}, {0xfff, 0} }, /* DRAM for NIC_PER */
  93. { 6, 0, 0x80000000, 0x80000000, {1, 1, 0, 1, 1, 0, 1, 1}, {0xfff, 0} }, /* DRAM for LPAV and RTD*/
  94. #endif
  95. { 7, 0, 0x80000000, 0x10000000, {0, 0, 1, 0, 0, 0, 0, 0}, {0xfff, 0} }, /* DRAM for HIFI4 */
  96. { 7, 1, 0x90000000, 0x10000000, {0, 0, 1, 0, 0, 0, 0, 0}, {0xfff, 0} }, /* DRAM for HIFI4 */
  97. { 8, 0, 0x21000000, 0x10000, {1, 1, 1, 1, 1, 0, 1, 1}, {0xfff, 0} }, /* SRAM1 */
  98. { 9, 0, 0x1ffc0000, 0xc0000, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0} }, /* SSRAM for HIFI4 */
  99. { 10, 0, 0x1ffc0000, 0xc0000, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0} }, /* SSRAM for LPAV */
  100. { 11, 0, 0x21170000, 0x10000, {0, 0, 1, 0, 0, 0, 0, 2}, {0xfff, SP(RW) | SU(RW) | NP(RW)} }, /* HIFI4 TCM */
  101. { 11, 1, 0x21180000, 0x10000, {0, 0, 1, 0, 0, 0, 0, 2}, {SP(RW) | SU(RW) | NP(RW) | NU(RW), SP(RW) | SU(RW) | NP(RW)} }, /* HIFI4 TCM */
  102. { 12, 0, 0x2d400000, 0x100000, {0, 0, 0, 0, 0, 0, 0, 1}, {SP(RW) | SU(RW) | NP(RW) | NU(RW), 0} }, /* GIC500 */
  103. };
  104. struct xrdc_pac_msc_config imx8ulp_pdac[] = {
  105. { 0, PAC_SLOT_ALL, {0, 7, 0, 0, 0, 0, 0, 7} }, /* PAC0 */
  106. { 0, 44, {0, 7, 7, 0, 0, 0, 0, 7} }, /* PAC0 slot 44 for CGC1 */
  107. { 0, 36, {0, 0, 0, 0, 0, 0, 7, 7} }, /* PAC0 slot 36 for CMC1 */
  108. { 0, 41, {0, 0, 0, 0, 0, 0, 7, 7} }, /* PAC0 slot 41 for SIM_AD */
  109. { 1, PAC_SLOT_ALL, {0, 7, 0, 0, 0, 0, 0, 7} }, /* PAC1 */
  110. { 1, 0, {0, 7, 7, 0, 0, 0, 7, 7} }, /* PAC1 slot 0 for PCC4 */
  111. { 1, 6, {0, 7, 7, 0, 0, 0, 0, 7} }, /* PAC1 slot 6 for LPUART6 */
  112. { 1, 7, {0, 7, 7, 0, 0, 0, 0, 7} }, /* PAC1 slot 7 for LPUART7 */
  113. { 1, 9, {0, 7, 7, 7, 0, 0, 0, 7} }, /* SAI5 for HIFI4 and eDMA2 */
  114. { 1, 12, {0, 7, 7, 0, 0, 0, 7, 7} }, /* PAC1 slot 12 for IOMUXC1 */
  115. { 2, PAC_SLOT_ALL, {7, 7, 7, 7, 0, 0, 7, 7} }, /* PAC2 */
  116. };
  117. struct xrdc_pac_msc_config imx8ulp_msc[] = {
  118. { 0, 0, {0, 0, 0, 0, 0, 0, 7, 7} }, /* MSC0 GPIOE */
  119. { 0, 1, {0, 0, 0, 0, 0, 0, 7, 7} }, /* MSC0 GPIOF */
  120. { 1, MSC_SLOT_ALL, {0, 0, 0, 0, 0, 0, 7, 7} }, /* MSC1 GPIOD */
  121. { 2, MSC_SLOT_ALL, {0, 0, 0, 0, 0, 0, 7, 7} }, /* MSC2 GPU3D/2D/DCNANO/DDR registers */
  122. };