mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "open list:BAREBOX" <barebox@lists.infradead.org>
Subject: [PATCH 3/3] ARM: beagleplay: put external device tree into handoff data
Date: Mon, 09 Dec 2024 15:28:13 +0100	[thread overview]
Message-ID: <20241209-ext-dt-handoff-v1-3-e61052d5d437@pengutronix.de> (raw)
In-Reply-To: <20241209-ext-dt-handoff-v1-0-e61052d5d437@pengutronix.de>

Pass the dtb from 1st stage loader to barebox using handoff data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/beagleplay/lowlevel.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/beagleplay/lowlevel.c b/arch/arm/boards/beagleplay/lowlevel.c
index 9d76dbd0a2..228484bf4e 100644
--- a/arch/arm/boards/beagleplay/lowlevel.c
+++ b/arch/arm/boards/beagleplay/lowlevel.c
@@ -5,21 +5,27 @@
 #include <asm/barebox-arm.h>
 #include <debug_ll.h>
 #include <pbl.h>
+#include <pbl/handoff-data.h>
+#include <compressed-dtb.h>
 
 /* Called from assembly */
-void beagleplay(void);
+void beagleplay(void *dtb);
 
-static noinline void beagleplay_continue(void)
+static noinline void beagleplay_continue(void *dtb)
 {
 	unsigned long membase, memsize;
 	extern char __dtb_k3_am625_beagleplay_start[];
+	unsigned int size;
 
 	fdt_find_mem(__dtb_k3_am625_beagleplay_start, &membase, &memsize);
 
+	if (blob_is_valid_fdt_ptr(dtb, membase, memsize, &size))
+		handoff_data_add(HANDOFF_DATA_EXTERNAL_DT, dtb, size);
+
 	barebox_arm_entry(membase, memsize, __dtb_k3_am625_beagleplay_start);
 }
 
-void beagleplay(void)
+void beagleplay(void *dtb)
 {
 	putc_ll('>');
 
@@ -29,5 +35,5 @@ void beagleplay(void)
 
 	setup_c();
 
-	beagleplay_continue();
+	beagleplay_continue(dtb);
 }

-- 
2.39.5




  parent reply	other threads:[~2024-12-09 14:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 14:28 [PATCH 0/3] make dtb from 1st stage loader available in barebox Sascha Hauer
2024-12-09 14:28 ` [PATCH 1/3] fdt: Add function to check if a pointer contains a fdt Sascha Hauer
2024-12-09 14:28 ` [PATCH 2/3] store external device tree as file Sascha Hauer
2024-12-09 14:28 ` Sascha Hauer [this message]
2024-12-16  8:31 ` [PATCH 0/3] make dtb from 1st stage loader available in barebox 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=20241209-ext-dt-handoff-v1-3-e61052d5d437@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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