summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorXiang Wang <wxjstz@126.com>2019-02-19 15:59:48 +0800
committerPatrick Rudolph <siro@das-labor.org>2019-06-23 12:15:23 +0000
commite56fb89e7c04655ec0fed36484d9e509e08f662f (patch)
tree1ad9999b43303cd5ed06b8efe65aa58597fe18db /src/arch
parentb1e6654d86fff0016651ede345846f4437a2569c (diff)
downloadcoreboot-e56fb89e7c04655ec0fed36484d9e509e08f662f.tar.xz
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>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/riscv/boot.c7
1 files changed, 7 insertions, 0 deletions
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 <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 @@ static void do_arch_prog_run(struct prog *prog)
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.
*/