summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-04-14 20:35:45 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-04-17 09:08:33 +0200
commit378c97f9138ab4ec2e1257b4cc70072b459a5361 (patch)
treeae955a07ef03fbdae1ed8cbc7cfc5eb126871491
parentf09de517765a4fab6a0edcfe32f4e35a056f683f (diff)
downloadbarebox-378c97f9138ab4ec2e1257b4cc70072b459a5361.tar.gz
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 <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414183545.2039170-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/boards/raspberry-pi/rpi-common.c17
1 files changed, 17 insertions, 0 deletions
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");