6fcccfb5918e4d0726575d6afc2ab176d0e4a799
[safe/jmp/linux-2.6] / arch / x86 / mach-generic / bigsmp.c
1 /*
2  * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
3  * Drives the local APIC in "clustered mode".
4  */
5 #define APIC_DEFINITION 1
6 #include <linux/threads.h>
7 #include <linux/cpumask.h>
8 #include <asm/mpspec.h>
9 #include <asm/genapic.h>
10 #include <asm/fixmap.h>
11 #include <asm/apicdef.h>
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/dmi.h>
15 #include <asm/bigsmp/apicdef.h>
16 #include <linux/smp.h>
17 #include <asm/bigsmp/apic.h>
18 #include <asm/bigsmp/ipi.h>
19 #include <asm/mach-default/mach_mpparse.h>
20
21 static int dmi_bigsmp; /* can be set by dmi scanners */
22
23 static int hp_ht_bigsmp(const struct dmi_system_id *d)
24 {
25         printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
26         dmi_bigsmp = 1;
27         return 0;
28 }
29
30
31 static const struct dmi_system_id bigsmp_dmi_table[] = {
32         { hp_ht_bigsmp, "HP ProLiant DL760 G2",
33         { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
34         DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
35         },
36
37         { hp_ht_bigsmp, "HP ProLiant DL740",
38         { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
39         DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
40         },
41          { }
42 };
43
44 static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask)
45 {
46         cpus_clear(*retmask);
47         cpu_set(cpu, *retmask);
48 }
49
50 static int probe_bigsmp(void)
51 {
52         if (def_to_bigsmp)
53                 dmi_bigsmp = 1;
54         else
55                 dmi_check_system(bigsmp_dmi_table);
56         return dmi_bigsmp;
57 }
58
59 struct genapic apic_bigsmp = {
60
61         .name                           = "bigsmp",
62         .probe                          = probe_bigsmp,
63         .acpi_madt_oem_check            = NULL,
64         .apic_id_registered             = bigsmp_apic_id_registered,
65
66         .irq_delivery_mode              = dest_Fixed,
67         /* phys delivery to target CPU: */
68         .irq_dest_mode                  = 0,
69
70         .target_cpus                    = bigsmp_target_cpus,
71         .disable_esr                    = 1,
72         .dest_logical                   = 0,
73         .check_apicid_used              = bigsmp_check_apicid_used,
74         .check_apicid_present           = bigsmp_check_apicid_present,
75
76         .vector_allocation_domain       = bigsmp_vector_allocation_domain,
77         .init_apic_ldr                  = bigsmp_init_apic_ldr,
78
79         .ioapic_phys_id_map             = bigsmp_ioapic_phys_id_map,
80         .setup_apic_routing             = bigsmp_setup_apic_routing,
81         .multi_timer_check              = NULL,
82         .apicid_to_node                 = bigsmp_apicid_to_node,
83         .cpu_to_logical_apicid          = bigsmp_cpu_to_logical_apicid,
84         .cpu_present_to_apicid          = bigsmp_cpu_present_to_apicid,
85         .apicid_to_cpu_present          = bigsmp_apicid_to_cpu_present,
86         .setup_portio_remap             = NULL,
87         .check_phys_apicid_present      = bigsmp_check_phys_apicid_present,
88         .enable_apic_mode               = NULL,
89         .phys_pkg_id                    = bigsmp_phys_pkg_id,
90         .mps_oem_check                  = NULL,
91
92         .get_apic_id                    = bigsmp_get_apic_id,
93         .set_apic_id                    = NULL,
94         .apic_id_mask                   = 0xFF << 24,
95
96         .cpu_mask_to_apicid             = bigsmp_cpu_mask_to_apicid,
97         .cpu_mask_to_apicid_and         = bigsmp_cpu_mask_to_apicid_and,
98
99         .send_IPI_mask                  = default_send_IPI_mask,
100         .send_IPI_mask_allbutself       = NULL,
101         .send_IPI_allbutself            = bigsmp_send_IPI_allbutself,
102         .send_IPI_all                   = bigsmp_send_IPI_all,
103         .send_IPI_self                  = NULL,
104
105         .wakeup_cpu                     = NULL,
106         .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
107         .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
108
109         .wait_for_init_deassert         = default_wait_for_init_deassert,
110
111         .smp_callin_clear_local_apic    = NULL,
112         .store_NMI_vector               = NULL,
113         .inquire_remote_apic            = default_inquire_remote_apic,
114 };