Patrick Rudolph merged this change.

View Change

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
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(-)

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.
*/

To view, visit change 31477. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If6929897c7f12d8acb079eeebaef512ae506ca8b
Gerrit-Change-Number: 31477
Gerrit-PatchSet: 11
Gerrit-Owner: Xiang Wang <wxjstz@126.com>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Philipp Hug <philipp@hug.cx>
Gerrit-Reviewer: Shawn C <citypw@gmail.com>
Gerrit-Reviewer: Xiang Wang <wxjstz@126.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Reviewer: ron minnich <rminnich@gmail.com>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged