[PATCH 4/8] Revert "fdt: Allow the devicetree to come from a bloblist"
Simon Glass
sjg at chromium.org
Sun Dec 1 15:42:32 CET 2024
This stops coral, bob and kevin from booting.
The correct way to do this was always to use a Kconfig option, so let's
first revert this broken idea.
This reverts commit 70fe23859437ffe4efe0793423937d8b78ebf9d6.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
doc/develop/devicetree/control.rst | 5 +---
include/fdtdec.h | 6 ++--
lib/fdtdec.c | 45 +++++++-----------------------
3 files changed, 13 insertions(+), 43 deletions(-)
diff --git a/doc/develop/devicetree/control.rst b/doc/develop/devicetree/control.rst
index 0233945f8b6..2a3b48fa6c7 100644
--- a/doc/develop/devicetree/control.rst
+++ b/doc/develop/devicetree/control.rst
@@ -137,10 +137,7 @@ If `OF_BOARD` is selected by Kconfig, a board-specific routine will provide the
devicetree at runtime, for example if an earlier bootloader stage creates
it and passes it to U-Boot.
-If `BLOBLIST` is selected by Kconfig, the devicetree may come from a bloblist
-passed from a previous stage, if present.
-
-If `SANDBOX` is selected by Kconfig, then it will be read from a file on
+If CONFIG_SANDBOX is defined, then it will be read from a file on
startup. Use the -d flag to U-Boot to specify the file to read, -D for the
default and -T for the test devicetree, used to run sandbox unit tests.
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 555c9520379..8f25e1b7e92 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -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_NONE: No devicetree at all
*/
enum fdt_source_t {
FDTSRC_SEPARATE,
@@ -80,7 +80,6 @@ enum fdt_source_t {
FDTSRC_BOARD,
FDTSRC_EMBED,
FDTSRC_ENV,
- FDTSRC_BLOBLIST,
};
/*
@@ -1191,8 +1190,7 @@ int fdtdec_resetup(int *rescan);
*
* The existing devicetree is available at gd->fdt_blob
*
- * @err: 0 on success, -EEXIST if the devicetree is already correct, or other
- * internal error code if we fail to setup a DTB
+ * @err internal error code if we fail to setup a DTB
* @returns new devicetree blob pointer
*/
void *board_fdt_blob_setup(int *err);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 1842da62f37..d36b01bd3f1 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -7,10 +7,6 @@
*/
#ifndef USE_HOSTCC
-
-#define LOG_CATEGORY LOGC_DT
-
-#include <bloblist.h>
#include <boot_fit.h>
#include <display_options.h>
#include <dm.h>
@@ -90,7 +86,6 @@ static const char *const fdt_src_name[] = {
[FDTSRC_BOARD] = "board",
[FDTSRC_EMBED] = "embed",
[FDTSRC_ENV] = "env",
- [FDTSRC_BLOBLIST] = "bloblist",
};
const char *fdtdec_get_srcname(void)
@@ -1666,43 +1661,23 @@ static void setup_multi_dtb_fit(void)
int fdtdec_setup(void)
{
- int ret = -ENOENT;
-
- /* If allowing a bloblist, check that first */
- if (CONFIG_IS_ENABLED(BLOBLIST)) {
- ret = bloblist_maybe_init();
- if (!ret) {
- gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
- if (gd->fdt_blob) {
- gd->fdt_src = FDTSRC_BLOBLIST;
- log_debug("Devicetree is in bloblist at %p\n",
- gd->fdt_blob);
- ret = 0;
- } else {
- log_debug("No FDT found in bloblist\n");
- ret = -ENOENT;
- }
- }
- }
+ int ret;
- /* Otherwise, the devicetree is typically appended to U-Boot */
- if (ret) {
- if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
- gd->fdt_blob = fdt_find_separate();
- gd->fdt_src = FDTSRC_SEPARATE;
- } else { /* embed dtb in ELF file for testing / development */
- gd->fdt_blob = dtb_dt_embedded();
- gd->fdt_src = FDTSRC_EMBED;
- }
+ /* The devicetree is typically appended to U-Boot */
+ if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
+ gd->fdt_blob = fdt_find_separate();
+ gd->fdt_src = FDTSRC_SEPARATE;
+ } else { /* embed dtb in ELF file for testing / development */
+ gd->fdt_blob = dtb_dt_embedded();
+ gd->fdt_src = FDTSRC_EMBED;
}
/* Allow the board to override the fdt address. */
if (IS_ENABLED(CONFIG_OF_BOARD)) {
gd->fdt_blob = board_fdt_blob_setup(&ret);
- if (!ret)
- gd->fdt_src = FDTSRC_BOARD;
- else if (ret != -EEXIST)
+ if (ret)
return ret;
+ gd->fdt_src = FDTSRC_BOARD;
}
/* Allow the early environment to override the fdt address */
--
2.43.0
More information about the U-Boot
mailing list