U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harrison Mutai <harrison.mutai@arm.com>
To: Tom Rini <trini@konsulko.com>
Cc: nd@arm.com, andre.przywara@arm.com, manish.pandey2@arm.com,
	Harrison Mutai <harrison.mutai@arm.com>,
	u-boot@lists.denx.de
Subject: [PATCH 3/4] bloblist: add support for CONFIG_BLOBLIST_PASSAGE
Date: Tue,  4 Feb 2025 17:58:41 +0000	[thread overview]
Message-ID: <20250204175844.19890-4-harrison.mutai@arm.com> (raw)
In-Reply-To: <20250204175844.19890-1-harrison.mutai@arm.com>

When the configuration option CONFIG_BLOBLIST_PASSAGE is selected, the
bloblist present in the incoming standard passage is utilised in-place.
There is no need to specify the size of the bloblist as the system
automatically detects it using the header information.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
---
 common/Kconfig    |  8 +++++++-
 common/bloblist.c | 18 ++++++++++--------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index f9489872fd..7b2db46ef0 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1066,6 +1066,12 @@ config BLOBLIST_ALLOC
 	  specify a fixed address on systems where this is unknown or can
 	  change at runtime.
 
+config BLOBLIST_PASSAGE
+	bool "Use bloblist in-place"
+	help
+	  Use a bloblist in the incoming standard passage. The size is detected
+	  automatically so CONFIG_BLOBLIST_SIZE can be 0.
+
 endchoice
 
 config BLOBLIST_ADDR
@@ -1080,6 +1086,7 @@ config BLOBLIST_ADDR
 
 config BLOBLIST_SIZE
 	hex "Size of bloblist"
+	default 0x0 if BLOBLIST_PASSAGE
 	default 0x400
 	help
 	  Sets the size of the bloblist in bytes. This must include all
@@ -1090,7 +1097,6 @@ config BLOBLIST_SIZE
 config BLOBLIST_SIZE_RELOC
 	hex "Size of bloblist after relocation"
 	default BLOBLIST_SIZE if BLOBLIST_FIXED || BLOBLIST_ALLOC
-	default 0x0 if BLOBLIST_PASSAGE
 	default 0x20000 if (ARM && EFI_LOADER && GENERATE_ACPI_TABLE)
 	help
 	  Sets the size of the bloblist in bytes after relocation. Since U-Boot
diff --git a/common/bloblist.c b/common/bloblist.c
index 110bb9dc44..1fcd387593 100644
--- a/common/bloblist.c
+++ b/common/bloblist.c
@@ -475,6 +475,9 @@ int bloblist_reloc(void *to, uint to_size)
 {
 	struct bloblist_hdr *hdr;
 
+	if (!to_size)
+		return 0;
+
 	if (to_size < gd->bloblist->total_size)
 		return -ENOSPC;
 
@@ -505,13 +508,6 @@ int bloblist_init(void)
 	 * at a fixed address.
 	 */
 	bool from_addr = fixed && !xpl_is_first_phase();
-	/*
-	 * If U-Boot is in the first phase that an arch custom routine should
-	 * install the bloblist passed from previous loader to this fixed
-	 * address.
-	 */
-	bool from_boot_arg = fixed && xpl_is_first_phase();
-
 	if (xpl_prev_phase() == PHASE_TPL && !IS_ENABLED(CONFIG_TPL_BLOBLIST))
 		from_addr = false;
 	if (fixed)
@@ -519,7 +515,13 @@ int bloblist_init(void)
 				      CONFIG_BLOBLIST_ADDR);
 	size = CONFIG_BLOBLIST_SIZE;
 
-	if (from_boot_arg)
+
+	/*
+	 * If the current boot stage is the first phase of U-Boot, then an
+	 * architecture-specific routine should be used to handle the bloblist
+	 * passed from the previous boot loader
+	 */
+	if (xpl_is_first_phase() && !IS_ENABLED(CONFIG_BLOBLIST_ALLOC))
 		ret = xferlist_from_boot_arg(addr, size);
 	else if (from_addr)
 		ret = bloblist_check(addr, size);
-- 
2.46.2


  parent reply	other threads:[~2025-02-04 17:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 17:58 [PATCH v3 0/4] Enable bloblist support on Vexpress64 Harrison Mutai
2025-02-04 17:58 ` [PATCH 1/4] bloblist: fix typo in code comments Harrison Mutai
2025-02-04 17:58 ` [PATCH 2/4] board: vexpress64: default to hardware device tree Harrison Mutai
2025-02-04 17:58 ` Harrison Mutai [this message]
2025-02-04 17:58 ` [PATCH 4/4] board: vexpress64: enable bloblist for SPL handoff Harrison Mutai
2025-02-12  2:08 ` [PATCH v3 0/4] Enable bloblist support on Vexpress64 Tom Rini
     [not found] <20241218153933.37649-1-harrison.mutai@arm.com>
2024-12-18 15:39 ` [PATCH 3/4] bloblist: add support for CONFIG_BLOBLIST_PASSAGE Harrison Mutai
2024-12-18 16:21   ` Tom Rini

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=20250204175844.19890-4-harrison.mutai@arm.com \
    --to=harrison.mutai@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=manish.pandey2@arm.com \
    --cc=nd@arm.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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