Commit 6c39ac1f authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Patrick Mochel

[PATCH] more clustered-apic-mode work

Code mostly originally by James Cleverdon.

Abstracts out more clustered_apic_mode gunk into

 - ioapic_phys_id_map()
 - wakeup_secondary_cpu()
 - setup_portio_remap()
parent 67382f14
...@@ -1135,7 +1135,7 @@ void disable_IO_APIC(void) ...@@ -1135,7 +1135,7 @@ void disable_IO_APIC(void)
static void __init setup_ioapic_ids_from_mpc (void) static void __init setup_ioapic_ids_from_mpc (void)
{ {
struct IO_APIC_reg_00 reg_00; 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 apic;
int i; int i;
unsigned char old_id; unsigned char old_id;
...@@ -1145,9 +1145,8 @@ static void __init setup_ioapic_ids_from_mpc (void) ...@@ -1145,9 +1145,8 @@ static void __init setup_ioapic_ids_from_mpc (void)
/* This gets done during IOAPIC enumeration for ACPI. */ /* This gets done during IOAPIC enumeration for ACPI. */
return; return;
if (clustered_apic_mode) phys_id_present_map = ioapic_phys_id_map(phys_cpu_present_map);
/* We don't have a good way to do this yet - hack */
phys_id_present_map = (u_long) 0xf;
/* /*
* Set the IOAPIC ID to the value stored in the MPC table. * Set the IOAPIC ID to the value stored in the MPC table.
*/ */
......
...@@ -849,11 +849,7 @@ static void __init do_boot_cpu (int apicid) ...@@ -849,11 +849,7 @@ static void __init do_boot_cpu (int apicid)
/* /*
* Starting actual IPI sequence... * Starting actual IPI sequence...
*/ */
wakeup_secondary_cpu(apicid, start_eip);
if (clustered_apic_mode)
boot_error = wakeup_secondary_via_NMI(apicid);
else
boot_error = wakeup_secondary_via_INIT(apicid, start_eip);
if (!boot_error) { if (!boot_error) {
/* /*
...@@ -1061,15 +1057,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) ...@@ -1061,15 +1057,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid) if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid)
BUG(); BUG();
if (clustered_apic_mode && (numnodes > 1)) { setup_portio_remap();
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);
}
/* /*
* Scan the CPU present map and fire up the other CPUs via do_boot_cpu * Scan the CPU present map and fire up the other CPUs via do_boot_cpu
......
...@@ -37,6 +37,11 @@ static inline void init_apic_ldr(void) ...@@ -37,6 +37,11 @@ static inline void init_apic_ldr(void)
apic_write_around(APIC_LDR, val); 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) static inline void clustered_apic_check(void)
{ {
printk("Enabling APIC mode: %s. Using %d I/O APICs\n", printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
...@@ -68,4 +73,11 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, int quad) ...@@ -68,4 +73,11 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
return (m->mpc_apicid); 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 */ #endif /* __ASM_MACH_APIC_H */
...@@ -31,6 +31,12 @@ static inline int multi_timer_check(int apic, int irq) ...@@ -31,6 +31,12 @@ static inline int multi_timer_check(int apic, int irq)
return (apic != 0 && irq == 0); 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) static inline int cpu_present_to_apicid(int mps_cpu)
{ {
return ( ((mps_cpu/4)*16) + (1<<(mps_cpu%4)) ); return ( ((mps_cpu/4)*16) + (1<<(mps_cpu%4)) );
...@@ -63,4 +69,18 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, int quad) ...@@ -63,4 +69,18 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
return logical_apicid; 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 */ #endif /* __ASM_MACH_APIC_H */
...@@ -40,6 +40,12 @@ static inline int cpu_present_to_apicid(int mps_cpu) ...@@ -40,6 +40,12 @@ static inline int cpu_present_to_apicid(int mps_cpu)
return mps_cpu; 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) static inline unsigned long apicid_to_phys_cpu_present(int apicid)
{ {
if (x86_summit) if (x86_summit)
...@@ -48,4 +54,11 @@ static inline unsigned long apicid_to_phys_cpu_present(int apicid) ...@@ -48,4 +54,11 @@ static inline unsigned long apicid_to_phys_cpu_present(int apicid)
return (1ul << apicid); 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 */ #endif /* __ASM_MACH_APIC_H */
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