[PATCH 3/4] bloblist: Provide access to the FDT address
Simon Glass
sjg at chromium.org
Fri Mar 28 16:43:57 CET 2025
The firmware handoff specification provides for a devicetree pointer in
a register. Provide access to that so we don't have to parse the
bloblist to get it.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
arch/arm/lib/xferlist.c | 6 ++++--
common/bloblist.c | 5 +++--
include/bloblist.h | 5 +++--
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/arch/arm/lib/xferlist.c b/arch/arm/lib/xferlist.c
index 6425936d354..16c28e34604 100644
--- a/arch/arm/lib/xferlist.c
+++ b/arch/arm/lib/xferlist.c
@@ -8,7 +8,7 @@
#include <bloblist.h>
#include "xferlist.h"
-int xferlist_from_boot_arg(ulong *addr)
+int xferlist_from_boot_arg(ulong *addrp, ulong *fdtp)
{
int ret;
@@ -17,7 +17,9 @@ int xferlist_from_boot_arg(ulong *addr)
if (ret)
return ret;
- *addr = bloblist_get_base();
+ *addrp = saved_args[3];
+ if (fdtp)
+ *fdtp = saved_args[0];
return 0;
}
diff --git a/common/bloblist.c b/common/bloblist.c
index 135fb149626..83d9de2749e 100644
--- a/common/bloblist.c
+++ b/common/bloblist.c
@@ -505,7 +505,8 @@ int bloblist_reloc(void *to, uint to_size)
/*
* Weak default function for getting bloblist from boot args.
*/
-int __weak xferlist_from_boot_arg(ulong __always_unused *addr)
+int __weak xferlist_from_boot_arg(ulong __always_unused *addrp,
+ ulong __always_unused *fdtp)
{
return -ENOENT;
}
@@ -536,7 +537,7 @@ int bloblist_init(void)
size = CONFIG_BLOBLIST_SIZE;
if (from_boot_arg) {
- ret = xferlist_from_boot_arg(&addr);
+ ret = xferlist_from_boot_arg(&addr, NULL);
/*
* If Firmware Handoff is mandatory but no transfer list is
* observed, report it as an error.
diff --git a/include/bloblist.h b/include/bloblist.h
index f32faf78560..7ff70e9554c 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -509,9 +509,10 @@ 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
+ * @addrp: Returns address of the bloblist
+ * @fdtp: If non-NULL, returns address of the FDT
* Return: 0 if OK, else on error
*/
-int xferlist_from_boot_arg(ulong *addr);
+int xferlist_from_boot_arg(ulong *addrp, ulong *fdtp);
#endif /* __BLOBLIST_H */
--
2.43.0
More information about the U-Boot
mailing list