powerpc: Make boot_cpuid common between 32 and 64-bit

Move the definition to setup-common.c and set the init value
to -1 on both 32 and 64-bit (it was 0 on 64-bit).

Additionally add a check to prom.c to garantee that the init
value has been udpated after the DT scan.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 4a85b31d
...@@ -747,6 +747,10 @@ void __init early_init_devtree(void *params) ...@@ -747,6 +747,10 @@ void __init early_init_devtree(void *params)
* (altivec support, boot CPU ID, ...) * (altivec support, boot CPU ID, ...)
*/ */
of_scan_flat_dt(early_init_dt_scan_cpus, NULL); of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
if (boot_cpuid < 0) {
printk("Failed to indentify boot CPU !\n");
BUG();
}
#if defined(CONFIG_SMP) && defined(CONFIG_PPC64) #if defined(CONFIG_SMP) && defined(CONFIG_PPC64)
/* We'll later wait for secondaries to check in; there are /* We'll later wait for secondaries to check in; there are
......
...@@ -76,6 +76,9 @@ EXPORT_SYMBOL(ppc_md); ...@@ -76,6 +76,9 @@ EXPORT_SYMBOL(ppc_md);
struct machdep_calls *machine_id; struct machdep_calls *machine_id;
EXPORT_SYMBOL(machine_id); EXPORT_SYMBOL(machine_id);
int boot_cpuid = -1;
EXPORT_SYMBOL_GPL(boot_cpuid);
unsigned long klimit = (unsigned long) _end; unsigned long klimit = (unsigned long) _end;
char cmd_line[COMMAND_LINE_SIZE]; char cmd_line[COMMAND_LINE_SIZE];
......
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
extern void bootx_init(unsigned long r4, unsigned long phys); extern void bootx_init(unsigned long r4, unsigned long phys);
int boot_cpuid = -1;
EXPORT_SYMBOL_GPL(boot_cpuid);
int boot_cpuid_phys; int boot_cpuid_phys;
EXPORT_SYMBOL_GPL(boot_cpuid_phys); EXPORT_SYMBOL_GPL(boot_cpuid_phys);
......
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
#define DBG(fmt...) #define DBG(fmt...)
#endif #endif
int boot_cpuid = 0;
int spinning_secondaries; int spinning_secondaries;
u64 ppc64_pft_size; u64 ppc64_pft_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment