blob: 13e82bc4dae626a65218bee16d62a8ebb0fd2915 [file] [log] [blame]
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +01001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/init.h>
14#include <linux/dmi.h>
Yinghai Lu1176fa92008-07-25 02:17:21 -070015#include <asm/bigsmp/apicdef.h>
Yinghai Lu4696ca52008-07-11 18:43:10 -070016#include <linux/smp.h>
Yinghai Lu1176fa92008-07-25 02:17:21 -070017#include <asm/bigsmp/apic.h>
18#include <asm/bigsmp/ipi.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#include <asm/mach-default/mach_mpparse.h>
Yinghai Lu569712b2008-11-16 03:12:49 -080020#include <asm/mach-default/mach_wakecpu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
22static int dmi_bigsmp; /* can be set by dmi scanners */
23
Jeff Garzik18552562007-10-03 15:15:40 -040024static int hp_ht_bigsmp(const struct dmi_system_id *d)
Linus Torvalds1da177e2005-04-16 15:20:36 -070025{
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
27 dmi_bigsmp = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 return 0;
29}
30
31
Jeff Garzik18552562007-10-03 15:15:40 -040032static const struct dmi_system_id bigsmp_dmi_table[] = {
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +010033 { hp_ht_bigsmp, "HP ProLiant DL760 G2",
34 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
35 DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
36 },
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +010038 { hp_ht_bigsmp, "HP ProLiant DL740",
39 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
40 DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
41 },
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 { }
43};
44
Mike Travise7986732008-12-16 17:33:52 -080045static void vector_allocation_domain(int cpu, cpumask_t *retmask)
Yinghai Lu497c9a12008-08-19 20:50:28 -070046{
Mike Travise7986732008-12-16 17:33:52 -080047 cpus_clear(*retmask);
48 cpu_set(cpu, *retmask);
Yinghai Lu497c9a12008-08-19 20:50:28 -070049}
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
William Lee Irwin IIIaf669c92007-05-23 13:58:23 -070051static int probe_bigsmp(void)
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +010052{
Venkatesh Pallipadi911a62d2005-09-03 15:56:31 -070053 if (def_to_bigsmp)
Yinghai Lue0da3362008-06-08 18:29:22 -070054 dmi_bigsmp = 1;
Venkatesh Pallipadi911a62d2005-09-03 15:56:31 -070055 else
56 dmi_check_system(bigsmp_dmi_table);
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +010057 return dmi_bigsmp;
58}
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Ingo Molnard26b6d62009-01-28 03:32:03 +010060struct genapic apic_bigsmp = {
61
62 .name = "bigsmp",
63 .probe = probe_bigsmp,
64 .acpi_madt_oem_check = acpi_madt_oem_check,
65 .apic_id_registered = apic_id_registered,
66
67 .int_delivery_mode = INT_DELIVERY_MODE,
68 .int_dest_mode = INT_DEST_MODE,
69
70 .target_cpus = target_cpus,
71 .ESR_DISABLE = esr_disable,
72 .apic_destination_logical = APIC_DEST_LOGICAL,
73 .check_apicid_used = check_apicid_used,
74 .check_apicid_present = check_apicid_present,
75
76 .no_balance_irq = NO_BALANCE_IRQ,
77 .no_ioapic_check = 0,
78
79 .vector_allocation_domain = vector_allocation_domain,
80 .init_apic_ldr = init_apic_ldr,
81
82 .ioapic_phys_id_map = ioapic_phys_id_map,
83 .setup_apic_routing = setup_apic_routing,
84 .multi_timer_check = multi_timer_check,
85 .apicid_to_node = apicid_to_node,
86 .cpu_to_logical_apicid = cpu_to_logical_apicid,
87 .cpu_present_to_apicid = cpu_present_to_apicid,
88 .apicid_to_cpu_present = apicid_to_cpu_present,
89 .setup_portio_remap = setup_portio_remap,
90 .check_phys_apicid_present = check_phys_apicid_present,
91 .enable_apic_mode = enable_apic_mode,
92 .phys_pkg_id = phys_pkg_id,
93 .mps_oem_check = mps_oem_check,
94
95 .get_apic_id = get_apic_id,
96 .set_apic_id = NULL,
97 .apic_id_mask = APIC_ID_MASK,
98
99 .cpu_mask_to_apicid = cpu_mask_to_apicid,
100 .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
101
102 .send_IPI_mask = send_IPI_mask,
103 .send_IPI_mask_allbutself = NULL,
104 .send_IPI_allbutself = send_IPI_allbutself,
105 .send_IPI_all = send_IPI_all,
106 .send_IPI_self = NULL,
107
108 .wakeup_cpu = NULL,
109 .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
110 .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
111 .wait_for_init_deassert = wait_for_init_deassert,
112 .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
113 .store_NMI_vector = store_NMI_vector,
114 .restore_NMI_vector = restore_NMI_vector,
115 .inquire_remote_apic = inquire_remote_apic,
116};