[PATCH 2/2] ARM: rpi: fixup prefix property from VideoCore FDT

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Apr 14 11:35:45 PDT 2023


barebox will warn about lack of these properties when network booting.
To make network booted barebox behave identically to flashed barebox,
let's unconditionally copy them from VideoCore FDT into fixed up FDT.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/boards/raspberry-pi/rpi-common.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 3ed4510296ea..319a3d85ead5 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -256,6 +256,21 @@ static enum reset_src_type rpi_decode_pm_rsts(struct device_node *chosen,
 	return RESET_UKWN;
 }
 
+static int rpi_vc_fdt_fixup(struct device_node *root, void *data)
+{
+	const struct device_node *vc_chosen = data;
+	struct device_node *chosen;
+
+	chosen = of_create_node(root, "/chosen");
+	if (!chosen)
+		return -ENOMEM;
+
+	of_copy_property(vc_chosen, "overlay_prefix", chosen);
+	of_copy_property(vc_chosen, "os_prefix", chosen);
+
+	return 0;
+}
+
 static u32 rpi_boot_mode, rpi_boot_part;
 /* Extract useful information from the VideoCore FDT we got.
  * Some parameters are defined here:
@@ -289,6 +304,8 @@ static void rpi_vc_fdt_parse(void *fdt)
 		goto out;
 	}
 
+	of_register_fixup(rpi_vc_fdt_fixup, of_dup(chosen));
+
 	bootloader = of_find_node_by_name(chosen, "bootloader");
 
 	str = of_read_vc_string(chosen, "bootargs");
-- 
2.39.2




More information about the barebox mailing list