Skip to contentSkip to conversation

bloblist: fix typo in code comments

PATCH In review Harrison Mutai 3 participants 12 messages Dec 18, 2024 – Dec 27, 2024 1 message not in the archive Arm/versatile express platform

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/4 bloblist: fix typo in code comments

---
 common/Kconfig     | 2 +-
 include/bloblist.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/Kconfig +1 -1
index e8d89bf6eb..9e89ccd390 100644
@@ -1075,7 +1075,7 @@ config BLOBLIST_SIZE
 	  Sets the size of the bloblist in bytes. This must include all
 	  overhead (alignment, bloblist header, record header). The bloblist
 	  is set up in the first part of U-Boot to run (TPL, SPL or U-Boot
-	  proper), and this sane bloblist is used for subsequent phases.
+	  proper), and this same bloblist is used for subsequent phases.
 
 config BLOBLIST_SIZE_RELOC
 	hex "Size of bloblist after relocation"
include/bloblist.h +1 -1
index ff32d3fecf..9d3ec3a8fa 100644
@@ -456,7 +456,7 @@ int bloblist_init(void);
 /**
  * bloblist_maybe_init() - Init the bloblist system if not already done
  *
- * Calls bloblist_init() if the GD_FLG_BLOBLIST_READY flag is not et
+ * Calls bloblist_init() if the GD_FLG_BLOBLIST_READY flag is not set
  *
  * Return: 0 if OK, -ve on error
  */

--
2.46.2

#3 lore raw

Hi Tom,

Thanks for reviewing.

Quoted 11 lines · Tom Rini
Quoted 5 lines · Harrison Mutai
---
  common/Kconfig     | 2 +-
  include/bloblist.h | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

Please add a short commit message body "Fix the two typos in ...", thanks. With that:

Ack - will add in next revision.

Quoted 2 lines

I realized I made an error when posting the series and accidentally left out the cover letter. Would it be best to send an updated version (v2) to the mailing list to include the missing cover letter?

All the best,
Harrison

#4 lore raw
Quoted 16 lines · Harrison Mutai

Hi Tom,

Thanks for reviewing.

Quoted 11 lines · Tom Rini
Quoted 5 lines · Harrison Mutai
---
  common/Kconfig     | 2 +-
  include/bloblist.h | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

Please add a short commit message body "Fix the two typos in ...", thanks. With that:

Quoted 8 lines

Ack - will add in next revision.

Quoted 2 lines

I realized I made an error when posting the series and accidentally left out the cover letter. Would it be best to send an updated version (v2) to the mailing list to include the missing cover letter?

Please wait a bit before re-posting, the cover letter is easy enough to find, thanks.

Signature · 1 line
Tom
#5 lore raw

PATCH 2/4 board: vexpress64: default to hardware device tree

In reply to a message not in the archive

When booting into the Linux kernel with semi-hosting, use the device tree provided by hardware unless one is provided in the current directory.

---
 include/configs/vexpress_aemv8.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/configs/vexpress_aemv8.h +4 -2
index 8020689e39..2341b3a938 100644
@@ -169,12 +169,14 @@
 		"  if load hostfs - ${kernel_addr_r} ${kernel_name}; then"	\
 		"    setenv fdt_high 0xffffffffffffffff;"		\
 		"    setenv initrd_high 0xffffffffffffffff;"		\
-		"    load hostfs - ${fdt_addr_r} ${fdtfile};"			\
+		"    if test -n load hostfs - ${fdt_addr_r} ${fdtfile}; then"			\
+		"        fdt move $fdtcontroladdr $fdt_addr_r;"			\
+		"    fi;"			\
 		"    load hostfs - ${ramdisk_addr_r} ${ramdisk_name};" \
 		"    fdt addr ${fdt_addr_r};"				\
 		"    fdt resize;"					\
 		"    fdt chosen ${ramdisk_addr_r} ${filesize};"	\
-		"    booti $kernel_addr_r - $fdt_addr_r;"		\
+		"    booti $kernel_addr_r - ${fdt_addr_r};"		\
 		"  fi;"							\
 		"fi\0"
 #define BOOTENV_DEV_NAME_SMH(devtypeu, devtypel, instance) "smh "

--
2.46.2

#7 lore raw

PATCH 3/4 bloblist: add support for CONFIG_BLOBLIST_PASSAGE

In reply to a message not in the archive

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.

---
 common/Kconfig    | 7 +++++++
 common/bloblist.c | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
common/Kconfig +7 -0
index 9e89ccd390..11066ec643 100644
@@ -1056,6 +1056,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
@@ -1070,6 +1076,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
common/bloblist.c +4 -1
index ec6ff7a5a9..db0091dc0e 100644
@@ -475,6 +475,9 @@ int bloblist_reloc(void *to, uint to_size)
 {
 	struct bloblist_hdr *hdr;
 
+	if (to_size == 0)
+		return 0;
+
 	if (to_size < gd->bloblist->total_size)
 		return -ENOSPC;
 
@@ -510,7 +513,7 @@ int bloblist_init(void)
 	 * install the bloblist passed from previous loader to this fixed
 	 * address.
 	 */
-	bool from_boot_arg = fixed && xpl_is_first_phase();
+	bool from_boot_arg = xpl_is_first_phase();
 
 	if (xpl_prev_phase() == PHASE_TPL && !IS_ENABLED(CONFIG_TPL_BLOBLIST))
 		from_addr = false;

--
2.46.2

Reviewed-by on v1 3/4
#8 lore raw

Re: [PATCH 3/4] bloblist: add support for CONFIG_BLOBLIST_PASSAGE

Quoted 6 lines · Harrison Mutai

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.

Signature · 1 line
Tom
#9 lore raw

PATCH 4/4 board: vexpress64: enable bloblist for SPL handoff

In reply to a message not in the archive

Enable bloblist on vexpress64 platforms to facilitate information passing from TF-A using the firmware handoff framework.

---
 board/armltd/vexpress64/Makefile        |  3 ++-
 board/armltd/vexpress64/vexpress64.c    |  4 ++++
 configs/vexpress_fvp_bloblist_defconfig |  5 +++++
 doc/board/armltd/vexpress64.rst         | 16 ++++++++++++++++
 4 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 configs/vexpress_fvp_bloblist_defconfig
board/armltd/vexpress64/Makefile +2 -1
index 1878fbed4e..4729787c5e 100644
@@ -3,5 +3,6 @@
 # (C) Copyright 2000-2004
 # Wolfgang Denk, DENX Software Engineering, [email protected].
 
-obj-y	:= vexpress64.o lowlevel_init.o
+obj-y	:= vexpress64.o
+obj-$(CONFIG_OF_HAS_PRIOR_STAGE)	:= lowlevel_init.o
 obj-$(CONFIG_TARGET_VEXPRESS64_JUNO)	+= pcie.o
board/armltd/vexpress64/vexpress64.c +4 -0
index 0119f54f0d..f8bd5fbcf8 100644
@@ -100,7 +100,9 @@ int dram_init_banksize(void)
  * Push the variable into the .data section so that it
  * does not get cleared later.
  */
+#ifdef CONFIG_OF_HAS_PRIOR_STAGE
 unsigned long __section(".data") prior_stage_fdt_address[2];
+#endif
 
 #ifdef CONFIG_OF_BOARD
 
@@ -151,6 +153,7 @@ static phys_addr_t find_dtb_in_nor_flash(const char *partname)
 }
 #endif
 
+#ifdef CONFIG_OF_HAS_PRIOR_STAGE
 /*
  * Filter for a valid DTB, as TF-A happens to provide a pointer to some
  * data structure using the DTB format, which we cannot use.
@@ -206,6 +209,7 @@ void *board_fdt_blob_setup(int *err)
 	return NULL;
 }
 #endif
+#endif
 
 /* Actual reset is done via PSCI. */
 void reset_cpu(void)
configs/vexpress_fvp_bloblist_defconfig new file +5 -0
new file mode 100644
index 0000000000..dcc87db872
@@ -0,0 +1,5 @@
+#include <configs/vexpress_fvp_defconfig>
+
+CONFIG_BLOBLIST=y
+CONFIG_BLOBLIST_PASSAGE=y
+CONFIG_BLOBLIST_SIZE_RELOC=0x10000
doc/board/armltd/vexpress64.rst +16 -0
index a7f771d266..4dadadb53d 100644
@@ -43,6 +43,22 @@ Juno is an Arm development board with the following features:
 
 More details can be found in the board documentation [3]_.
 
+Bloblist Support
+----------------
+
+The ``vexpress_fvp_bloblist_defconfig`` configures U-Boot to be compiled for
+Vexpress64 with Bloblist as the primary method for information handoff between
+boot stages. U-Boot offers three methods to set up a bloblist: using a
+predefined bloblist at a specified address, dynamically allocating memory for a
+bloblist, or utilizing a standard passage-provided bloblist with automatic size
+detection.
+
+By default, ``vexpress_fvp_bloblist_defconfig`` uses the standard passage method
+(CONFIG_BLOBLIST_PASSAGE) because TF-A provides a Transfer List in non-secure
+memory that U-Boot can utilise. This Bloblist, which is referred to as a Transfer List in
+TF-A, contains all necessary data for the handoff process, including DT and ACPI
+tables.
+
 References
 ----------
 

--
2.46.2

#10 lore raw

Re: [PATCH 4/4] board: vexpress64: enable bloblist for SPL handoff

Quoted 4 lines · Harrison Mutai

Enable bloblist on vexpress64 platforms to facilitate information passing from TF-A using the firmware handoff framework.

[snip]

configs/vexpress_fvp_bloblist_defconfig line 5

Quoted 11 lines
configs/vexpress_fvp_bloblist_defconfig new file +5 -0
new file mode 100644
index 0000000000..dcc87db872
@@ -0,0 +1,5 @@
+#include <configs/vexpress_fvp_defconfig>
+
+CONFIG_BLOBLIST=y
+CONFIG_BLOBLIST_PASSAGE=y
+CONFIG_BLOBLIST_SIZE_RELOC=0x10000

I wonder if this means we should also do:

common/Kconfig +0 -1
index 11066ec64315..cca33ed28f32 100644
@@ -1087,7 +1087,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

Because in this case we do need to set the size of the bloblist we use internally to non-zero?

Signature · 1 line
Tom
#11 lore raw

Re: [PATCH 4/4] board: vexpress64: enable bloblist for SPL handoff

Quoted 34 lines · Tom Rini
Quoted 4 lines · Harrison Mutai

Enable bloblist on vexpress64 platforms to facilitate information passing from TF-A using the firmware handoff framework.

[snip]

configs/vexpress_fvp_bloblist_defconfig line 5

Quoted 11 lines
configs/vexpress_fvp_bloblist_defconfig new file +5 -0
new file mode 100644
index 0000000000..dcc87db872
@@ -0,0 +1,5 @@
+#include <configs/vexpress_fvp_defconfig>
+
+CONFIG_BLOBLIST=y
+CONFIG_BLOBLIST_PASSAGE=y
+CONFIG_BLOBLIST_SIZE_RELOC=0x10000

I wonder if this means we should also do:

common/Kconfig +0 -1
index 11066ec64315..cca33ed28f32 100644
@@ -1087,7 +1087,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
Quoted 3 lines

Because in this case we do need to set the size of the bloblist we use internally to non-zero?

That makes sense. The relocation in board_f will fail, as reserve_bloblist relies on this value being non-zero. However, if CONFIG_BLOBLIST_PASSAGE implies GD_FLG_SKIP_RELOC, then the relocation may not be necessary?

#12 lore raw

Re: [PATCH 4/4] board: vexpress64: enable bloblist for SPL handoff

Quoted 35 lines · Harrison Mutai
Quoted 34 lines · Tom Rini
Quoted 4 lines · Harrison Mutai

Enable bloblist on vexpress64 platforms to facilitate information passing from TF-A using the firmware handoff framework.

[snip]

configs/vexpress_fvp_bloblist_defconfig line 5

Quoted 11 lines
configs/vexpress_fvp_bloblist_defconfig new file +5 -0
new file mode 100644
index 0000000000..dcc87db872
@@ -0,0 +1,5 @@
+#include <configs/vexpress_fvp_defconfig>
+
+CONFIG_BLOBLIST=y
+CONFIG_BLOBLIST_PASSAGE=y
+CONFIG_BLOBLIST_SIZE_RELOC=0x10000

I wonder if this means we should also do:

common/Kconfig +0 -1
index 11066ec64315..cca33ed28f32 100644
@@ -1087,7 +1087,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
Quoted 6 lines
Quoted 3 lines

Because in this case we do need to set the size of the bloblist we use internally to non-zero?

That makes sense. The relocation in board_f will fail, as reserve_bloblist relies on this value being non-zero. However, if CONFIG_BLOBLIST_PASSAGE implies GD_FLG_SKIP_RELOC, then the relocation may not be necessary?

We don't need to worry about the GD_FLG_SKIP_RELOC case really, it's a corner case of the ARC architecture and nothing else. We do want to however copy the bloblist from where it was passed to us (possibly in the middle of memory for example) and move it to an area we can reserve.

Signature · 1 line
Tom