Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36599 )
Change subject: arch/riscv: Make the setting of fdt calling argument more explicit ......................................................................
arch/riscv: Make the setting of fdt calling argument more explicit
Make sure to only rely on prog_entry_arg() in certain situations. For instance in romstage cbmem_top() is programmed there instead of the fdt.
Change-Id: Id08a12ad7b72ad539e934a133acf2c4a5bcdf1f9 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/riscv/boot.c 1 file changed, 8 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/36599/1
diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c index 6a23b8a..ecc230f 100644 --- a/src/arch/riscv/boot.c +++ b/src/arch/riscv/boot.c @@ -38,20 +38,22 @@ { int hart_id; struct prog *prog = args->prog; - void *fdt = prog_entry_arg(prog); + void *fdt = NULL;
- /* - * Workaround selfboot putting the coreboot table into prog_entry_arg - */ if (prog_cbfs_type(prog) == CBFS_TYPE_SELF) fdt = HLS()->fdt;
+ if ((ENV_BOOTBLOCK || ENV_ROMSTAGE) && prog_cbfs_type(prog) == CBFS_TYPE_STAGE) + fdt = HLS()->fdt; /* * If prog_entry_arg is not set (e.g. by fit_payload), use fdt from HLS * instead. */ - if (fdt == NULL) - fdt = HLS()->fdt; + if (ENV_RAMSTAGE) { + fdt = prog_entry_arg(prog); + if (fdt == NULL) + fdt = HLS()->fdt; + }
if (ENV_RAMSTAGE && prog_type(prog) == PROG_PAYLOAD) { if (CONFIG(RISCV_OPENSBI))