From a2bc2540c2d004b475b401ccf0b162c2452857bb Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Sat, 29 May 2021 08:10:49 +0200 Subject: Allow to build romstage sources inside the bootblock Having a separate romstage is only desirable: - with advanced setups like vboot or normal/fallback - boot medium is slow at startup (some ARM SOCs) - bootblock is limited in size (Intel APL 32K) When this is not the case there is no need for the extra complexity that romstage brings. Including the romstage sources inside the bootblock substantially reduces the total code footprint. Often the resulting code is 10-20k smaller. This is controlled via a Kconfig option. TESTED: works on qemu x86, arm and aarch64 with and without VBOOT. Change-Id: Id68390edc1ba228b121cca89b80c64a92553e284 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/55068 Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/mainboard/emulation/qemu-armv7/romstage.c | 2 ++ src/mainboard/emulation/qemu-riscv/memlayout.ld | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mainboard/emulation') diff --git a/src/mainboard/emulation/qemu-armv7/romstage.c b/src/mainboard/emulation/qemu-armv7/romstage.c index 598ddde10c..05a75bb80f 100644 --- a/src/mainboard/emulation/qemu-armv7/romstage.c +++ b/src/mainboard/emulation/qemu-armv7/romstage.c @@ -5,11 +5,13 @@ #include #include +#if CONFIG(SEPARATE_ROMSTAGE) void main(void) { console_init(); romstage_main(); } +#endif void __noreturn romstage_main(void) { diff --git a/src/mainboard/emulation/qemu-riscv/memlayout.ld b/src/mainboard/emulation/qemu-riscv/memlayout.ld index 96ab74c516..4fdeb9dccb 100644 --- a/src/mainboard/emulation/qemu-riscv/memlayout.ld +++ b/src/mainboard/emulation/qemu-riscv/memlayout.ld @@ -17,7 +17,7 @@ SECTIONS SRAM_END(STAGES_START) DRAM_START(STAGES_START) -#if ENV_ROMSTAGE +#if ENV_SEPARATE_ROMSTAGE ROMSTAGE(STAGES_START, 128K) #endif #if ENV_RAMSTAGE -- cgit v1.2.3