plat_default_def.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * Copyright 2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef PLAT_DEFAULT_DEF_H
  8. #define PLAT_DEFAULT_DEF_H
  9. /*
  10. * Platform binary types for linking
  11. */
  12. #ifdef __aarch64__
  13. #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
  14. #define PLATFORM_LINKER_ARCH aarch64
  15. #else
  16. #define PLATFORM_LINKER_FORMAT "elf32-littlearm"
  17. #define PLATFORM_LINKER_ARCH arm
  18. #endif /* __aarch64__ */
  19. #define LS_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
  20. /* NXP Platforms have DRAM divided into banks.
  21. * DRAM0 Bank: Maximum size of this bank is fixed to 2GB
  22. * DRAM1 Bank: Greater than 2GB belongs to bank1 and size of bank1 varies from
  23. * one platform to other platform.
  24. * DRAMn Bank:
  25. *
  26. * Except a few, all the platforms have 2GB size as DRAM0 BANK.
  27. * Hence common for all the platforms.
  28. * For platforms where DRAM0 Size is < 2GB, it is defined in platform_def.h
  29. */
  30. #ifndef PLAT_DEF_DRAM0_SIZE
  31. #define PLAT_DEF_DRAM0_SIZE 0x80000000 /* 2G */
  32. #endif
  33. /* This is common for all platforms where: */
  34. #ifndef NXP_NS_DRAM_ADDR
  35. #define NXP_NS_DRAM_ADDR NXP_DRAM0_ADDR
  36. #endif
  37. /* 1 MB is reserved for dma of sd */
  38. #ifndef NXP_SD_BLOCK_BUF_SIZE
  39. #define NXP_SD_BLOCK_BUF_SIZE (1 * 1024 * 1024)
  40. #endif
  41. /* 64MB is reserved for Secure memory */
  42. #ifndef NXP_SECURE_DRAM_SIZE
  43. #define NXP_SECURE_DRAM_SIZE (64 * 1024 * 1024)
  44. #endif
  45. /* 2M Secure EL1 Payload Shared Memory */
  46. #ifndef NXP_SP_SHRD_DRAM_SIZE
  47. #define NXP_SP_SHRD_DRAM_SIZE (2 * 1024 * 1024)
  48. #endif
  49. #ifndef NXP_NS_DRAM_SIZE
  50. /* Non secure memory */
  51. #define NXP_NS_DRAM_SIZE (PLAT_DEF_DRAM0_SIZE - \
  52. (NXP_SECURE_DRAM_SIZE + NXP_SP_SHRD_DRAM_SIZE))
  53. #endif
  54. #ifndef NXP_SD_BLOCK_BUF_ADDR
  55. #define NXP_SD_BLOCK_BUF_ADDR (NXP_NS_DRAM_ADDR)
  56. #endif
  57. #ifndef NXP_SECURE_DRAM_ADDR
  58. #ifdef TEST_BL31
  59. #define NXP_SECURE_DRAM_ADDR 0
  60. #else
  61. #define NXP_SECURE_DRAM_ADDR (NXP_NS_DRAM_ADDR + PLAT_DEF_DRAM0_SIZE - \
  62. (NXP_SECURE_DRAM_SIZE + NXP_SP_SHRD_DRAM_SIZE))
  63. #endif
  64. #endif
  65. #ifndef NXP_SP_SHRD_DRAM_ADDR
  66. #define NXP_SP_SHRD_DRAM_ADDR (NXP_NS_DRAM_ADDR + PLAT_DEF_DRAM0_SIZE - \
  67. NXP_SP_SHRD_DRAM_SIZE)
  68. #endif
  69. #ifndef BL31_BASE
  70. /* 2 MB reserved in secure memory for DDR */
  71. #define BL31_BASE NXP_SECURE_DRAM_ADDR
  72. #endif
  73. #ifndef BL31_SIZE
  74. #define BL31_SIZE (0x200000)
  75. #endif
  76. #ifndef BL31_LIMIT
  77. #define BL31_LIMIT (BL31_BASE + BL31_SIZE)
  78. #endif
  79. /* Put BL32 in secure memory */
  80. #ifndef BL32_BASE
  81. #define BL32_BASE (NXP_SECURE_DRAM_ADDR + BL31_SIZE)
  82. #endif
  83. #ifndef BL32_LIMIT
  84. #define BL32_LIMIT (NXP_SECURE_DRAM_ADDR + \
  85. NXP_SECURE_DRAM_SIZE + NXP_SP_SHRD_DRAM_SIZE)
  86. #endif
  87. /* BL33 memory region */
  88. /* Hardcoded based on current address in u-boot */
  89. #ifndef BL33_BASE
  90. #define BL33_BASE 0x82000000
  91. #endif
  92. #ifndef BL33_LIMIT
  93. #define BL33_LIMIT (NXP_NS_DRAM_ADDR + NXP_NS_DRAM_SIZE)
  94. #endif
  95. /*
  96. * FIP image defines - Offset at which FIP Image would be present
  97. * Image would include Bl31 , Bl33 and Bl32 (optional)
  98. */
  99. #ifdef POLICY_FUSE_PROVISION
  100. #ifndef FUSE_BUF
  101. #define FUSE_BUF ULL(0x81000000)
  102. #endif
  103. #ifndef FUSE_SZ
  104. #define FUSE_SZ 0x80000
  105. #endif
  106. #endif
  107. #ifndef MAX_FIP_DEVICES
  108. #define MAX_FIP_DEVICES 2
  109. #endif
  110. #ifndef PLAT_FIP_OFFSET
  111. #define PLAT_FIP_OFFSET 0x100000
  112. #endif
  113. #ifndef PLAT_FIP_MAX_SIZE
  114. #define PLAT_FIP_MAX_SIZE 0x400000
  115. #endif
  116. /* Check if this size can be determined from array size */
  117. #if defined(IMAGE_BL2)
  118. #ifndef MAX_MMAP_REGIONS
  119. #define MAX_MMAP_REGIONS 8
  120. #endif
  121. #ifndef MAX_XLAT_TABLES
  122. #define MAX_XLAT_TABLES 6
  123. #endif
  124. #elif defined(IMAGE_BL31)
  125. #ifndef MAX_MMAP_REGIONS
  126. #define MAX_MMAP_REGIONS 9
  127. #endif
  128. #ifndef MAX_XLAT_TABLES
  129. #define MAX_XLAT_TABLES 9
  130. #endif
  131. #elif defined(IMAGE_BL32)
  132. #ifndef MAX_MMAP_REGIONS
  133. #define MAX_MMAP_REGIONS 8
  134. #endif
  135. #ifndef MAX_XLAT_TABLES
  136. #define MAX_XLAT_TABLES 9
  137. #endif
  138. #endif
  139. /*
  140. * ID of the secure physical generic timer interrupt used by the BL32.
  141. */
  142. #ifndef BL32_IRQ_SEC_PHY_TIMER
  143. #define BL32_IRQ_SEC_PHY_TIMER 29
  144. #endif
  145. #endif /* PLAT_DEFAULT_DEF_H */