diff options
-rw-r--r-- | bsps/sparc/leon3/mpci/getcfg.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bsps/sparc/leon3/mpci/getcfg.c b/bsps/sparc/leon3/mpci/getcfg.c index fc67cf8e3a..8fa41c1579 100644 --- a/bsps/sparc/leon3/mpci/getcfg.c +++ b/bsps/sparc/leon3/mpci/getcfg.c @@ -20,7 +20,7 @@ /* Let user override this configuration by declaring this a weak variable */ shm_config_table BSP_shm_cfgtbl __attribute__((weak)) = { - (vol_u32 *)0x40000000, /* USER OVERRIDABLE */ + (vol_u32 *)0xffffffff, /* USER OVERRIDABLE (see comment below) */ 0x00001000, /* USER OVERRIDABLE */ SHM_BIG, NULL_CONVERT, @@ -33,6 +33,8 @@ shm_config_table BSP_shm_cfgtbl __attribute__((weak)) = }, }; +extern unsigned int _RAM_START; + void Shm_Get_configuration( uint32_t localnode, shm_config_table **shmcfg @@ -44,6 +46,17 @@ void Shm_Get_configuration( BSP_shm_cfgtbl.format = SHM_BIG; + /* If not defined by user then default shared memory base address to the + * start of memory by aligning RAM_START to lower 512MiB: + * - 0x00000000 (SDRAM base for LEON4) + * - 0x40000000 (SRAM base LEON3) + * - 0x60000000 (SDRAM base LEON3) + */ + if (BSP_shm_cfgtbl.base = (vol_u32 *)0xffffffff) { + BSP_shm_cfgtbl.base = (vol_u32 *) + (((unsigned int)&_RAM_START) & 0xE0000000); + } + /* * Override cause_intr or shm_isr if your target has * special requirements. |