diff options
author | Yinghai Lu <yinghailu@gmail.com> | 2006-05-18 17:02:17 +0000 |
---|---|---|
committer | Yinghai Lu <yinghailu@gmail.com> | 2006-05-18 17:02:17 +0000 |
commit | 9a8e36da2dcb67062c442795482095002587763f (patch) | |
tree | d07e15135ea20c9e19afa80655d2396194f5c1cd | |
parent | 2b396cdcf268c1c9865c51517461b031f8995917 (diff) |
init the ECC for BSP and AP at the same time. So reduce init cpus time
from 2.1x to 1.1x or from 4x(SERIAL_CPU_INIT) to 1.1x
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2309 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | src/cpu/x86/lapic/lapic_cpu_init.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c index 279101b74b..4b5acad2c4 100644 --- a/src/cpu/x86/lapic/lapic_cpu_init.c +++ b/src/cpu/x86/lapic/lapic_cpu_init.c @@ -123,8 +123,6 @@ static int lapic_start_cpu(unsigned long apicid) start_eip = (unsigned long)_secondary_start; #endif - printk_debug("start_eip=0x%08lx\n", start_eip); - num_starts = 2; /* @@ -299,9 +297,8 @@ void secondary_cpu_init(void) stop_this_cpu(); } -static void initialize_other_cpus(struct bus *cpu_bus) +static void start_other_cpus(struct bus *cpu_bus, device_t bsp_cpu) { - int old_active_count, active_count; device_t cpu; /* Loop through the cpus once getting them started */ @@ -309,6 +306,11 @@ static void initialize_other_cpus(struct bus *cpu_bus) if (cpu->path.type != DEVICE_PATH_APIC) { continue; } + #if SERIAL_CPU_INIT == 0 + if(cpu==bsp_cpu) { + continue; + } + #endif if (!cpu->enabled) { continue; @@ -330,6 +332,12 @@ static void initialize_other_cpus(struct bus *cpu_bus) #endif } +} + +static void wait_other_cpus_stop(struct bus *cpu_bus) +{ + device_t cpu; + int old_active_count, active_count; /* Now loop until the other cpus have finished initializing */ old_active_count = 1; active_count = atomic_read(&active_cpus); @@ -386,10 +394,26 @@ void initialize_cpus(struct bus *cpu_bus) copy_secondary_start_to_1m_below(); // why here? In case some day we can start core1 in amd_sibling_init #endif - /* Initialize the bootstrap processor */ - cpu_initialize(); +#if CONFIG_SMP == 1 + #if SERIAL_CPU_INIT == 0 + /* start all aps at first, so we can init ECC all together */ + start_other_cpus(cpu_bus, info->cpu); + #endif +#endif + + /* Initialize the bootstrap processor */ + cpu_initialize(); + + +#if CONFIG_SMP == 1 + #if SERIAL_CPU_INIT == 1 + /* start all aps */ + start_other_cpus(cpu_bus, info->cpu); + #endif + + /* Now wait the rest of the cpus stop*/ + wait_other_cpus_stop(cpu_bus); +#endif - /* Now initialize the rest of the cpus */ - initialize_other_cpus(cpu_bus); } |