diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c index edf5295d79..8e4bb36af5 100644 --- a/src/arch/riscv/boot.c +++ b/src/arch/riscv/boot.c @@ -19,6 +19,7 @@ #include #include #include +#include /* * A pointer to the Flattened Device Tree passed to coreboot by the boot ROM. @@ -33,6 +34,12 @@ static void do_arch_prog_run(struct prog *prog) int hart_id; 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.