diff options
author | Julius Werner <jwerner@chromium.org> | 2020-12-30 15:51:10 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-02-19 08:39:26 +0000 |
commit | 82d16b150ce3287f4e9f33e86bdde32bc455b193 (patch) | |
tree | f3110d34e3eebb4a57ca429152c1262e65e9f2f4 /src/mainboard/emulation | |
parent | 422501fb14780090527c9a45bcca6628cd6bba71 (diff) |
memlayout: Store region sizes as separate symbols
This patch changes the memlayout macro infrastructure so that the size
of a region "xxx" (i.e. the distance between the symbols _xxx and _exxx)
is stored in a separate _xxx_size symbol. This has the advantage that
region sizes can be used inside static initializers, and also saves an
extra subtraction at runtime. Since linker symbols can only be treated
as addresses (not as raw integers) by C, retain the REGION_SIZE()
accessor macro to hide the necessary typecast.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ifd89708ca9bd3937d0db7308959231106a6aa373
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49332
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard/emulation')
-rw-r--r-- | src/mainboard/emulation/qemu-aarch64/bootblock.c | 4 | ||||
-rw-r--r-- | src/mainboard/emulation/qemu-aarch64/mainboard.c | 4 | ||||
-rw-r--r-- | src/mainboard/emulation/qemu-aarch64/memlayout.ld | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/src/mainboard/emulation/qemu-aarch64/bootblock.c b/src/mainboard/emulation/qemu-aarch64/bootblock.c index 9e90a844bb..45a9de455e 100644 --- a/src/mainboard/emulation/qemu-aarch64/bootblock.c +++ b/src/mainboard/emulation/qemu-aarch64/bootblock.c @@ -4,8 +4,6 @@ #include <bootblock_common.h> #include <symbols.h> -extern u8 _secram[], _esecram[]; - void bootblock_mainboard_init(void) { mmu_init(); @@ -20,7 +18,7 @@ void bootblock_mainboard_init(void) mmu_config_range(_romstage, REGION_SIZE(romstage), MA_MEM | MA_S | MA_RW); mmu_config_range(_ramstage, REGION_SIZE(ramstage), MA_MEM | MA_S | MA_RW); - mmu_config_range(_secram, REGION_SIZE(secram), MA_MEM | MA_S | MA_RW); + mmu_config_range(_bl31, REGION_SIZE(bl31), MA_MEM | MA_S | MA_RW); mmu_enable(); } diff --git a/src/mainboard/emulation/qemu-aarch64/mainboard.c b/src/mainboard/emulation/qemu-aarch64/mainboard.c index 7bf9260f8a..212064b6f3 100644 --- a/src/mainboard/emulation/qemu-aarch64/mainboard.c +++ b/src/mainboard/emulation/qemu-aarch64/mainboard.c @@ -5,11 +5,9 @@ #include <device/device.h> #include <bootmem.h> -extern u8 _secram[], _esecram[]; - void bootmem_platform_add_ranges(void) { - bootmem_add_range((uintptr_t)_secram, REGION_SIZE(secram), BM_MEM_BL31); + bootmem_add_range((uintptr_t)_bl31, REGION_SIZE(bl31), BM_MEM_BL31); } static void mainboard_enable(struct device *dev) diff --git a/src/mainboard/emulation/qemu-aarch64/memlayout.ld b/src/mainboard/emulation/qemu-aarch64/memlayout.ld index ae00e96665..9c1bb197ce 100644 --- a/src/mainboard/emulation/qemu-aarch64/memlayout.ld +++ b/src/mainboard/emulation/qemu-aarch64/memlayout.ld @@ -16,7 +16,7 @@ SECTIONS { REGION(flash, 0x00000000, CONFIG_ROM_SIZE, 8) - REGION(secram, 0xe000000, 0x1000000, 4096) + BL31(0xe000000, 0x1000000) DRAM_START(0x40000000) BOOTBLOCK(0x60010000, 64K) STACK(0x60020000, 54K) |