]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] more clustered-apic-mode work
authorMartin J. Bligh <mbligh@aracnet.com>
Mon, 23 Dec 2002 02:20:04 +0000 (18:20 -0800)
committerPatrick Mochel <mochel@osdl.org>
Mon, 23 Dec 2002 02:20:04 +0000 (18:20 -0800)
Code mostly originally by James Cleverdon.

Abstracts out more clustered_apic_mode gunk into

 - ioapic_phys_id_map()
 - wakeup_secondary_cpu()
 - setup_portio_remap()

arch/i386/kernel/io_apic.c
arch/i386/kernel/smpboot.c
include/asm-i386/mach-default/mach_apic.h
include/asm-i386/mach-numaq/mach_apic.h
include/asm-i386/mach-summit/mach_apic.h

index 25a412c5557e4203136d6df518e0eb8f18fca87b..1e4be4e4f054754929ba72d33b6d2b52354b276f 100644 (file)
@@ -1135,7 +1135,7 @@ void disable_IO_APIC(void)
 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;
@@ -1145,9 +1145,8 @@ static void __init setup_ioapic_ids_from_mpc (void)
                /* 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.
         */
index 9d508398bb32c6e02144d58dd631e3ba413c024a..4f0b998e9496afa37ddf85a330d8098fc5034bc8 100644 (file)
@@ -849,11 +849,7 @@ static void __init do_boot_cpu (int apicid)
        /*
         * 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) {
                /*
@@ -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)
                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
index e30e38ccdf66e95335a7fe39cb8d7cb7f28e8700..a24df01ffe2e7d35fc6edc21ffd86cad121c0660 100644 (file)
@@ -37,6 +37,11 @@ static inline void init_apic_ldr(void)
        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",
@@ -68,4 +73,11 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
        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 */
index 2faa25de2ea739146a8542f95adfedd95028d189..be8eacb32aa038ceadf60f0c03dfea7947fbbe7c 100644 (file)
@@ -31,6 +31,12 @@ static inline int multi_timer_check(int apic, int irq)
        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)) );
@@ -63,4 +69,18 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
        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 */
index 14d4db5f8d1d44a4483a5486b303bc7d9b7c8dc4..2de1e9fea7cd21954dd8da3730c5cda1e77f0f91 100644 (file)
@@ -40,6 +40,12 @@ static inline int cpu_present_to_apicid(int 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)
 {
        if (x86_summit)
@@ -48,4 +54,11 @@ static inline unsigned long apicid_to_phys_cpu_present(int 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 */