From 378c97f9138ab4ec2e1257b4cc70072b459a5361 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Fri, 14 Apr 2023 20:35:45 +0200 Subject: ARM: rpi: fixup prefix property from VideoCore FDT 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 Link: https://lore.barebox.org/20230414183545.2039170-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- 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 3ed4510296..319a3d85ea 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"); -- cgit v1.2.1