Patrick Rudolph has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31477 )
Change subject: riscv: workaround selfboot putting the coreboot table into prog_entry_arg ......................................................................
riscv: workaround selfboot putting the coreboot table into prog_entry_arg
On RISC-V the argument to a payload is always the hartid and a pointer to a FDT. selfboot sets the coreboot tables as an argument, work around this here.
Change-Id: If6929897c7f12d8acb079eeebaef512ae506ca8b Signed-off-by: Xiang Wang wxjstz@126.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/31477 Reviewed-by: ron minnich rminnich@gmail.com Reviewed-by: Patrick Rudolph siro@das-labor.org Reviewed-by: Philipp Hug philipp@hug.cx Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/arch/riscv/boot.c 1 file changed, 7 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified ron minnich: Looks good to me, approved Patrick Rudolph: Looks good to me, but someone else must approve Philipp Hug: Looks good to me, approved
diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c index edf5295..8e4bb36 100644 --- a/src/arch/riscv/boot.c +++ b/src/arch/riscv/boot.c @@ -19,6 +19,7 @@ #include <arch/encoding.h> #include <arch/smp/smp.h> #include <mcall.h> +#include <commonlib/cbfs_serialized.h>
/* * A pointer to the Flattened Device Tree passed to coreboot by the boot ROM. @@ -34,6 +35,12 @@ void *fdt = prog_entry_arg(prog);
/* + * Workaround selfboot putting the coreboot table into prog_entry_arg + */ + if (prog_cbfs_type(prog) == CBFS_TYPE_SELF) + fdt = HLS()->fdt; + + /* * If prog_entry_arg is not set (e.g. by fit_payload), use fdt from HLS * instead. */