/* UNCRUSTIFY-OFF */
#ifndef BSP_LINKER_H
#define BSP_LINKER_H

/***********************************************************************************************************************
 * Macro definitions
 **********************************************************************************************************************/

/******* Solution Definitions *************/

/***********************************************************************************************************************
 * Typedef definitions
 **********************************************************************************************************************/
/* linker generated initialization table data structures types */
typedef enum e_bsp_init_mem
{
    INIT_MEM_ZERO,
    INIT_MEM_FLASH,
    INIT_MEM_DATA_FLASH,
    INIT_MEM_RAM,
    INIT_MEM_DTCM,
    INIT_MEM_ITCM,
    INIT_MEM_CTCM,
    INIT_MEM_STCM,
    INIT_MEM_OSPI0_CS0,
    INIT_MEM_OSPI0_CS1,
    INIT_MEM_OSPI1_CS0,
    INIT_MEM_OSPI1_CS1,
    INIT_MEM_QSPI_FLASH,
    INIT_MEM_SDRAM,
} bsp_init_mem_t;

typedef struct st_bsp_init_type
{
    uint32_t destination_type :8;
    uint32_t source_type :8;
    uint32_t destination_external :1; /* =1 if destination type is external, else internal  */
    uint32_t source_external :1; /* =1 if source type is external, else internal  */
    uint32_t external :1; /* =1 if either source or destination is external, else 0  */
    uint32_t copy_64 :1; /* if 1, must use 64 bit copy operation (to keep ecc happy) */
} bsp_init_type_t;

typedef struct st_bsp_init_zero_info
{
    uint32_t *const p_base;
    uint32_t *const p_limit;
    bsp_init_type_t type;
} bsp_init_zero_info_t;

typedef struct st_bsp_init_copy_info
{
    uint32_t *const p_base;
    uint32_t *const p_limit;
    uint32_t *const p_load;
    bsp_init_type_t type;
} bsp_init_copy_info_t;
typedef struct st_bsp_init_nocache_info
{
    uint32_t *const p_base;
    uint32_t *const p_limit;
} bsp_mpu_nocache_info_t;

typedef struct st_bsp_init_info
{
    uint32_t zero_count;
    bsp_init_zero_info_t const *const p_zero_list;
    uint32_t copy_count;
    bsp_init_copy_info_t const *const p_copy_list;
    uint32_t nocache_count;
    bsp_mpu_nocache_info_t const *const p_nocache_list;
} bsp_init_info_t;

/***********************************************************************************************************************
 * Exported global variables
 **********************************************************************************************************************/

extern bsp_init_info_t const g_init_info;
/* These symbols are used for sau/idau configuration in a secure project */

/***********************************************************************************************************************
 * Exported global functions (to be accessed by other files)
 **********************************************************************************************************************/
#endif   // BSP_LINKER_H
#ifdef BSP_LINKER_C
/***********************************************************************************************************************
 * Objects allocated by bsp_linker.c
 **********************************************************************************************************************/
/* DDSC symbol definitions */
/* Zero initialization tables */
extern uint32_t __sdram_zero_nocache$$Base;
extern uint32_t __sdram_zero_nocache$$Limit;
extern uint32_t __sdram_zero$$Base;
extern uint32_t __sdram_zero$$Limit;
extern uint32_t __ospi0_cs0_zero_nocache$$Base;
extern uint32_t __ospi0_cs0_zero_nocache$$Limit;
extern uint32_t __ospi0_cs0_zero$$Base;
extern uint32_t __ospi0_cs0_zero$$Limit;
extern uint32_t __ospi1_cs0_zero_nocache$$Base;
extern uint32_t __ospi1_cs0_zero_nocache$$Limit;
extern uint32_t __ospi1_cs0_zero$$Base;
extern uint32_t __ospi1_cs0_zero$$Limit;
extern uint32_t __itcm_zero$$Base;
extern uint32_t __itcm_zero$$Limit;
extern uint32_t __dtcm_zero$$Base;
extern uint32_t __dtcm_zero$$Limit;
extern uint32_t __ram_zero_nocache$$Base;
extern uint32_t __ram_zero_nocache$$Limit;
extern uint32_t __ram_zero$$Base;
extern uint32_t __ram_zero$$Limit;
static const bsp_init_zero_info_t zero_list[] =
{
  {.p_base = &__sdram_zero_nocache$$Base, .p_limit = &__sdram_zero_nocache$$Limit,.type={.destination_type = INIT_MEM_SDRAM, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__sdram_zero$$Base, .p_limit = &__sdram_zero$$Limit,.type={.destination_type = INIT_MEM_SDRAM, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__ospi0_cs0_zero_nocache$$Base, .p_limit = &__ospi0_cs0_zero_nocache$$Limit,.type={.destination_type = INIT_MEM_OSPI0_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__ospi0_cs0_zero$$Base, .p_limit = &__ospi0_cs0_zero$$Limit,.type={.destination_type = INIT_MEM_OSPI0_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__ospi1_cs0_zero_nocache$$Base, .p_limit = &__ospi1_cs0_zero_nocache$$Limit,.type={.destination_type = INIT_MEM_OSPI1_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__ospi1_cs0_zero$$Base, .p_limit = &__ospi1_cs0_zero$$Limit,.type={.destination_type = INIT_MEM_OSPI1_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__itcm_zero$$Base, .p_limit = &__itcm_zero$$Limit,.type={.destination_type = INIT_MEM_ITCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__dtcm_zero$$Base, .p_limit = &__dtcm_zero$$Limit,.type={.destination_type = INIT_MEM_DTCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__ram_zero_nocache$$Base, .p_limit = &__ram_zero_nocache$$Limit,.type={.destination_type = INIT_MEM_RAM, .destination_external = 0, .copy_64 = 0, .source_type = INIT_MEM_ZERO, .source_external = 0}},
  {.p_base = &__ram_zero$$Base, .p_limit = &__ram_zero$$Limit,.type={.destination_type = INIT_MEM_RAM, .destination_external = 0, .copy_64 = 0, .source_type = INIT_MEM_ZERO, .source_external = 0}}
};
/* Load initialization tables */
extern uint32_t __sdram_from_ospi0_cs1$$Base;
extern uint32_t __sdram_from_ospi0_cs1$$Limit;
extern uint32_t __sdram_from_ospi0_cs1$$Load;
extern uint32_t __sdram_from_ospi1_cs1$$Base;
extern uint32_t __sdram_from_ospi1_cs1$$Limit;
extern uint32_t __sdram_from_ospi1_cs1$$Load;
extern uint32_t __sdram_from_data_flash$$Base;
extern uint32_t __sdram_from_data_flash$$Limit;
extern uint32_t __sdram_from_data_flash$$Load;
extern uint32_t __sdram_from_flash$$Base;
extern uint32_t __sdram_from_flash$$Limit;
extern uint32_t __sdram_from_flash$$Load;
extern uint32_t __ospi0_cs0_from_ospi0_cs1$$Base;
extern uint32_t __ospi0_cs0_from_ospi0_cs1$$Limit;
extern uint32_t __ospi0_cs0_from_ospi0_cs1$$Load;
extern uint32_t __ospi0_cs0_from_ospi1_cs1$$Base;
extern uint32_t __ospi0_cs0_from_ospi1_cs1$$Limit;
extern uint32_t __ospi0_cs0_from_ospi1_cs1$$Load;
extern uint32_t __ospi0_cs0_from_data_flash$$Base;
extern uint32_t __ospi0_cs0_from_data_flash$$Limit;
extern uint32_t __ospi0_cs0_from_data_flash$$Load;
extern uint32_t __ospi0_cs0_from_flash$$Base;
extern uint32_t __ospi0_cs0_from_flash$$Limit;
extern uint32_t __ospi0_cs0_from_flash$$Load;
extern uint32_t __ospi1_cs0_from_ospi0_cs1$$Base;
extern uint32_t __ospi1_cs0_from_ospi0_cs1$$Limit;
extern uint32_t __ospi1_cs0_from_ospi0_cs1$$Load;
extern uint32_t __ospi1_cs0_from_ospi1_cs1$$Base;
extern uint32_t __ospi1_cs0_from_ospi1_cs1$$Limit;
extern uint32_t __ospi1_cs0_from_ospi1_cs1$$Load;
extern uint32_t __ospi1_cs0_from_data_flash$$Base;
extern uint32_t __ospi1_cs0_from_data_flash$$Limit;
extern uint32_t __ospi1_cs0_from_data_flash$$Load;
extern uint32_t __ospi1_cs0_from_flash$$Base;
extern uint32_t __ospi1_cs0_from_flash$$Limit;
extern uint32_t __ospi1_cs0_from_flash$$Load;
extern uint32_t __itcm_from_ospi0_cs1$$Base;
extern uint32_t __itcm_from_ospi0_cs1$$Limit;
extern uint32_t __itcm_from_ospi0_cs1$$Load;
extern uint32_t __itcm_from_ospi1_cs1$$Base;
extern uint32_t __itcm_from_ospi1_cs1$$Limit;
extern uint32_t __itcm_from_ospi1_cs1$$Load;
extern uint32_t __itcm_from_data_flash$$Base;
extern uint32_t __itcm_from_data_flash$$Limit;
extern uint32_t __itcm_from_data_flash$$Load;
extern uint32_t __itcm_from_flash$$Base;
extern uint32_t __itcm_from_flash$$Limit;
extern uint32_t __itcm_from_flash$$Load;
extern uint32_t __dtcm_from_ospi0_cs1$$Base;
extern uint32_t __dtcm_from_ospi0_cs1$$Limit;
extern uint32_t __dtcm_from_ospi0_cs1$$Load;
extern uint32_t __dtcm_from_ospi1_cs1$$Base;
extern uint32_t __dtcm_from_ospi1_cs1$$Limit;
extern uint32_t __dtcm_from_ospi1_cs1$$Load;
extern uint32_t __dtcm_from_data_flash$$Base;
extern uint32_t __dtcm_from_data_flash$$Limit;
extern uint32_t __dtcm_from_data_flash$$Load;
extern uint32_t __dtcm_from_flash$$Base;
extern uint32_t __dtcm_from_flash$$Limit;
extern uint32_t __dtcm_from_flash$$Load;
extern uint32_t __ram_from_ospi0_cs1$$Base;
extern uint32_t __ram_from_ospi0_cs1$$Limit;
extern uint32_t __ram_from_ospi0_cs1$$Load;
extern uint32_t __ram_from_ospi1_cs1$$Base;
extern uint32_t __ram_from_ospi1_cs1$$Limit;
extern uint32_t __ram_from_ospi1_cs1$$Load;
extern uint32_t __ram_from_data_flash$$Base;
extern uint32_t __ram_from_data_flash$$Limit;
extern uint32_t __ram_from_data_flash$$Load;
extern uint32_t __ram_from_flash$$Base;
extern uint32_t __ram_from_flash$$Limit;
extern uint32_t __ram_from_flash$$Load;
static const bsp_init_copy_info_t copy_list[] =
{
  {.p_base = &__sdram_from_ospi0_cs1$$Base, .p_limit = &__sdram_from_ospi0_cs1$$Limit, .p_load = &__sdram_from_ospi0_cs1$$Load,.type={.destination_type = INIT_MEM_SDRAM, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_OSPI0_CS1, .source_external = 1}},
  {.p_base = &__sdram_from_ospi1_cs1$$Base, .p_limit = &__sdram_from_ospi1_cs1$$Limit, .p_load = &__sdram_from_ospi1_cs1$$Load,.type={.destination_type = INIT_MEM_SDRAM, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_OSPI1_CS1, .source_external = 1}},
  {.p_base = &__sdram_from_data_flash$$Base, .p_limit = &__sdram_from_data_flash$$Limit, .p_load = &__sdram_from_data_flash$$Load,.type={.destination_type = INIT_MEM_SDRAM, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_DATA_FLASH, .source_external = 0}},
  {.p_base = &__sdram_from_flash$$Base, .p_limit = &__sdram_from_flash$$Limit, .p_load = &__sdram_from_flash$$Load,.type={.destination_type = INIT_MEM_SDRAM, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_FLASH, .source_external = 0}},
  {.p_base = &__ospi0_cs0_from_ospi0_cs1$$Base, .p_limit = &__ospi0_cs0_from_ospi0_cs1$$Limit, .p_load = &__ospi0_cs0_from_ospi0_cs1$$Load,.type={.destination_type = INIT_MEM_OSPI0_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_OSPI0_CS1, .source_external = 1}},
  {.p_base = &__ospi0_cs0_from_ospi1_cs1$$Base, .p_limit = &__ospi0_cs0_from_ospi1_cs1$$Limit, .p_load = &__ospi0_cs0_from_ospi1_cs1$$Load,.type={.destination_type = INIT_MEM_OSPI0_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_OSPI1_CS1, .source_external = 1}},
  {.p_base = &__ospi0_cs0_from_data_flash$$Base, .p_limit = &__ospi0_cs0_from_data_flash$$Limit, .p_load = &__ospi0_cs0_from_data_flash$$Load,.type={.destination_type = INIT_MEM_OSPI0_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_DATA_FLASH, .source_external = 0}},
  {.p_base = &__ospi0_cs0_from_flash$$Base, .p_limit = &__ospi0_cs0_from_flash$$Limit, .p_load = &__ospi0_cs0_from_flash$$Load,.type={.destination_type = INIT_MEM_OSPI0_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_FLASH, .source_external = 0}},
  {.p_base = &__ospi1_cs0_from_ospi0_cs1$$Base, .p_limit = &__ospi1_cs0_from_ospi0_cs1$$Limit, .p_load = &__ospi1_cs0_from_ospi0_cs1$$Load,.type={.destination_type = INIT_MEM_OSPI1_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_OSPI0_CS1, .source_external = 1}},
  {.p_base = &__ospi1_cs0_from_ospi1_cs1$$Base, .p_limit = &__ospi1_cs0_from_ospi1_cs1$$Limit, .p_load = &__ospi1_cs0_from_ospi1_cs1$$Load,.type={.destination_type = INIT_MEM_OSPI1_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_OSPI1_CS1, .source_external = 1}},
  {.p_base = &__ospi1_cs0_from_data_flash$$Base, .p_limit = &__ospi1_cs0_from_data_flash$$Limit, .p_load = &__ospi1_cs0_from_data_flash$$Load,.type={.destination_type = INIT_MEM_OSPI1_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_DATA_FLASH, .source_external = 0}},
  {.p_base = &__ospi1_cs0_from_flash$$Base, .p_limit = &__ospi1_cs0_from_flash$$Limit, .p_load = &__ospi1_cs0_from_flash$$Load,.type={.destination_type = INIT_MEM_OSPI1_CS0, .destination_external = 1, .copy_64 = 0, .source_type = INIT_MEM_FLASH, .source_external = 0}},
  {.p_base = &__itcm_from_ospi0_cs1$$Base, .p_limit = &__itcm_from_ospi0_cs1$$Limit, .p_load = &__itcm_from_ospi0_cs1$$Load,.type={.destination_type = INIT_MEM_ITCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_OSPI0_CS1, .source_external = 1}},
  {.p_base = &__itcm_from_ospi1_cs1$$Base, .p_limit = &__itcm_from_ospi1_cs1$$Limit, .p_load = &__itcm_from_ospi1_cs1$$Load,.type={.destination_type = INIT_MEM_ITCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_OSPI1_CS1, .source_external = 1}},
  {.p_base = &__itcm_from_data_flash$$Base, .p_limit = &__itcm_from_data_flash$$Limit, .p_load = &__itcm_from_data_flash$$Load,.type={.destination_type = INIT_MEM_ITCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_DATA_FLASH, .source_external = 0}},
  {.p_base = &__itcm_from_flash$$Base, .p_limit = &__itcm_from_flash$$Limit, .p_load = &__itcm_from_flash$$Load,.type={.destination_type = INIT_MEM_ITCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_FLASH, .source_external = 0}},
  {.p_base = &__dtcm_from_ospi0_cs1$$Base, .p_limit = &__dtcm_from_ospi0_cs1$$Limit, .p_load = &__dtcm_from_ospi0_cs1$$Load,.type={.destination_type = INIT_MEM_DTCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_OSPI0_CS1, .source_external = 1}},
  {.p_base = &__dtcm_from_ospi1_cs1$$Base, .p_limit = &__dtcm_from_ospi1_cs1$$Limit, .p_load = &__dtcm_from_ospi1_cs1$$Load,.type={.destination_type = INIT_MEM_DTCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_OSPI1_CS1, .source_external = 1}},
  {.p_base = &__dtcm_from_data_flash$$Base, .p_limit = &__dtcm_from_data_flash$$Limit, .p_load = &__dtcm_from_data_flash$$Load,.type={.destination_type = INIT_MEM_DTCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_DATA_FLASH, .source_external = 0}},
  {.p_base = &__dtcm_from_flash$$Base, .p_limit = &__dtcm_from_flash$$Limit, .p_load = &__dtcm_from_flash$$Load,.type={.destination_type = INIT_MEM_DTCM, .destination_external = 0, .copy_64 = 1, .source_type = INIT_MEM_FLASH, .source_external = 0}},
  {.p_base = &__ram_from_ospi0_cs1$$Base, .p_limit = &__ram_from_ospi0_cs1$$Limit, .p_load = &__ram_from_ospi0_cs1$$Load,.type={.destination_type = INIT_MEM_RAM, .destination_external = 0, .copy_64 = 0, .source_type = INIT_MEM_OSPI0_CS1, .source_external = 1}},
  {.p_base = &__ram_from_ospi1_cs1$$Base, .p_limit = &__ram_from_ospi1_cs1$$Limit, .p_load = &__ram_from_ospi1_cs1$$Load,.type={.destination_type = INIT_MEM_RAM, .destination_external = 0, .copy_64 = 0, .source_type = INIT_MEM_OSPI1_CS1, .source_external = 1}},
  {.p_base = &__ram_from_data_flash$$Base, .p_limit = &__ram_from_data_flash$$Limit, .p_load = &__ram_from_data_flash$$Load,.type={.destination_type = INIT_MEM_RAM, .destination_external = 0, .copy_64 = 0, .source_type = INIT_MEM_DATA_FLASH, .source_external = 0}},
  {.p_base = &__ram_from_flash$$Base, .p_limit = &__ram_from_flash$$Limit, .p_load = &__ram_from_flash$$Load,.type={.destination_type = INIT_MEM_RAM, .destination_external = 0, .copy_64 = 0, .source_type = INIT_MEM_FLASH, .source_external = 0}}
};
/* nocache regions */
extern uint32_t __sdram_noinit_nocache$$Base;
extern uint32_t __sdram_noinit_nocache$$Limit;
extern uint32_t __sdram_zero_nocache$$Base;
extern uint32_t __sdram_zero_nocache$$Limit;
extern uint32_t __ospi0_cs0_noinit_nocache$$Base;
extern uint32_t __ospi0_cs0_noinit_nocache$$Limit;
extern uint32_t __ospi0_cs0_zero_nocache$$Base;
extern uint32_t __ospi0_cs0_zero_nocache$$Limit;
extern uint32_t __ospi1_cs0_noinit_nocache$$Base;
extern uint32_t __ospi1_cs0_noinit_nocache$$Limit;
extern uint32_t __ospi1_cs0_zero_nocache$$Base;
extern uint32_t __ospi1_cs0_zero_nocache$$Limit;
extern uint32_t __ram_noinit_nocache$$Base;
extern uint32_t __ram_noinit_nocache$$Limit;
extern uint32_t __ram_zero_nocache$$Base;
extern uint32_t __ram_zero_nocache$$Limit;
static const bsp_mpu_nocache_info_t nocache_list[] =
{
  {.p_base = &__sdram_noinit_nocache$$Base, .p_limit = &__sdram_zero_nocache$$Limit},
  {.p_base = &__ospi0_cs0_noinit_nocache$$Base, .p_limit = &__ospi0_cs0_zero_nocache$$Limit},
  {.p_base = &__ospi1_cs0_noinit_nocache$$Base, .p_limit = &__ospi1_cs0_zero_nocache$$Limit},
  {.p_base = &__ram_noinit_nocache$$Base, .p_limit = &__ram_zero_nocache$$Limit},
};

/* initialization data structure */
const bsp_init_info_t g_init_info =
{
    .zero_count  = sizeof(zero_list) / sizeof(zero_list[0]),
    .p_zero_list = zero_list,
    .copy_count  = sizeof(copy_list) / sizeof(copy_list[0]),
    .p_copy_list = copy_list,
    .nocache_count  = sizeof(nocache_list) / sizeof(nocache_list[0]),
    .p_nocache_list = nocache_list
};

#endif   // BSP_LINKER_C

/* UNCRUSTIFY-ON */
