summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2019-06-12 09:48:31 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-06-21 09:24:38 +0000
commitc6ba36f0694c3fa9a7db2a61bc264bef851b4360 (patch)
tree1045c5d4b7123ffead64f737c4baae488b3d9201
parent23df47724d792207fc99864acabf2cd234ac0d9d (diff)
downloadcoreboot-c6ba36f0694c3fa9a7db2a61bc264bef851b4360.tar.xz
mb/emulation/qemu-riscv: Support arbitrary ROM sizes
Make the linker script dynamic to support non default ROM sizes. Prevents weird runtime issues due to stages overwriting parts of the CBFS while decompressing stages. Change-Id: I37b9187c719b907959f02a272ec0459aabbcda3c Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33412 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Hug <philipp@hug.cx>
-rw-r--r--src/mainboard/emulation/qemu-riscv/memlayout.ld17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mainboard/emulation/qemu-riscv/memlayout.ld b/src/mainboard/emulation/qemu-riscv/memlayout.ld
index 032fbddecf..7f8ec3dd6a 100644
--- a/src/mainboard/emulation/qemu-riscv/memlayout.ld
+++ b/src/mainboard/emulation/qemu-riscv/memlayout.ld
@@ -15,15 +15,18 @@
#include <memlayout.h>
#include <arch/header.ld>
+#include <mainboard/addressmap.h>
-#define START 0x80000000
+//Stages start after CBFS in DRAM
+#define STAGES_START (QEMU_VIRT_DRAM + CONFIG_ROM_SIZE)
SECTIONS
{
- DRAM_START(START)
- BOOTBLOCK(START, 64K)
- STACK(START + 4M, 4K)
- ROMSTAGE(START + 4M + 64K, 128K)
- PRERAM_CBMEM_CONSOLE(START + 4M + 192K, 8K)
- RAMSTAGE(START + 4M + 200K, 16M)
+ DRAM_START(QEMU_VIRT_DRAM)
+ BOOTBLOCK(QEMU_VIRT_DRAM, 64K)
+ // CBFS goes here
+ STACK(STAGES_START, 4K)
+ ROMSTAGE(STAGES_START + 64K, 128K)
+ PRERAM_CBMEM_CONSOLE(STAGES_START + 192K, 8K)
+ RAMSTAGE(STAGES_START + 200K, 16M)
}