[coreboot-gerrit] New patch to review for coreboot: 4f97ff8 SMP: Add arch-agnostic boot_cpu()

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Thu Feb 6 15:07:52 CET 2014


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5156

-gerrit

commit 4f97ff8dd8f29d0d2a6046762f349ffc423b74d4
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Sun Jan 26 14:41:54 2014 +0200

    SMP: Add arch-agnostic boot_cpu()
    
    We should not have x86 specific includes in lib/.
    
    Change-Id: I18fa9c8017d65c166ffd465038d71f35b30d6f3d
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/arch/armv7/bootblock_simple.c   | 11 +----------
 src/arch/x86/lib/romstage_console.c |  5 ++---
 src/include/cpu/x86/lapic.h         |  7 +------
 src/include/smp/node.h              | 10 ++++++++++
 src/lib/timestamp.c                 |  2 +-
 5 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/src/arch/armv7/bootblock_simple.c b/src/arch/armv7/bootblock_simple.c
index 6ed63ce..2c8e053 100644
--- a/src/arch/armv7/bootblock_simple.c
+++ b/src/arch/armv7/bootblock_simple.c
@@ -25,19 +25,10 @@
 #include <arch/stages.h>
 #include <cbfs.h>
 #include <console/console.h>
+#include <smp/node.h>
 
 #include "stages.c"
 
-static int boot_cpu(void)
-{
-	/*
-	 * FIXME: This is a stub for now. All non-boot CPUs should be
-	 * waiting for an interrupt. We could move the chunk of assembly
-	 * which puts them to sleep in here...
-	 */
-	return 1;
-}
-
 void main(void)
 {
 	const char *stage_name = "fallback/romstage";
diff --git a/src/arch/x86/lib/romstage_console.c b/src/arch/x86/lib/romstage_console.c
index 0eb3dc2..68b10eb 100644
--- a/src/arch/x86/lib/romstage_console.c
+++ b/src/arch/x86/lib/romstage_console.c
@@ -17,8 +17,10 @@
  * MA 02110-1301 USA
  */
 
+#include <smp/node.h>
 #include <console/console.h>
 #include <console/vtxprintf.h>
+
 #if CONFIG_CONSOLE_SERIAL8250 || CONFIG_CONSOLE_SERIAL8250MEM
 #include <uart8250.h>
 #endif
@@ -31,9 +33,6 @@
 #if CONFIG_SPKMODEM
 #include <console/spkmodem.h>
 #endif
-#if CONFIG_SQUELCH_EARLY_SMP
-#include <cpu/x86/lapic.h>
-#endif
 
 void console_tx_byte(unsigned char byte)
 {
diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h
index 96b5891..3d5046e 100644
--- a/src/include/cpu/x86/lapic.h
+++ b/src/include/cpu/x86/lapic.h
@@ -4,6 +4,7 @@
 #include <cpu/x86/lapic_def.h>
 #include <cpu/x86/msr.h>
 #include <arch/hlt.h>
+#include <smp/node.h>
 
 /* See if I need to initialize the local apic */
 #if CONFIG_SMP || CONFIG_IOAPIC
@@ -153,10 +154,4 @@ int start_cpu(struct device *cpu);
 
 #endif /* !__PRE_RAM__ */
 
-#if CONFIG_SMP
-int boot_cpu(void);
-#else
-#define boot_cpu(x) 1
-#endif
-
 #endif /* CPU_X86_LAPIC_H */
diff --git a/src/include/smp/node.h b/src/include/smp/node.h
new file mode 100644
index 0000000..9d04bda
--- /dev/null
+++ b/src/include/smp/node.h
@@ -0,0 +1,10 @@
+#ifndef _SMP_NODE_H_
+#define _SMP_NODE_H_
+
+#if CONFIG_SMP
+int boot_cpu(void);
+#else
+#define boot_cpu() 1
+#endif
+
+#endif /* _SMP_NODE_H_ */
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 678f38e..f0ee48d 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -23,7 +23,7 @@
 #include <cbmem.h>
 #include <timestamp.h>
 #include <arch/early_variables.h>
-#include <cpu/x86/lapic.h>
+#include <smp/node.h>
 
 #define MAX_TIMESTAMPS 30
 



More information about the coreboot-gerrit mailing list