[PATCH 4/7] firmware: fw_base.S: call fw_dynamic_append_boot_args on cold boot
Zong Li
zong.li at sifive.com
Mon Jul 6 20:39:51 PDT 2026
When building the FW_DYNAMIC_APPEND firmware type, the previous booting
stage jumps directly to _start without setting up a0/a1/a2. Add a single
guarded call at the very top of the cold _start path to
fw_dynamic_append_boot_args(), whose implementation lives in
fw_dynamic_append.S.
The call is wrapped in #ifdef FW_DYNAMIC_APPEND, which is only defined by
fw_dynamic_append.S, so FW_DYNAMIC, FW_JUMP and FW_PAYLOAD compile and
behave exactly as before. Only the cold boot path is touched, secondary
HARTs continue to enter through _start_warm.
Signed-off-by: Zong Li <zong.li at sifive.com>
---
firmware/fw_base.S | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index 0c5c65c1..91a17efb 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -46,6 +46,17 @@
.globl _start
.globl _start_warm
_start:
+#ifdef FW_DYNAMIC_APPEND
+ /*
+ * FW_DYNAMIC_APPEND entry fixup (cold boot path only).
+ *
+ * For this firmware type the previous booting stage does NOT pass the
+ * usual a0=hartid, a1=dtb, a2=fw_dynamic_info arguments. It merely
+ * patches the fw_dynamic_info structure appended at the tail of this
+ * binary (right before .bss, see fw_base.ldS) and jumps here.
+ */
+ call fw_dynamic_append_boot_args
+#endif
/* Find preferred boot HART id */
MOV_3R s0, a0, s1, a1, s2, a2
call fw_boot_hart
--
2.43.7
More information about the opensbi
mailing list