Pass the CPU index as a parameter to startup.

This addition is in support of future multicore support in
coreboot. It also will allow us to remove some asssembly code.

The CPU "index" -- i.e., its order in the sequence in which
cores are brought up, NOT its APIC id -- is passed into the
secondary start. We modify the function to specify regparm(0).
We also take this opportunity to do some cleanup:
indexes become unsigned ints, not unsigned longs, for example.

Build and boot on a multicore system, with pcserial enabled.

Capture the output. Observe that the messages
Initializing CPU #0
Initializing CPU #1
Initializing CPU #2
Initializing CPU #3
appear exactly as they do prior to this change.

Change-Id: I5854d8d957c414f75fdd63fb017d2249330f955d
Signed-off-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-on: http://review.coreboot.org/1820
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Ronald G. Minnich
2012-06-05 14:41:27 -07:00
committed by Stefan Reinauer
parent 455f4b4328
commit 8b93059ecc
5 changed files with 18 additions and 14 deletions

View File

@@ -160,7 +160,7 @@ struct cpu_driver *find_cpu_driver(struct device *cpu);
struct cpu_info {
device_t cpu;
unsigned long index;
unsigned int index;
};
static inline struct cpu_info *cpu_info(void)

View File

@@ -234,7 +234,7 @@ static void set_cpu_ops(struct device *cpu)
cpu->ops = driver ? driver->ops : NULL;
}
void cpu_initialize(void)
void cpu_initialize(unsigned int index)
{
/* Because we busy wait at the printk spinlock.
* It is important to keep the number of printed messages
@@ -247,7 +247,7 @@ void cpu_initialize(void)
info = cpu_info();
printk(BIOS_INFO, "Initializing CPU #%ld\n", info->index);
printk(BIOS_INFO, "Initializing CPU #%d\n", index);
cpu = info->cpu;
if (!cpu) {
@@ -284,7 +284,7 @@ void cpu_initialize(void)
cpu->ops->init(cpu);
}
printk(BIOS_INFO, "CPU #%ld initialized\n", info->index);
printk(BIOS_INFO, "CPU #%d initialized\n", index);
return;
}