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@gmail.com>
Reviewed-on: http://review.coreboot.org/5156
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
Kyösti Mälkki 2014-01-26 14:41:54 +02:00
parent 972d5cf040
commit 5a5c886b8d
8 changed files with 18 additions and 21 deletions

View File

@ -25,19 +25,10 @@
#include <arch/stages.h> #include <arch/stages.h>
#include <cbfs.h> #include <cbfs.h>
#include <console/console.h> #include <console/console.h>
#include <smp/node.h>
#include "stages.c" #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) void main(void)
{ {
const char *stage_name = "fallback/romstage"; const char *stage_name = "fallback/romstage";

View File

@ -1,3 +1,4 @@
#include <smp/node.h>
#include <bootblock_common.h> #include <bootblock_common.h>
#include <pc80/mc146818rtc.h> #include <pc80/mc146818rtc.h>

View File

@ -1,3 +1,4 @@
#include <smp/node.h>
#include <bootblock_common.h> #include <bootblock_common.h>
static void main(unsigned long bist) static void main(unsigned long bist)

View File

@ -17,8 +17,10 @@
* MA 02110-1301 USA * MA 02110-1301 USA
*/ */
#include <smp/node.h>
#include <console/console.h> #include <console/console.h>
#include <console/vtxprintf.h> #include <console/vtxprintf.h>
#if CONFIG_CONSOLE_SERIAL8250 || CONFIG_CONSOLE_SERIAL8250MEM #if CONFIG_CONSOLE_SERIAL8250 || CONFIG_CONSOLE_SERIAL8250MEM
#include <uart8250.h> #include <uart8250.h>
#endif #endif
@ -31,9 +33,6 @@
#if CONFIG_SPKMODEM #if CONFIG_SPKMODEM
#include <console/spkmodem.h> #include <console/spkmodem.h>
#endif #endif
#if CONFIG_SQUELCH_EARLY_SMP
#include <cpu/x86/lapic.h>
#endif
void console_tx_byte(unsigned char byte) void console_tx_byte(unsigned char byte)
{ {

View File

@ -1,4 +1,4 @@
#include <cpu/x86/lapic.h> #include <smp/node.h>
#include <cpu/x86/msr.h> #include <cpu/x86/msr.h>
#if CONFIG_SMP #if CONFIG_SMP

View File

@ -4,6 +4,7 @@
#include <cpu/x86/lapic_def.h> #include <cpu/x86/lapic_def.h>
#include <cpu/x86/msr.h> #include <cpu/x86/msr.h>
#include <arch/hlt.h> #include <arch/hlt.h>
#include <smp/node.h>
/* See if I need to initialize the local apic */ /* See if I need to initialize the local apic */
#if CONFIG_SMP || CONFIG_IOAPIC #if CONFIG_SMP || CONFIG_IOAPIC
@ -153,10 +154,4 @@ int start_cpu(struct device *cpu);
#endif /* !__PRE_RAM__ */ #endif /* !__PRE_RAM__ */
#if CONFIG_SMP
int boot_cpu(void);
#else
#define boot_cpu(x) 1
#endif
#endif /* CPU_X86_LAPIC_H */ #endif /* CPU_X86_LAPIC_H */

10
src/include/smp/node.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef _SMP_NODE_H_
#define _SMP_NODE_H_
#if CONFIG_SMP
int boot_cpu(void);
#else
#define boot_cpu(x) 1
#endif
#endif /* _SMP_NODE_H_ */

View File

@ -23,7 +23,7 @@
#include <cbmem.h> #include <cbmem.h>
#include <timestamp.h> #include <timestamp.h>
#include <arch/early_variables.h> #include <arch/early_variables.h>
#include <cpu/x86/lapic.h> #include <smp/node.h>
#define MAX_TIMESTAMPS 30 #define MAX_TIMESTAMPS 30