Code mostly originally by James Cleverdon.
Abstracts out more clustered_apic_mode gunk into
- ioapic_phys_id_map()
- wakeup_secondary_cpu()
- setup_portio_remap()
static void __init setup_ioapic_ids_from_mpc (void)
{
struct IO_APIC_reg_00 reg_00;
- unsigned long phys_id_present_map = phys_cpu_present_map;
+ unsigned long phys_id_present_map;
int apic;
int i;
unsigned char old_id;
/* This gets done during IOAPIC enumeration for ACPI. */
return;
- if (clustered_apic_mode)
- /* We don't have a good way to do this yet - hack */
- phys_id_present_map = (u_long) 0xf;
+ phys_id_present_map = ioapic_phys_id_map(phys_cpu_present_map);
+
/*
* Set the IOAPIC ID to the value stored in the MPC table.
*/
/*
* Starting actual IPI sequence...
*/
-
- if (clustered_apic_mode)
- boot_error = wakeup_secondary_via_NMI(apicid);
- else
- boot_error = wakeup_secondary_via_INIT(apicid, start_eip);
+ wakeup_secondary_cpu(apicid, start_eip);
if (!boot_error) {
/*
if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid)
BUG();
- if (clustered_apic_mode && (numnodes > 1)) {
- printk("Remapping cross-quad port I/O for %d quads\n",
- numnodes);
- xquad_portio = ioremap (XQUAD_PORTIO_BASE,
- numnodes * XQUAD_PORTIO_QUAD);
- printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
- (u_long) xquad_portio,
- (u_long) numnodes * XQUAD_PORTIO_QUAD);
- }
+ setup_portio_remap();
/*
* Scan the CPU present map and fire up the other CPUs via do_boot_cpu
apic_write_around(APIC_LDR, val);
}
+static inline ulong ioapic_phys_id_map(ulong phys_map)
+{
+ return phys_map;
+}
+
static inline void clustered_apic_check(void)
{
printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
return (m->mpc_apicid);
}
+#define wakeup_secondary_cpu(apicid, start_eip) \
+ wakeup_secondary_via_INIT(apicid, start_eip)
+
+static inline void setup_portio_remap(void)
+{
+}
+
#endif /* __ASM_MACH_APIC_H */
return (apic != 0 && irq == 0);
}
+static inline ulong ioapic_phys_id_map(ulong phys_map)
+{
+ /* We don't have a good way to do this yet - hack */
+ return 0xf;
+}
+
static inline int cpu_present_to_apicid(int mps_cpu)
{
return ( ((mps_cpu/4)*16) + (1<<(mps_cpu%4)) );
return logical_apicid;
}
+#define wakeup_secondary_cpu(apicid, start_eip) \
+ wakeup_secondary_via_NMI(apicid)
+
+static inline void setup_portio_remap(void)
+{
+ if (numnodes <= 1)
+ return;
+
+ printk("Remapping cross-quad port I/O for %d quads\n", numnodes);
+ xquad_portio = ioremap (XQUAD_PORTIO_BASE, numnodes*XQUAD_PORTIO_QUAD);
+ printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
+ (u_long) xquad_portio, (u_long) numnodes*XQUAD_PORTIO_QUAD);
+}
+
#endif /* __ASM_MACH_APIC_H */
return mps_cpu;
}
+static inline ulong ioapic_phys_id_map(ulong phys_map)
+{
+ /* For clustered we don't have a good way to do this yet - hack */
+ return (x86_summit ? 0x0F : phys_map);
+}
+
static inline unsigned long apicid_to_phys_cpu_present(int apicid)
{
if (x86_summit)
return (1ul << apicid);
}
+#define wakeup_secondary_cpu(apicid, start_eip) \
+ wakeup_secondary_via_INIT(apicid, start_eip)
+
+static inline void setup_portio_remap(void)
+{
+}
+
#endif /* __ASM_MACH_APIC_H */