X86: make the SIPI num_starts a config variable
The code to figure out how to set num_starts was starting to get kludgy. It's a constant for a given CPU; constants should be constant; make it a config variable. This change includes an example of how to override it. Build but not boot tested; drivers welcome. Change-Id: Iddd906a707bb16251615c7b42f2bfb5a044379b4 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/3796 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com> Reviewed-by: Bruce Griffith <Bruce.Griffith@se-eng.com>
This commit is contained in:
parent
4c2ebeba78
commit
b5e777c433
|
@ -48,6 +48,15 @@ config MAX_REBOOT_CNT
|
||||||
int
|
int
|
||||||
default 3
|
default 3
|
||||||
|
|
||||||
|
# This is something you almost certainly don't want to mess with.
|
||||||
|
# How many SIPIs do we send when starting up APs and cores?
|
||||||
|
# The answer in 2000 or so was '2'. Nowadays, on many systems,
|
||||||
|
# it is 1. Set a safe default here, and you can override it
|
||||||
|
# on reasonable platforms.
|
||||||
|
config NUM_IPI_STARTS
|
||||||
|
int
|
||||||
|
default 2
|
||||||
|
|
||||||
# We had to rename the choice options under arch/ because otherwise
|
# We had to rename the choice options under arch/ because otherwise
|
||||||
# the options would conflict between different architectures despite
|
# the options would conflict between different architectures despite
|
||||||
# the if ARCH_xxx guarding the arch/xxx/Kconfig sourcing.
|
# the if ARCH_xxx guarding the arch/xxx/Kconfig sourcing.
|
||||||
|
|
|
@ -8,6 +8,10 @@ config CPU_AMD_MODEL_10XXX
|
||||||
|
|
||||||
if CPU_AMD_MODEL_10XXX
|
if CPU_AMD_MODEL_10XXX
|
||||||
|
|
||||||
|
config NUM_IPI_STARTS
|
||||||
|
int
|
||||||
|
default 1
|
||||||
|
|
||||||
config CPU_ADDR_BITS
|
config CPU_ADDR_BITS
|
||||||
int
|
int
|
||||||
default 48
|
default 48
|
||||||
|
|
|
@ -101,7 +101,7 @@ static int lapic_start_cpu(unsigned long apicid)
|
||||||
{
|
{
|
||||||
int timeout;
|
int timeout;
|
||||||
unsigned long send_status, accept_status;
|
unsigned long send_status, accept_status;
|
||||||
int j, num_starts, maxlvt;
|
int j, maxlvt;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Starting actual IPI sequence...
|
* Starting actual IPI sequence...
|
||||||
|
@ -167,20 +167,14 @@ static int lapic_start_cpu(unsigned long apicid)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !CONFIG_CPU_AMD_MODEL_10XXX
|
|
||||||
num_starts = 2;
|
|
||||||
#else
|
|
||||||
num_starts = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Run STARTUP IPI loop.
|
* Run STARTUP IPI loop.
|
||||||
*/
|
*/
|
||||||
printk(BIOS_SPEW, "#startup loops: %d.\n", num_starts);
|
printk(BIOS_SPEW, "#startup loops: %d.\n", CONFIG_NUM_IPI_STARTS);
|
||||||
|
|
||||||
maxlvt = 4;
|
maxlvt = 4;
|
||||||
|
|
||||||
for (j = 1; j <= num_starts; j++) {
|
for (j = 1; j <= CONFIG_NUM_IPI_STARTS; j++) {
|
||||||
printk(BIOS_SPEW, "Sending STARTUP #%d to %lu.\n", j, apicid);
|
printk(BIOS_SPEW, "Sending STARTUP #%d to %lu.\n", j, apicid);
|
||||||
lapic_read_around(LAPIC_SPIV);
|
lapic_read_around(LAPIC_SPIV);
|
||||||
lapic_write(LAPIC_ESR, 0);
|
lapic_write(LAPIC_ESR, 0);
|
||||||
|
|
Loading…
Reference in New Issue