[PATCH v3 16/22] xferlist: Drop old xferlist code

Simon Glass sjg at chromium.org
Thu Apr 17 20:15:58 CEST 2025


This is not needed now, as the startup protocol is handled in
arch-specific code early in boot.

Drop BLOBLIST_PASSAGE_MANDATORY as well, as OF_BLOBLIST is enough to
cover this. With standard passage the devicetree is accessed before the
bloblist is inited.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 arch/arm/lib/Makefile                   |  1 -
 arch/arm/lib/xferlist.c                 | 23 ---------------
 arch/arm/lib/xferlist.h                 | 19 -------------
 common/Kconfig                          | 11 -------
 common/bloblist.c                       | 38 -------------------------
 configs/vexpress_fvp_bloblist_defconfig |  2 +-
 doc/board/armltd/vexpress64.rst         |  2 +-
 include/bloblist.h                      | 26 ++---------------
 8 files changed, 4 insertions(+), 118 deletions(-)
 delete mode 100644 arch/arm/lib/xferlist.c
 delete mode 100644 arch/arm/lib/xferlist.h

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index ade42d0ca43..31497394580 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -86,7 +86,6 @@ obj-y	+= psci-dt.o
 
 obj-$(CONFIG_DEBUG_LL)	+= debug.o
 
-obj-$(CONFIG_BLOBLIST)  += xferlist.o
 obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi_table.o
 
 # For EABI conformant tool chains, provide eabi_compat()
diff --git a/arch/arm/lib/xferlist.c b/arch/arm/lib/xferlist.c
deleted file mode 100644
index 6425936d354..00000000000
--- a/arch/arm/lib/xferlist.c
+++ /dev/null
@@ -1,23 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2023 Linaro Limited
- * Author: Raymond Mao <raymond.mao at linaro.org>
- */
-#include <linux/types.h>
-#include <errno.h>
-#include <bloblist.h>
-#include "xferlist.h"
-
-int xferlist_from_boot_arg(ulong *addr)
-{
-	int ret;
-
-	ret = bloblist_check_reg_conv(saved_args[0], saved_args[2],
-				      saved_args[1], saved_args[3]);
-	if (ret)
-		return ret;
-
-	*addr = bloblist_get_base();
-
-	return 0;
-}
diff --git a/arch/arm/lib/xferlist.h b/arch/arm/lib/xferlist.h
deleted file mode 100644
index 60d79c1a8eb..00000000000
--- a/arch/arm/lib/xferlist.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ BSD-3-Clause */
-/*
- * Copyright (C) 2023 Linaro Limited
- * Author: Raymond Mao <raymond.mao at linaro.org>
- */
-
-#ifndef _XFERLIST_H_
-#define _XFERLIST_H_
-
-/*
- * Boot parameters saved from start.S
- * saved_args[0]: FDT base address
- * saved_args[1]: Bloblist signature
- * saved_args[2]: must be 0
- * saved_args[3]: Bloblist base address
- */
-extern unsigned long saved_args[];
-
-#endif /* _XFERLIST_H_ */
diff --git a/common/Kconfig b/common/Kconfig
index 1f908790139..773ea3c9e7f 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1079,16 +1079,6 @@ config BLOBLIST_ALLOC
 	  specify a fixed address on systems where this is unknown or can
 	  change at runtime.
 
-config BLOBLIST_PASSAGE_MANDATORY
-	bool "Use bloblist in-place mandatorily"
-	help
-	  By default U-Boot will use a bloblist in the incoming standard passage.
-	  This option controls whether U-Boot tries to load a static bloblist or
-	  allocate one if a valid incoming bloblist does not exist.
-	  Select this option to mark incoming standard passage as mandatory and
-	  U-Boot will report an error when a valid incoming bloblist does not
-	  exist.
-
 config BLOBLIST_PASSAGE
 	bool "Obtain bloblist from standard passage information"
 	help
@@ -1111,7 +1101,6 @@ config BLOBLIST_ADDR
 
 config BLOBLIST_SIZE
 	hex "Size of bloblist"
-	default 0x0 if BLOBLIST_PASSAGE_MANDATORY
 	default 0x400
 	help
 	  Sets the size of the bloblist in bytes. This must include all
diff --git a/common/bloblist.c b/common/bloblist.c
index c7322b96bcb..d0e92acfee5 100644
--- a/common/bloblist.c
+++ b/common/bloblist.c
@@ -503,14 +503,6 @@ int bloblist_reloc(void *to, uint to_size)
 	return 0;
 }
 
-/*
- * Weak default function for getting bloblist from boot args.
- */
-int __weak xferlist_from_boot_arg(ulong __always_unused *addr)
-{
-	return -ENOENT;
-}
-
 int bloblist_init(void)
 {
 	bool fixed = IS_ENABLED(CONFIG_BLOBLIST_FIXED);
@@ -587,33 +579,3 @@ int bloblist_maybe_init(void)
 
 	return 0;
 }
-
-int bloblist_check_reg_conv(ulong rfdt, ulong rzero, ulong rsig, ulong xlist)
-{
-	u64 version = BLOBLIST_REGCONV_VER;
-	ulong sigval;
-	int ret;
-
-	if ((IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_SPL_BUILD)) ||
-			(IS_ENABLED(CONFIG_SPL_64BIT) && IS_ENABLED(CONFIG_SPL_BUILD))) {
-		sigval = ((BLOBLIST_MAGIC & ((1ULL << BLOBLIST_REGCONV_SHIFT_64) - 1)) |
-			 ((version  & BLOBLIST_REGCONV_MASK) << BLOBLIST_REGCONV_SHIFT_64));
-	} else {
-		sigval = ((BLOBLIST_MAGIC & ((1UL << BLOBLIST_REGCONV_SHIFT_32) - 1)) |
-			 ((version  & BLOBLIST_REGCONV_MASK) << BLOBLIST_REGCONV_SHIFT_32));
-	}
-
-	if (rzero || rsig != sigval)
-		return -EIO;
-
-	ret = bloblist_check(xlist, 0);
-	if (ret)
-		return ret;
-
-	if (rfdt != (ulong)bloblist_find(BLOBLISTT_CONTROL_FDT, 0)) {
-		gd->bloblist = NULL;  /* Reset the gd bloblist pointer */
-		return -EIO;
-	}
-
-	return 0;
-}
diff --git a/configs/vexpress_fvp_bloblist_defconfig b/configs/vexpress_fvp_bloblist_defconfig
index 4d52b96202b..9d59e016b5f 100644
--- a/configs/vexpress_fvp_bloblist_defconfig
+++ b/configs/vexpress_fvp_bloblist_defconfig
@@ -1,5 +1,5 @@
 #include <configs/vexpress_fvp_defconfig>
 
 CONFIG_BLOBLIST=y
-CONFIG_BLOBLIST_PASSAGE_MANDATORY=y
+CONFIG_OF_PASSAGE=y
 CONFIG_BLOBLIST_SIZE_RELOC=0x10000
diff --git a/doc/board/armltd/vexpress64.rst b/doc/board/armltd/vexpress64.rst
index 109337d7fe3..ebf1ec77c7a 100644
--- a/doc/board/armltd/vexpress64.rst
+++ b/doc/board/armltd/vexpress64.rst
@@ -103,7 +103,7 @@ bloblist, or utilizing a standard passage-provided bloblist with automatic size
 detection.
 
 By default, ``vexpress_fvp_bloblist_defconfig`` uses the standard passage method mandatorily
-(CONFIG_BLOBLIST_PASSAGE_MANDATORY) because TF-A provides a Transfer List in non-secure
+(CONFIG_OF_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.
diff --git a/include/bloblist.h b/include/bloblist.h
index f32faf78560..6ea864bf896 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -467,8 +467,8 @@ int bloblist_reloc(void *to, uint to_size);
  * If CONFIG_BLOBLIST_ALLOC is selected, it allocates memory for a bloblist of
  * size CONFIG_BLOBLIST_SIZE.
  *
- * If CONFIG_BLOBLIST_PASSAGE_MANDATORY is selected, bloblist in the incoming
- * standard passage is mandatorily required.
+ * If CONFIG_OF_BLOBLIST is selected, a bloblist is required in the incoming
+ * standard passage.
  *
  * Sets GD_FLG_BLOBLIST_READY in global_data flags on success
  *
@@ -492,26 +492,4 @@ static inline int bloblist_maybe_init(void)
 }
 #endif /* BLOBLIST */
 
-/**
- * bloblist_check_reg_conv() - Check whether the bloblist is compliant to
- *			       the register conventions according to the
- *			       Firmware Handoff spec.
- *
- * @rfdt:  Register that holds the FDT base address.
- * @rzero: Register that must be zero.
- * @rsig:  Register that holds signature and register conventions version.
- * @xlist: Register that holds the transfer list.
- * Return: 0 if OK, -EIO if the bloblist is not compliant to the register
- *	   conventions.
- */
-int bloblist_check_reg_conv(ulong rfdt, ulong rzero, ulong rsig, ulong xlist);
-
-/**
- * xferlist_from_boot_arg() - Get bloblist from the boot args.
- *
- * @addr: Address of the bloblist
- * Return: 0 if OK, else on error
- */
-int xferlist_from_boot_arg(ulong *addr);
-
 #endif /* __BLOBLIST_H */
-- 
2.43.0



More information about the U-Boot mailing list