diff options
author | Mario Six <mario.six@gdsys.cc> | 2018-08-06 10:23:41 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-11-14 09:16:27 -0800 |
commit | 5d6c61ac404c5c7c463ea6ee216145f29a603f60 (patch) | |
tree | b6df389996f0550fcf271563eaf2d5e9d1f8deee /common | |
parent | 208ecbad2ea83333e8f3c9933213867addf16f4a (diff) |
board_f: Use static print_cpuinfo if CONFIG_CPU is active
When the DM CPU drivers are active, printing information about a CPU
should be delegated to a matching driver.
Hence, add a static print_cpuinfo that implements this delegation when
DM CPU drivers are active.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Changed condition to CONFIG_IS_ENABLED(CPU):
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/board_f.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c index afafec5e4d..213d044066 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -11,6 +11,7 @@ #include <common.h> #include <console.h> +#include <cpu.h> #include <dm.h> #include <environment.h> #include <fdtdec.h> @@ -165,6 +166,33 @@ static int print_resetinfo(void) } #endif +#if defined(CONFIG_DISPLAY_CPUINFO) && CONFIG_IS_ENABLED(CPU) +static int print_cpuinfo(void) +{ + struct udevice *dev; + char desc[512]; + int ret; + + ret = uclass_first_device_err(UCLASS_CPU, &dev); + if (ret) { + debug("%s: Could not get CPU device (err = %d)\n", + __func__, ret); + return ret; + } + + ret = cpu_get_desc(dev, desc, sizeof(desc)); + if (ret) { + debug("%s: Could not get CPU description (err = %d)\n", + dev->name, ret); + return ret; + } + + printf("%s", desc); + + return 0; +} +#endif + static int announce_dram_init(void) { puts("DRAM: "); |