ARC: don't align ROM region end if not required

This extra MPU alignment of RAMABLE_REGION is only required
if we put ROMABLE_REGION and RAMABLE_REGION into the same
(continuous) memory (i.e. SRAM) - so we won't get beginning of the
RAMABLE_REGION in the end of ROMABLE_REGION MPU aperture.

If we use different regions (ICCM & DCCM, FLASH & SRAM, etc...)
we don't need this extra MPU alignment.

Let's drop it to decrease ROM memory usage.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
Evgeniy Paltsev 2023-06-13 15:20:24 +01:00 committed by Anas Nashif
parent 79433b0ee3
commit e1efafa31d

View file

@ -17,13 +17,16 @@
#ifdef CONFIG_HARVARD #ifdef CONFIG_HARVARD
#define ROMABLE_REGION ICCM #define ROMABLE_REGION ICCM
#define RAMABLE_REGION DCCM #define RAMABLE_REGION DCCM
#define ROM_RAM_IN_SAME_REGION 0
#else #else
#if defined(CONFIG_XIP) && (FLASH_SIZE != 0) #if defined(CONFIG_XIP) && (FLASH_SIZE != 0)
#define ROMABLE_REGION FLASH #define ROMABLE_REGION FLASH
#define RAMABLE_REGION SRAM #define RAMABLE_REGION SRAM
#define ROM_RAM_IN_SAME_REGION 0
#else #else
#define ROMABLE_REGION SRAM #define ROMABLE_REGION SRAM
#define RAMABLE_REGION SRAM #define RAMABLE_REGION SRAM
#define ROM_RAM_IN_SAME_REGION 1
#endif #endif
#endif #endif
@ -138,7 +141,13 @@ SECTIONS {
_ectors = .; _ectors = .;
#endif /* CONFIG_CPP && !CONFIG_CPP_STATIC_INIT_GNU && __MWDT_LINKER_CMD__ */ #endif /* CONFIG_CPP && !CONFIG_CPP_STATIC_INIT_GNU && __MWDT_LINKER_CMD__ */
/* This extra MPU alignment of RAMABLE_REGION is only required if we put ROMABLE_REGION and
* RAMABLE_REGION into the same (continuous) memory - otherwise we can get beginning of the
* RAMABLE_REGION in the end of ROMABLE_REGION MPU aperture.
*/
#if ROM_RAM_IN_SAME_REGION
MPU_ALIGN(ABSOLUTE(.) - __rom_region_start); MPU_ALIGN(ABSOLUTE(.) - __rom_region_start);
#endif
} GROUP_LINK_IN(ROMABLE_REGION) } GROUP_LINK_IN(ROMABLE_REGION)
__rodata_region_end = .; __rodata_region_end = .;