summaryrefslogtreecommitdiff
path: root/common/board_r.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-12-16 20:59:34 -0700
committerTom Rini <trini@konsulko.com>2021-12-23 10:24:40 -0500
commitff66e7bb73233a4decfcdb66b7a858399dbccf50 (patch)
tree130deb1f3ddb5d1436e8fc57ff4fe8e98068dd1f /common/board_r.c
parent39605c6ec3618a848a4a1c4063d474270deab442 (diff)
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 'common/board_r.c')
-rw-r--r--common/board_r.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/board_r.c b/common/board_r.c
index 31a59c585a..99adff14b3 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -586,6 +586,23 @@ int initr_mem(void)
}
#endif
+static int dm_announce(void)
+{
+ int device_count;
+ int uclass_count;
+
+ if (IS_ENABLED(CONFIG_DM)) {
+ dm_get_stats(&device_count, &uclass_count);
+ printf("Core: %d devices, %d uclasses", device_count,
+ uclass_count);
+ if (CONFIG_IS_ENABLED(OF_REAL))
+ printf(", devicetree: %s", fdtdec_get_srcname());
+ printf("\n");
+ }
+
+ return 0;
+}
+
static int run_main_loop(void)
{
#ifdef CONFIG_SANDBOX
@@ -661,6 +678,7 @@ static init_fnc_t init_sequence_r[] = {
stdio_init_tables,
serial_initialize,
initr_announce,
+ dm_announce,
#if CONFIG_IS_ENABLED(WDT)
initr_watchdog,
#endif