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:
@@ -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,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
14
lib/fdtdec.c
14
lib/fdtdec.c
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user