[PATCH 1/7] firmware: fw_dynamic: add boot_dtb field to struct fw_dynamic_info

Zong Li zong.li at sifive.com
Mon Jul 6 20:39:48 PDT 2026


Introduce a new info version (FW_DYNAMIC_INFO_VERSION_3) and add an
unsigned long 'boot_dtb' member at the end of struct fw_dynamic_info to
carry the device tree blob (DTB) address.

This field will be consumed by the new FW_DYNAMIC_APPEND firmware type.

Signed-off-by: Zong Li <zong.li at sifive.com>
---
 include/sbi/fw_dynamic.h | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/include/sbi/fw_dynamic.h b/include/sbi/fw_dynamic.h
index 2ab4dbab..5fcf5dab 100644
--- a/include/sbi/fw_dynamic.h
+++ b/include/sbi/fw_dynamic.h
@@ -26,13 +26,16 @@
 #define FW_DYNAMIC_INFO_OPTIONS_OFFSET		(4 * __SIZEOF_LONG__)
 /** Offset of boot_hart member in fw_dynamic_info  (version >= 2) */
 #define FW_DYNAMIC_INFO_BOOT_HART_OFFSET	(5 * __SIZEOF_LONG__)
+/** Offset of boot_dtb member in fw_dynamic_info  (version >= 3) */
+#define FW_DYNAMIC_INFO_BOOT_DTB_OFFSET		(6 * __SIZEOF_LONG__)
 
 /** Expected value of info magic ('OSBI' ascii string in hex) */
 #define FW_DYNAMIC_INFO_MAGIC_VALUE		0x4942534f
 
 /** Maximum supported info version */
 #define FW_DYNAMIC_INFO_VERSION_2		0x2
-#define FW_DYNAMIC_INFO_VERSION_MAX		FW_DYNAMIC_INFO_VERSION_2
+#define FW_DYNAMIC_INFO_VERSION_3		0x3
+#define FW_DYNAMIC_INFO_VERSION_MAX		FW_DYNAMIC_INFO_VERSION_3
 
 /** Possible next mode values */
 #define FW_DYNAMIC_INFO_NEXT_MODE_U		0x0
@@ -73,6 +76,17 @@ struct fw_dynamic_info {
 	 * to use the relocation lottery mechanism.
 	 */
 	unsigned long boot_hart;
+	/**
+	 * Address of the device tree blob (DTB) to be passed to the next
+	 * booting stage.
+	 *
+	 * This field is only meaningful for the FW_DYNAMIC_APPEND firmware
+	 * type (version >= 3), where the previous booting stage patches the
+	 * appended fw_dynamic_info structure at the tail of the OpenSBI
+	 * binary instead of passing a pointer in a2. fw_base.S loads this
+	 * value into a1 before the normal boot flow.
+	 */
+	unsigned long boot_dtb;
 } __packed;
 
 /**
@@ -85,6 +99,7 @@ assert_member_offset(struct fw_dynamic_info, next_addr, FW_DYNAMIC_INFO_NEXT_ADD
 assert_member_offset(struct fw_dynamic_info, next_mode, FW_DYNAMIC_INFO_NEXT_MODE_OFFSET);
 assert_member_offset(struct fw_dynamic_info, options, FW_DYNAMIC_INFO_OPTIONS_OFFSET);
 assert_member_offset(struct fw_dynamic_info, boot_hart, FW_DYNAMIC_INFO_BOOT_HART_OFFSET);
+assert_member_offset(struct fw_dynamic_info, boot_dtb, FW_DYNAMIC_INFO_BOOT_DTB_OFFSET);
 
 #endif
 
-- 
2.43.7




More information about the opensbi mailing list