unsigned long secondary_hold
= virt_to_abs(*PTRRELOC((unsigned long *)__secondary_hold));
struct systemcfg *_systemcfg = RELOC(systemcfg);
- struct paca_struct *lpaca = PTRRELOC(&paca[0]);
struct prom_t *_prom = PTRRELOC(&prom);
#ifdef CONFIG_SMP
struct naca_struct *_naca = RELOC(naca);
#endif
- /* On pmac, we just fill out the various global bitmasks and
- * arrays indicating our CPUs are here, they are actually started
- * later on from pmac_smp
- */
- if (_systemcfg->platform == PLATFORM_POWERMAC) {
- for (node = 0; prom_next_node(&node); ) {
- type[0] = 0;
- prom_getprop(node, "device_type", type, sizeof(type));
- if (strcmp(type, RELOC("cpu")) != 0)
- continue;
- reg = -1;
- prom_getprop(node, "reg", ®, sizeof(reg));
- lpaca[cpuid].hw_cpu_id = reg;
-
- cpuid++;
- }
- return;
- }
-
prom_debug("prom_hold_cpus: start...\n");
prom_debug(" 1) spinloop = 0x%x\n", (unsigned long)spinloop);
prom_debug(" 1) *spinloop = 0x%x\n", *spinloop);
prom_debug("\ncpuid = 0x%x\n", cpuid);
prom_debug("cpu hw idx = 0x%x\n", reg);
- lpaca[cpuid].hw_cpu_id = reg;
/* Init the acknowledge var which will be reset by
* the secondary cpu when it awakens from its OF
cpuid++;
if (cpuid >= NR_CPUS)
continue;
- lpaca[cpuid].hw_cpu_id = interrupt_server[i];
prom_printf("%x : preparing thread ... ",
interrupt_server[i]);
if (_naca->smt_state) {
*
* This function is valid only for Open Firmware systems. finish_device_tree
* must be called before using this.
+ *
+ * While we're here, we may as well set the "physical" cpu ids in the paca.
*/
static void __init setup_cpu_maps(void)
{
intserv = (u32 *)get_property(dn, "ibm,ppc-interrupt-server#s",
&len);
+ if (!intserv)
+ intserv = (u32 *)get_property(dn, "reg", NULL);
+
nthreads = len / sizeof(u32);
for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
cpu_set(cpu, cpu_possible_map);
cpu_set(cpu, cpu_present_map);
+ set_hard_smp_processor_id(cpu, intserv[j]);
cpu++;
}
}
#define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id)
#define set_hard_smp_processor_id(CPU, VAL) \
- do { (paca[(CPU)].hw_proc_num = (VAL)); } while (0)
+ do { (paca[(CPU)].hw_cpu_id = (VAL)); } while (0)
#endif /* __ASSEMBLY__ */