mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: "Daniel Brát" <danek.brat@gmail.com>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>
Subject: [PATCH 2/2] ARM: rpi: fixup prefix property from VideoCore FDT
Date: Fri, 14 Apr 2023 20:35:45 +0200	[thread overview]
Message-ID: <20230414183545.2039170-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230414183545.2039170-1-a.fatoum@pengutronix.de>

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>
---
 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




  reply	other threads:[~2023-04-14 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 18:35 [PATCH 1/2] of: implement of_copy_property Ahmad Fatoum
2023-04-14 18:35 ` Ahmad Fatoum [this message]
2023-04-17  7:08 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230414183545.2039170-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=danek.brat@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox