[PATCH v3 04/13] x86: Add a few more items to bdinfo

Simon Glass sjg at chromium.org
Fri Mar 10 21:47:14 CET 2023


Add the timer and vendor/model information.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v3:
- Show the CPU vendor name also

 arch/x86/lib/bdinfo.c | 6 ++++++
 cmd/bdinfo.c          | 5 +++++
 include/init.h        | 3 +++
 3 files changed, 14 insertions(+)

diff --git a/arch/x86/lib/bdinfo.c b/arch/x86/lib/bdinfo.c
index 0cb79b01bd3..15390070fe8 100644
--- a/arch/x86/lib/bdinfo.c
+++ b/arch/x86/lib/bdinfo.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <efi.h>
 #include <init.h>
+#include <asm/cpu.h>
 #include <asm/efi.h>
 #include <asm/global_data.h>
 
@@ -16,6 +17,11 @@ DECLARE_GLOBAL_DATA_PTR;
 void arch_print_bdinfo(void)
 {
 	bdinfo_print_num_l("prev table", gd->arch.table);
+	bdinfo_print_num_l("clock_rate", gd->arch.clock_rate);
+	bdinfo_print_num_l("tsc_base", gd->arch.tsc_base);
+	bdinfo_print_num_l("vendor", gd->arch.x86_vendor);
+	bdinfo_print_str(" name", cpu_vendor_name(gd->arch.x86_vendor));
+	bdinfo_print_num_l("model", gd->arch.x86_model);
 
 	if (IS_ENABLED(CONFIG_EFI_STUB))
 		efi_show_bdinfo();
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index bf002f84475..8ae7fb35fe9 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -26,6 +26,11 @@ void bdinfo_print_size(const char *name, uint64_t size)
 	print_size(size, "\n");
 }
 
+void bdinfo_print_str(const char *name, const char *str)
+{
+	printf("%-12s= %s\n", name, str);
+}
+
 void bdinfo_print_num_l(const char *name, ulong value)
 {
 	printf("%-12s= 0x%0*lx\n", name, 2 * (int)sizeof(value), value);
diff --git a/include/init.h b/include/init.h
index 699dc2482c0..88730816851 100644
--- a/include/init.h
+++ b/include/init.h
@@ -353,6 +353,9 @@ void relocate_code(ulong start_addr_sp, struct global_data *new_gd,
 void bdinfo_print_num_l(const char *name, ulong value);
 void bdinfo_print_num_ll(const char *name, unsigned long long value);
 
+/* Print a string value (for use in arch_print_bdinfo()) */
+void bdinfo_print_str(const char *name, const char *str);
+
 /* Print a clock speed in MHz */
 void bdinfo_print_mhz(const char *name, unsigned long hz);
 
-- 
2.40.0.rc1.284.g88254d51c5-goog



More information about the U-Boot mailing list