Bootblock does not need a unique boot_cpu()
authorKyösti Mälkki <kyosti.malkki@gmail.com>
Tue, 22 Nov 2011 17:44:45 +0000 (19:44 +0200)
committerPatrick Georgi <patrick@georgi-clan.de>
Mon, 5 Dec 2011 11:20:43 +0000 (12:20 +0100)
Detection of a CPU being a BSP CPU is not dependent of the existence
of northbridge and/or southbridge init code in the bootblock.

Even if CONFIG_LOGICAL_CPUS==0, boot_cpu() can get executed on an AP
CPU of a hyper-threading CPU and needs to return actual BSP bit from
MSR.

Change-Id: I9187f954bb357ba1dbd459cfe11cc96cb7567968
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/447
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
src/arch/x86/include/bootblock_common.h
src/cpu/x86/lapic/boot_cpu.c

index 4c4a092e0c87a7cdf095fe2c0cc1391aca72fbd4..bd1968202f5ba217191048ac3103269627a02ec6 100644 (file)
@@ -1,9 +1,4 @@
-#if CONFIG_LOGICAL_CPUS && \
- (defined(CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT) || defined(CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT))
 #include <cpu/x86/lapic/boot_cpu.c>
-#else
-#define boot_cpu(x) 1
-#endif
 
 #ifdef CONFIG_BOOTBLOCK_CPU_INIT
 #include CONFIG_BOOTBLOCK_CPU_INIT
index bca73e137ef38b03988204259f3330f275e74a2f..87418d0883ac076f064679e4436bd1bc8354bb29 100644 (file)
@@ -1,5 +1,6 @@
 #include <cpu/x86/msr.h>
 
+#if CONFIG_SMP
 static int boot_cpu(void)
 {
        int bsp;
@@ -8,3 +9,7 @@ static int boot_cpu(void)
        bsp = !!(msr.lo & (1 << 8));
        return bsp;
 }
+#else
+#define boot_cpu(x) 1
+#endif
+