]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: cpu: Use default print_cpuinfo() for all
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 5 Oct 2024 19:11:57 +0000 (22:11 +0300)
committerSimon Glass <sjg@chromium.org>
Fri, 18 Oct 2024 20:10:22 +0000 (14:10 -0600)
Most of the copies of the print_cpuinfo() call the default method.
Remove all of those in order to have only the default one when
no `cpu` command is compiled.

This also helps avoiding compiler warning, e.g.:

  arch/x86/cpu/tangier/tangier.c:23:5: warning: no previous prototype for ‘print_cpuinfo’ [-Wmissing-prototypes]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/x86/cpu/broadwell/cpu.c
arch/x86/cpu/coreboot/coreboot.c
arch/x86/cpu/cpu.c
arch/x86/cpu/ivybridge/cpu.c
arch/x86/cpu/qemu/qemu.c
arch/x86/cpu/quark/quark.c
arch/x86/cpu/x86_64/misc.c
arch/x86/include/asm/u-boot-x86.h
arch/x86/lib/fsp/fsp_common.c

index 87463748c4de8a172a8a1e89a9140ea1dca17783..8127d31e57ed9b914520c1111d1dbcd0a8f78b08 100644 (file)
@@ -88,18 +88,6 @@ int checkcpu(void)
        return 0;
 }
 
-int print_cpuinfo(void)
-{
-       char processor_name[CPU_MAX_NAME_LEN];
-       const char *name;
-
-       /* Print processor name */
-       name = cpu_get_name(processor_name);
-       printf("CPU:   %s\n", name);
-
-       return 0;
-}
-
 void board_debug_uart_init(void)
 {
        /* com1 / com2 decode range */
index b15715c935d6d060fa1b49b8e7e8ea22a295864b..fa7430b436f9d2a8641b4f33b2eecebc675f060b 100644 (file)
@@ -38,11 +38,6 @@ int arch_cpu_init(void)
        return 0;
 }
 
-int checkcpu(void)
-{
-       return 0;
-}
-
 static void board_final_init(void)
 {
        /*
index f8549e320923cb4b46aef7737d717c5548a66815..40dd5ecb107a1c7e99e6c425ecf1884a9adfa366 100644 (file)
@@ -163,10 +163,11 @@ char *cpu_get_name(char *name)
        return ptr;
 }
 
-int print_cpuinfo(void) __attribute__((weak, alias("default_print_cpuinfo")));
-
-int default_print_cpuinfo(void)
+#if !CONFIG_IS_ENABLED(CPU)
+int print_cpuinfo(void)
 {
+       post_code(POST_CPU_INFO);
+
        printf("CPU: %s, vendor %s, device %xh\n",
               cpu_has_64bit() ? "x86_64" : "x86",
               cpu_vendor_name(gd->arch.x86_vendor), gd->arch.x86_device);
@@ -178,6 +179,7 @@ int default_print_cpuinfo(void)
 
        return 0;
 }
+#endif
 
 #if CONFIG_IS_ENABLED(SHOW_BOOT_PROGRESS)
 void show_boot_progress(int val)
index 05691a38d2e8b8c3c547d6fe23be990609e25770..d299068a87969bd5fd988099383ef3fc89eccccc 100644 (file)
@@ -182,20 +182,6 @@ int checkcpu(void)
        return 0;
 }
 
-int print_cpuinfo(void)
-{
-       char processor_name[CPU_MAX_NAME_LEN];
-       const char *name;
-
-       /* Print processor name */
-       name = cpu_get_name(processor_name);
-       printf("CPU:   %s\n", name);
-
-       post_code(POST_CPU_INFO);
-
-       return 0;
-}
-
 void board_debug_uart_init(void)
 {
        /* This enables the debug UART */
index 262584d01f0fff79ad379c010973272720c219e1..563f63e2bc81148512b0190d720aabcc501bb120 100644 (file)
@@ -109,12 +109,6 @@ int checkcpu(void)
 {
        return 0;
 }
-
-int print_cpuinfo(void)
-{
-       post_code(POST_CPU_INFO);
-       return default_print_cpuinfo();
-}
 #endif
 
 int arch_early_init_r(void)
index fdf92b2c0c3a5b42216b299ab0ac925149161de7..07504faaffb78392c09122a67955139db056dac2 100644 (file)
@@ -266,12 +266,6 @@ int checkcpu(void)
        return 0;
 }
 
-int print_cpuinfo(void)
-{
-       post_code(POST_CPU_INFO);
-       return default_print_cpuinfo();
-}
-
 static void quark_pcie_init(void)
 {
        u32 val;
index 294511e6ebabadf6460b6f9096a14d6a8391c710..fc449ca4ed6742aa24cd16bf21e157eea3612f10 100644 (file)
@@ -32,9 +32,4 @@ int checkcpu(void)
 {
        return 0;
 }
-
-int print_cpuinfo(void)
-{
-       return 0;
-}
 #endif
index 64139ead190c66512290a8f099625e3e8c6e038a..ed2f6aa38935cf26779bbd20a836be94287ce7fe 100644 (file)
@@ -95,7 +95,6 @@ void x86_enable_caches(void);
 void x86_disable_caches(void);
 int x86_init_cache(void);
 phys_addr_t board_get_usable_ram_top(phys_size_t total_size);
-int default_print_cpuinfo(void);
 
 /* Set up a UART which can be used with printch(), printhex8(), etc. */
 int setup_internal_uart(int enable);
index c47e6ca473881c0ea649601ed59f8f75f039dc78..7e4c14766347e4ddeadc4a8f117fb68d45071357 100644 (file)
@@ -26,12 +26,6 @@ int checkcpu(void)
        return 0;
 }
 
-int print_cpuinfo(void)
-{
-       post_code(POST_CPU_INFO);
-       return default_print_cpuinfo();
-}
-
 int fsp_init_phase_pci(void)
 {
        u32 status;