aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-12-16 20:59:39 -0700
committerTom Rini <trini@konsulko.com>2021-12-23 11:19:42 -0500
commit93233b07d08955dafdc8a7d2ef692d8b3facc439 (patch)
tree438633721f07a5a294ed5f2c583d44a13832c198 /common
parentb7d8e85b4c4eb2c5e6f5596772e4fafb0eb6e095 (diff)
downloadu-boot-93233b07d08955dafdc8a7d2ef692d8b3facc439.zip
u-boot-93233b07d08955dafdc8a7d2ef692d8b3facc439.tar.gz
u-boot-93233b07d08955dafdc8a7d2ef692d8b3facc439.tar.bz2
fdt: Show a runtime warning based on devicetree sourceWIP/2021-12-23-make-OF_BOARD-a-boolean
When running, if the devicetree failed to come from the expected source, show a warning, e.g: U-Boot ... DRAM: 128 MiB Core: 42 devices, 11 uclasses, devicetree: separate Warning: Unexpected devicetree source (not from a prior stage) Warning: U-Boot may not function properly Flash: 64 MiB ... These warnings should only appear if the board config has been changed, or the prior stage is broken. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/board_r.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/board_r.c b/common/board_r.c
index 99adff1..6d52066 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -598,6 +598,12 @@ static int dm_announce(void)
if (CONFIG_IS_ENABLED(OF_REAL))
printf(", devicetree: %s", fdtdec_get_srcname());
printf("\n");
+ if (IS_ENABLED(CONFIG_OF_HAS_PRIOR_STAGE) &&
+ (gd->fdt_src == FDTSRC_SEPARATE ||
+ gd->fdt_src == FDTSRC_EMBED)) {
+ printf("Warning: Unexpected devicetree source (not from a prior stage)");
+ printf("Warning: U-Boot may not function properly\n");
+ }
}
return 0;