diff options
author | Simon Glass <sjg@chromium.org> | 2021-12-16 20:59:34 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-12-23 10:24:40 -0500 |
commit | ff66e7bb73233a4decfcdb66b7a858399dbccf50 (patch) | |
tree | 130deb1f3ddb5d1436e8fc57ff4fe8e98068dd1f /lib/fdtdec.c | |
parent | 39605c6ec3618a848a4a1c4063d474270deab442 (diff) | |
download | u-boot-ff66e7bb73233a4decfcdb66b7a858399dbccf50.tar.gz |
fdt: Report the devicetree source
It can be confusing to figure out where the devicetree came from. It seems
important enough to warrant a message during boot. Add information about
the number of devices and uclasses too since it is helpful to have some
idea what is going on with driver model.
Report the devicetree source in bdinfo too.
This looks something like this, with > marking the new line.
U-Boot 2021.10-00190 (Oct 30 2021 - 09:01:29 -0600)
DRAM: 128 MiB
> Core: 42 devices, 11 uclasses, devicetree: passage
Flash: 64 MiB
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r-- | lib/fdtdec.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 8cfa958fb96..118c100b389 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -76,6 +76,19 @@ static const char * const compat_names[COMPAT_COUNT] = { COMPAT(ALTERA_SOCFPGA_CLK_INIT, "altr,socfpga-a10-clk-init") }; +static const char *const fdt_src_name[] = { + [FDTSRC_SEPARATE] = "separate", + [FDTSRC_FIT] = "fit", + [FDTSRC_BOARD] = "board", + [FDTSRC_EMBED] = "embed", + [FDTSRC_ENV] = "env", +}; + +const char *fdtdec_get_srcname(void) +{ + return fdt_src_name[gd->fdt_src]; +} + const char *fdtdec_get_compatible(enum fdt_compat_id id) { /* We allow reading of the 'unknown' ID for testing purposes */ |