bsp_linker_info.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /* UNCRUSTIFY-OFF */
  2. #ifndef BSP_LINKER_H
  3. #define BSP_LINKER_H
  4. /***********************************************************************************************************************
  5. * Macro definitions
  6. **********************************************************************************************************************/
  7. /******* Solution Definitions *************/
  8. /***********************************************************************************************************************
  9. * Typedef definitions
  10. **********************************************************************************************************************/
  11. /* linker generated initialization table data structures types */
  12. typedef enum e_bsp_init_mem
  13. {
  14. INIT_MEM_ZERO,
  15. INIT_MEM_FLASH,
  16. INIT_MEM_DATA_FLASH,
  17. INIT_MEM_RAM,
  18. INIT_MEM_DTCM,
  19. INIT_MEM_ITCM,
  20. INIT_MEM_CTCM,
  21. INIT_MEM_STCM,
  22. INIT_MEM_OSPI0_CS0,
  23. INIT_MEM_OSPI0_CS1,
  24. INIT_MEM_OSPI1_CS0,
  25. INIT_MEM_OSPI1_CS1,
  26. INIT_MEM_QSPI_FLASH,
  27. INIT_MEM_SDRAM,
  28. } bsp_init_mem_t;
  29. typedef struct st_bsp_init_type
  30. {
  31. uint32_t copy_64 : 8; /* if 1, must use 64 bit copy operation (to keep ecc happy) */
  32. uint32_t external : 8; /* =1 if either source or destination is external, else 0 */
  33. uint32_t source_type : 8;
  34. uint32_t destination_type : 8;
  35. } bsp_init_type_t;
  36. typedef struct st_bsp_init_zero_info
  37. {
  38. uint32_t * const p_base;
  39. uint32_t * const p_limit;
  40. bsp_init_type_t type;
  41. } bsp_init_zero_info_t;
  42. typedef struct st_bsp_init_copy_info
  43. {
  44. uint32_t * const p_base;
  45. uint32_t * const p_limit;
  46. uint32_t * const p_load;
  47. bsp_init_type_t type;
  48. } bsp_init_copy_info_t;
  49. typedef struct st_bsp_init_nocache_info
  50. {
  51. uint32_t * const p_base;
  52. uint32_t * const p_limit;
  53. } bsp_mpu_nocache_info_t;
  54. typedef struct st_bsp_init_info
  55. {
  56. uint32_t zero_count;
  57. bsp_init_zero_info_t const * const p_zero_list;
  58. uint32_t copy_count;
  59. bsp_init_copy_info_t const * const p_copy_list;
  60. uint32_t nocache_count;
  61. bsp_mpu_nocache_info_t const * const p_nocache_list;
  62. } bsp_init_info_t;
  63. /***********************************************************************************************************************
  64. * Exported global variables
  65. **********************************************************************************************************************/
  66. extern bsp_init_info_t const g_init_info;
  67. /* These symbols are used for sau/idau configuration in a secure project */
  68. /***********************************************************************************************************************
  69. * Exported global functions (to be accessed by other files)
  70. **********************************************************************************************************************/
  71. #endif // BSP_LINKER_H
  72. #ifdef BSP_LINKER_C
  73. /***********************************************************************************************************************
  74. * Objects allocated by bsp_linker.c
  75. **********************************************************************************************************************/
  76. /* DDSC symbol definitions */
  77. extern const uint32_t Image$$__ddsc_DATA_FLASH_START$$Base;
  78. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_DATA_FLASH_START = &Image$$__ddsc_DATA_FLASH_START$$Base;
  79. extern const uint32_t Image$$__ddsc_DATA_FLASH_END$$Base;
  80. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_DATA_FLASH_END = &Image$$__ddsc_DATA_FLASH_END$$Base;
  81. extern const uint32_t Image$$__ddsc_FLASH_START$$Base;
  82. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_FLASH_START = &Image$$__ddsc_FLASH_START$$Base;
  83. extern const uint32_t Image$$__ddsc_FLASH_END$$Base;
  84. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_FLASH_END = &Image$$__ddsc_FLASH_END$$Base;
  85. extern const uint32_t Image$$__ddsc_FLASH_NSC$$Base;
  86. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_FLASH_NSC = &Image$$__ddsc_FLASH_NSC$$Base;
  87. extern const uint32_t Image$$__ddsc_RAM_START$$Base;
  88. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_RAM_START = &Image$$__ddsc_RAM_START$$Base;
  89. extern const uint32_t Image$$__ddsc_RAM_END$$Base;
  90. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_RAM_END = &Image$$__ddsc_RAM_END$$Base;
  91. extern const uint32_t Image$$__ddsc_RAM_NSC$$Base;
  92. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_RAM_NSC = &Image$$__ddsc_RAM_NSC$$Base;
  93. extern const uint32_t Image$$__ddsc_OPTION_SETTING_OFS0_START$$Base;
  94. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_OFS0_START = &Image$$__ddsc_OPTION_SETTING_OFS0_START$$Base;
  95. extern const uint32_t Image$$__ddsc_OPTION_SETTING_OFS0_END$$Base;
  96. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_OFS0_END = &Image$$__ddsc_OPTION_SETTING_OFS0_END$$Base;
  97. extern const uint32_t Image$$__ddsc_OPTION_SETTING_OSIS_START$$Base;
  98. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_OSIS_START = &Image$$__ddsc_OPTION_SETTING_OSIS_START$$Base;
  99. extern const uint32_t Image$$__ddsc_OPTION_SETTING_OSIS_END$$Base;
  100. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_OSIS_END = &Image$$__ddsc_OPTION_SETTING_OSIS_END$$Base;
  101. extern const uint32_t Image$$__ddsc_OPTION_SETTING_OFS1_SEC_START$$Base;
  102. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_OFS1_SEC_START = &Image$$__ddsc_OPTION_SETTING_OFS1_SEC_START$$Base;
  103. extern const uint32_t Image$$__ddsc_OPTION_SETTING_OFS1_SEC_END$$Base;
  104. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_OFS1_SEC_END = &Image$$__ddsc_OPTION_SETTING_OFS1_SEC_END$$Base;
  105. extern const uint32_t Image$$__ddsc_OPTION_SETTING_BPS_SEC_START$$Base;
  106. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_BPS_SEC_START = &Image$$__ddsc_OPTION_SETTING_BPS_SEC_START$$Base;
  107. extern const uint32_t Image$$__ddsc_OPTION_SETTING_BPS_SEC_END$$Base;
  108. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_BPS_SEC_END = &Image$$__ddsc_OPTION_SETTING_BPS_SEC_END$$Base;
  109. extern const uint32_t Image$$__ddsc_OPTION_SETTING_PBPS_SEC_START$$Base;
  110. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_PBPS_SEC_START = &Image$$__ddsc_OPTION_SETTING_PBPS_SEC_START$$Base;
  111. extern const uint32_t Image$$__ddsc_OPTION_SETTING_PBPS_SEC_END$$Base;
  112. BSP_DONT_REMOVE uint32_t const * const gp_ddsc_OPTION_SETTING_PBPS_SEC_END = &Image$$__ddsc_OPTION_SETTING_PBPS_SEC_END$$Base;
  113. /* Zero initialization tables */
  114. extern uint32_t Image$$__ram_zero_nocache$$ZI$$Base;
  115. extern uint32_t Image$$__ram_zero_nocache_pad$$ZI$$Limit;
  116. extern uint32_t Image$$__ram_zero$$ZI$$Base;
  117. extern uint32_t Image$$__ram_zero$$ZI$$Limit;
  118. static const bsp_init_zero_info_t zero_list[] =
  119. {
  120. {.p_base = &Image$$__ram_zero_nocache$$ZI$$Base, .p_limit = &Image$$__ram_zero_nocache_pad$$ZI$$Limit,.type={.copy_64 = 0, .external = 0, .source_type = INIT_MEM_ZERO, .destination_type = INIT_MEM_RAM}},
  121. {.p_base = &Image$$__ram_zero$$ZI$$Base, .p_limit = &Image$$__ram_zero$$ZI$$Limit,.type={.copy_64 = 0, .external = 0, .source_type = INIT_MEM_ZERO, .destination_type = INIT_MEM_RAM}}
  122. };
  123. /* Load initialization tables */
  124. extern uint32_t Image$$__ram_from_data_flash$$Base;
  125. extern uint32_t Image$$__ram_from_data_flash$$Limit;
  126. extern uint32_t Load$$__ram_from_data_flash$$Base;
  127. extern uint32_t Image$$__ram_from_flash$$Base;
  128. extern uint32_t Image$$__ram_from_flash$$Limit;
  129. extern uint32_t Load$$__ram_from_flash$$Base;
  130. static const bsp_init_copy_info_t copy_list[] =
  131. {
  132. {.p_base = &Image$$__ram_from_data_flash$$Base, .p_limit = &Image$$__ram_from_data_flash$$Limit, .p_load = &Load$$__ram_from_data_flash$$Base,.type={.copy_64 = 0, .external = 0, .source_type = INIT_MEM_DATA_FLASH, .destination_type = INIT_MEM_RAM}},
  133. {.p_base = &Image$$__ram_from_flash$$Base, .p_limit = &Image$$__ram_from_flash$$Limit, .p_load = &Load$$__ram_from_flash$$Base,.type={.copy_64 = 0, .external = 0, .source_type = INIT_MEM_FLASH, .destination_type = INIT_MEM_RAM}}
  134. };
  135. /* nocache regions */
  136. extern uint32_t Image$$__ram_noinit_nocache$$ZI$$Base;
  137. extern uint32_t Image$$__ram_noinit_nocache$$ZI$$Limit;
  138. extern uint32_t Image$$__ram_zero_nocache$$ZI$$Base;
  139. extern uint32_t Image$$__ram_zero_nocache_pad$$ZI$$Limit;
  140. static const bsp_mpu_nocache_info_t nocache_list[] =
  141. {
  142. {.p_base = &Image$$__ram_noinit_nocache$$ZI$$Base, .p_limit = &Image$$__ram_zero_nocache_pad$$ZI$$Limit},
  143. };
  144. /* initialization data structure */
  145. const bsp_init_info_t g_init_info =
  146. {
  147. .zero_count = sizeof(zero_list) / sizeof(zero_list[0]),
  148. .p_zero_list = zero_list,
  149. .copy_count = sizeof(copy_list) / sizeof(copy_list[0]),
  150. .p_copy_list = copy_list,
  151. .nocache_count = sizeof(nocache_list) / sizeof(nocache_list[0]),
  152. .p_nocache_list = nocache_list
  153. };
  154. #endif // BSP_LINKER_C
  155. /* UNCRUSTIFY-ON */