fdt: Support reading FDT from standard passage

Add an option to receive the FDT using standard passage from a previous
phase. Rename the FDT source to 'passage' to match the old terminology,
which was only partially added.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-03-28 11:44:18 -06:00
parent 86104769ba
commit 339bd5f0cf
2 changed files with 13 additions and 5 deletions

View File

@@ -72,7 +72,7 @@ struct bd_info;
* U-Boot is packaged as an ELF file, e.g. for debugging purposes
* @FDTSRC_ENV: Provided by the fdtcontroladdr environment variable. This should
* be used for debugging/development only
* @FDTSRC_BLOBLIST: Provided by a bloblist from an earlier phase
* @FDTSRC_PASSAGE: Provided by a bloblist from an earlier phase
*/
enum fdt_source_t {
FDTSRC_SEPARATE,
@@ -80,7 +80,7 @@ enum fdt_source_t {
FDTSRC_BOARD,
FDTSRC_EMBED,
FDTSRC_ENV,
FDTSRC_BLOBLIST,
FDTSRC_PASSAGE,
};
/*

View File

@@ -19,6 +19,7 @@
#include <log.h>
#include <malloc.h>
#include <net.h>
#include <passage.h>
#include <spl.h>
#include <env.h>
#include <errno.h>
@@ -90,7 +91,7 @@ static const char *const fdt_src_name[] = {
[FDTSRC_BOARD] = "board",
[FDTSRC_EMBED] = "embed",
[FDTSRC_ENV] = "env",
[FDTSRC_BLOBLIST] = "bloblist",
[FDTSRC_PASSAGE] = "passage",
};
const char *fdtdec_get_srcname(void)
@@ -1673,9 +1674,16 @@ int fdtdec_setup(void)
{
int ret;
/* The devicetree is typically appended to U-Boot */
if (CONFIG_IS_ENABLED(OF_PASSAGE)) {
printf("Previous phase failed to provide standard passage\n");
return -ENOENT;
if (!passage_valid()) {
printf("Previous phase failed to provide standard passage\n");
bloblist_show_list();
return -ENOENT;
}
gd->fdt_blob = map_sysmem(gd_passage_dtb(), 0);
gd->fdt_src = FDTSRC_PASSAGE;
log_debug("Devicetree is in bloblist at %p\n", gd->fdt_blob);
} else {
/* The devicetree is typically appended to U-Boot */
if (IS_ENABLED(CONFIG_OF_SEPARATE)) {