x86: Make show_boot_progress() common
authorSimon Glass <sjg@chromium.org>
Thu, 13 Nov 2014 05:42:26 +0000 (22:42 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 21 Nov 2014 06:34:15 +0000 (07:34 +0100)
This function can probably be used on all x86 boards, so move it into the
common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/x86/cpu/coreboot/coreboot.c
arch/x86/cpu/cpu.c

index 33561212dcaa71d6408b05e6985619f7ffbccae9..2df72884f9232cb8203fb1f308f56829d58b1168 100644 (file)
@@ -15,7 +15,6 @@
 #include <asm/cache.h>
 #include <asm/cpu.h>
 #include <asm/io.h>
-#include <asm/post.h>
 #include <asm/arch/tables.h>
 #include <asm/arch/sysinfo.h>
 #include <asm/arch/timestamp.h>
@@ -51,29 +50,6 @@ int board_early_init_r(void)
        return 0;
 }
 
-void show_boot_progress(int val)
-{
-#if MIN_PORT80_KCLOCKS_DELAY
-       /*
-        * Scale the time counter reading to avoid using 64 bit arithmetics.
-        * Can't use get_timer() here becuase it could be not yet
-        * initialized or even implemented.
-        */
-       if (!gd->arch.tsc_prev) {
-               gd->arch.tsc_base_kclocks = rdtsc() / 1000;
-               gd->arch.tsc_prev = 0;
-       } else {
-               uint32_t now;
-
-               do {
-                       now = rdtsc() / 1000 - gd->arch.tsc_base_kclocks;
-               } while (now < (gd->arch.tsc_prev + MIN_PORT80_KCLOCKS_DELAY));
-               gd->arch.tsc_prev = now;
-       }
-#endif
-       outb(val, POST_PORT);
-}
-
 int print_cpuinfo(void)
 {
        return default_print_cpuinfo();
index 97c77ba161045ac86d9030356f8f94185e69d3f1..b391b7ade47298336bb9042c9b3cbb8f2bebde14 100644 (file)
@@ -25,6 +25,7 @@
 #include <malloc.h>
 #include <asm/control_regs.h>
 #include <asm/cpu.h>
+#include <asm/post.h>
 #include <asm/processor.h>
 #include <asm/processor-flags.h>
 #include <asm/interrupt.h>
@@ -567,3 +568,26 @@ int cpu_jump_to_64bit(ulong setup_base, ulong target)
 
        return -EFAULT;
 }
+
+void show_boot_progress(int val)
+{
+#if MIN_PORT80_KCLOCKS_DELAY
+       /*
+        * Scale the time counter reading to avoid using 64 bit arithmetics.
+        * Can't use get_timer() here becuase it could be not yet
+        * initialized or even implemented.
+        */
+       if (!gd->arch.tsc_prev) {
+               gd->arch.tsc_base_kclocks = rdtsc() / 1000;
+               gd->arch.tsc_prev = 0;
+       } else {
+               uint32_t now;
+
+               do {
+                       now = rdtsc() / 1000 - gd->arch.tsc_base_kclocks;
+               } while (now < (gd->arch.tsc_prev + MIN_PORT80_KCLOCKS_DELAY));
+               gd->arch.tsc_prev = now;
+       }
+#endif
+       outb(val, POST_PORT);
+}