stm32mp1_fip_def.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright (C) 2021-2024, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef STM32MP1_FIP_DEF_H
  7. #define STM32MP1_FIP_DEF_H
  8. #define STM32MP_DDR_S_SIZE U(0x02000000) /* 32 MB */
  9. #if TRUSTED_BOARD_BOOT && !STM32MP_USE_EXTERNAL_HEAP
  10. #if STM32MP15
  11. #define STM32MP_BL2_RO_SIZE U(0x00014000) /* 80 KB */
  12. #define STM32MP_BL2_SIZE U(0x0001B000) /* 108 KB for BL2 */
  13. #endif /* STM32MP15 */
  14. #else /* TRUSTED_BOARD_BOOT && !STM32MP_USE_EXTERNAL_HEAP */
  15. #if STM32MP13
  16. #if BL2_IN_XIP_MEM
  17. #define STM32MP_BL2_RO_SIZE U(0x00015000) /* 84 KB */
  18. #define STM32MP_BL2_SIZE U(0x00017000) /* 92 KB for BL2 */
  19. #else
  20. /* STM32MP_BL2_RO_SIZE not used if !BL2_IN_XIP_MEM */
  21. #define STM32MP_BL2_SIZE U(0x0001B000) /* 108KB for BL2 */
  22. /* with 20KB for DTB, SYSRAM is full */
  23. #endif
  24. #endif /* STM32MP13 */
  25. #if STM32MP15
  26. #define STM32MP_BL2_RO_SIZE U(0x00011000) /* 68 KB */
  27. #define STM32MP_BL2_SIZE U(0x00016000) /* 88 KB for BL2 */
  28. #endif /* STM32MP15 */
  29. #endif /* TRUSTED_BOARD_BOOT && !STM32MP_USE_EXTERNAL_HEAP */
  30. #if STM32MP13
  31. #if TRUSTED_BOARD_BOOT
  32. #define STM32MP_BL2_DTB_SIZE U(0x00005000) /* 20 KB for DTB */
  33. #else /* TRUSTED_BOARD_BOOT */
  34. #define STM32MP_BL2_DTB_SIZE U(0x00004000) /* 16 KB for DTB */
  35. #endif /* TRUSTED_BOARD_BOOT */
  36. #endif /* STM32MP13 */
  37. #if STM32MP15
  38. #define STM32MP_BL2_DTB_SIZE U(0x00007000) /* 28 KB for DTB */
  39. #endif /* STM32MP15 */
  40. #define STM32MP_BL32_SIZE U(0x0001B000) /* 108 KB for BL32 */
  41. #define STM32MP_BL32_DTB_SIZE U(0x00005000) /* 20 KB for DTB */
  42. #define STM32MP_FW_CONFIG_MAX_SIZE PAGE_SIZE /* 4 KB for FCONF DTB */
  43. #define STM32MP_HW_CONFIG_MAX_SIZE U(0x40000) /* 256 KB for HW config DTB */
  44. #if STM32MP13
  45. #define STM32MP_BL2_BASE (STM32MP_BL2_DTB_BASE + \
  46. STM32MP_BL2_DTB_SIZE)
  47. #endif /* STM32MP13 */
  48. #if STM32MP15
  49. #define STM32MP_BL2_BASE (STM32MP_SEC_SYSRAM_BASE + \
  50. STM32MP_SEC_SYSRAM_SIZE - \
  51. STM32MP_BL2_SIZE)
  52. #endif /* STM32MP15 */
  53. #define STM32MP_BL2_RO_BASE STM32MP_BL2_BASE
  54. #define STM32MP_BL2_RW_BASE (STM32MP_BL2_RO_BASE + \
  55. STM32MP_BL2_RO_SIZE)
  56. #if STM32MP13
  57. #define STM32MP_BL2_RW_SIZE (STM32MP_SYSRAM_BASE + \
  58. STM32MP_SYSRAM_SIZE - \
  59. STM32MP_BL2_RW_BASE)
  60. #define STM32MP_BL2_DTB_BASE STM32MP_SEC_SYSRAM_BASE
  61. #endif /* STM32MP13 */
  62. #if STM32MP15
  63. #define STM32MP_BL2_RW_SIZE (STM32MP_SEC_SYSRAM_BASE + \
  64. STM32MP_SEC_SYSRAM_SIZE - \
  65. STM32MP_BL2_RW_BASE)
  66. #define STM32MP_BL2_DTB_BASE (STM32MP_BL2_BASE - \
  67. STM32MP_BL2_DTB_SIZE)
  68. #endif /* STM32MP15 */
  69. #define STM32MP_BL32_DTB_BASE STM32MP_SYSRAM_BASE
  70. #define STM32MP_BL32_BASE (STM32MP_BL32_DTB_BASE + \
  71. STM32MP_BL32_DTB_SIZE)
  72. #if defined(IMAGE_BL2)
  73. #define STM32MP_DTB_SIZE STM32MP_BL2_DTB_SIZE
  74. #define STM32MP_DTB_BASE STM32MP_BL2_DTB_BASE
  75. #endif
  76. #if defined(IMAGE_BL32)
  77. #define STM32MP_DTB_SIZE STM32MP_BL32_DTB_SIZE
  78. #define STM32MP_DTB_BASE STM32MP_BL32_DTB_BASE
  79. #endif
  80. #ifdef AARCH32_SP_OPTEE
  81. #define STM32MP_OPTEE_BASE STM32MP_SEC_SYSRAM_BASE
  82. #define STM32MP_OPTEE_SIZE (STM32MP_BL2_DTB_BASE - \
  83. STM32MP_OPTEE_BASE)
  84. #endif
  85. #if STM32MP13
  86. #define STM32MP_FW_CONFIG_BASE SRAM3_BASE
  87. #endif /* STM32MP13 */
  88. #if STM32MP15
  89. #define STM32MP_FW_CONFIG_BASE (STM32MP_SYSRAM_BASE + \
  90. STM32MP_SYSRAM_SIZE - \
  91. PAGE_SIZE)
  92. #endif /* STM32MP15 */
  93. #define STM32MP_HW_CONFIG_BASE (STM32MP_BL33_BASE + \
  94. STM32MP_BL33_MAX_SIZE)
  95. /*
  96. * MAX_MMAP_REGIONS is usually:
  97. * BL stm32mp1_mmap size + mmap regions in *_plat_arch_setup
  98. */
  99. #if defined(IMAGE_BL32)
  100. #define MAX_MMAP_REGIONS 10
  101. #endif
  102. #endif /* STM32MP1_FIP_DEF_H */