summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/board_f.c28
-rw-r--r--include/init.h7
2 files changed, 35 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: ");
diff --git a/include/init.h b/include/init.h
index a58d7a6917..afc953d51e 100644
--- a/include/init.h
+++ b/include/init.h
@@ -109,7 +109,14 @@ int arch_reserve_stacks(void);
*/
int init_cache_f_r(void);
+#if !CONFIG_IS_ENABLED(CPU)
+/**
+ * print_cpuinfo() - Display information about the CPU
+ *
+ * Return: 0 if OK, -ve on error
+ */
int print_cpuinfo(void);
+#endif
int timer_init(void);
int reserve_mmu(void);
int misc_init_f(void);