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>
This commit is contained in:
Patrick Rudolph
2019-06-12 09:48:31 +02:00
committed by Patrick Georgi
parent 23df47724d
commit c6ba36f069

View File

@@ -15,15 +15,18 @@
#include <memlayout.h> #include <memlayout.h>
#include <arch/header.ld> #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 SECTIONS
{ {
DRAM_START(START) DRAM_START(QEMU_VIRT_DRAM)
BOOTBLOCK(START, 64K) BOOTBLOCK(QEMU_VIRT_DRAM, 64K)
STACK(START + 4M, 4K) // CBFS goes here
ROMSTAGE(START + 4M + 64K, 128K) STACK(STAGES_START, 4K)
PRERAM_CBMEM_CONSOLE(START + 4M + 192K, 8K) ROMSTAGE(STAGES_START + 64K, 128K)
RAMSTAGE(START + 4M + 200K, 16M) PRERAM_CBMEM_CONSOLE(STAGES_START + 192K, 8K)
RAMSTAGE(STAGES_START + 200K, 16M)
} }