Paolo Ciarrocchi | 637cba0 | 2008-02-20 00:18:52 +0100 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <linux/init.h> |
| 14 | #include <linux/dmi.h> |
Yinghai Lu | 1176fa9 | 2008-07-25 02:17:21 -0700 | [diff] [blame] | 15 | #include <asm/bigsmp/apicdef.h> |
Yinghai Lu | 4696ca5 | 2008-07-11 18:43:10 -0700 | [diff] [blame] | 16 | #include <linux/smp.h> |
Yinghai Lu | 1176fa9 | 2008-07-25 02:17:21 -0700 | [diff] [blame] | 17 | #include <asm/bigsmp/apic.h> |
| 18 | #include <asm/bigsmp/ipi.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <asm/mach-default/mach_mpparse.h> |
Yinghai Lu | 569712b | 2008-11-16 03:12:49 -0800 | [diff] [blame] | 20 | #include <asm/mach-default/mach_wakecpu.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
| 22 | static int dmi_bigsmp; /* can be set by dmi scanners */ |
| 23 | |
Jeff Garzik | 1855256 | 2007-10-03 15:15:40 -0400 | [diff] [blame] | 24 | static int hp_ht_bigsmp(const struct dmi_system_id *d) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident); |
| 27 | dmi_bigsmp = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | |
Jeff Garzik | 1855256 | 2007-10-03 15:15:40 -0400 | [diff] [blame] | 32 | static const struct dmi_system_id bigsmp_dmi_table[] = { |
Paolo Ciarrocchi | 637cba0 | 2008-02-20 00:18:52 +0100 | [diff] [blame] | 33 | { hp_ht_bigsmp, "HP ProLiant DL760 G2", |
| 34 | { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), |
| 35 | DMI_MATCH(DMI_BIOS_VERSION, "P44-"),} |
| 36 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Paolo Ciarrocchi | 637cba0 | 2008-02-20 00:18:52 +0100 | [diff] [blame] | 38 | { hp_ht_bigsmp, "HP ProLiant DL740", |
| 39 | { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), |
| 40 | DMI_MATCH(DMI_BIOS_VERSION, "P47-"),} |
| 41 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | { } |
| 43 | }; |
| 44 | |
Ingo Molnar | e2d40b1 | 2009-01-28 06:50:47 +0100 | [diff] [blame^] | 45 | static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask) |
Yinghai Lu | 497c9a1 | 2008-08-19 20:50:28 -0700 | [diff] [blame] | 46 | { |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 47 | cpus_clear(*retmask); |
| 48 | cpu_set(cpu, *retmask); |
Yinghai Lu | 497c9a1 | 2008-08-19 20:50:28 -0700 | [diff] [blame] | 49 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
William Lee Irwin III | af669c9 | 2007-05-23 13:58:23 -0700 | [diff] [blame] | 51 | static int probe_bigsmp(void) |
Paolo Ciarrocchi | 637cba0 | 2008-02-20 00:18:52 +0100 | [diff] [blame] | 52 | { |
Venkatesh Pallipadi | 911a62d | 2005-09-03 15:56:31 -0700 | [diff] [blame] | 53 | if (def_to_bigsmp) |
Yinghai Lu | e0da336 | 2008-06-08 18:29:22 -0700 | [diff] [blame] | 54 | dmi_bigsmp = 1; |
Venkatesh Pallipadi | 911a62d | 2005-09-03 15:56:31 -0700 | [diff] [blame] | 55 | else |
| 56 | dmi_check_system(bigsmp_dmi_table); |
Paolo Ciarrocchi | 637cba0 | 2008-02-20 00:18:52 +0100 | [diff] [blame] | 57 | return dmi_bigsmp; |
| 58 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Ingo Molnar | d26b6d6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 60 | struct genapic apic_bigsmp = { |
| 61 | |
| 62 | .name = "bigsmp", |
| 63 | .probe = probe_bigsmp, |
Ingo Molnar | 306db03 | 2009-01-28 03:43:47 +0100 | [diff] [blame] | 64 | .acpi_madt_oem_check = NULL, |
Ingo Molnar | 7ed248d | 2009-01-28 03:43:47 +0100 | [diff] [blame] | 65 | .apic_id_registered = bigsmp_apic_id_registered, |
Ingo Molnar | d26b6d6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 66 | |
Ingo Molnar | d8a3539 | 2009-01-28 04:16:01 +0100 | [diff] [blame] | 67 | .irq_delivery_mode = dest_Fixed, |
| 68 | /* phys delivery to target CPU: */ |
| 69 | .irq_dest_mode = 0, |
Ingo Molnar | d26b6d6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 70 | |
Ingo Molnar | 0a9cc20 | 2009-01-28 04:30:40 +0100 | [diff] [blame] | 71 | .target_cpus = bigsmp_target_cpus, |
Ingo Molnar | 08125d3 | 2009-01-28 05:08:44 +0100 | [diff] [blame] | 72 | .disable_esr = 1, |
Ingo Molnar | bdb1a9b | 2009-01-28 05:29:25 +0100 | [diff] [blame] | 73 | .dest_logical = 0, |
Ingo Molnar | d1d7cae | 2009-01-28 05:41:42 +0100 | [diff] [blame] | 74 | .check_apicid_used = bigsmp_check_apicid_used, |
| 75 | .check_apicid_present = bigsmp_check_apicid_present, |
Ingo Molnar | d26b6d6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 76 | |
Ingo Molnar | e2d40b1 | 2009-01-28 06:50:47 +0100 | [diff] [blame^] | 77 | .vector_allocation_domain = bigsmp_vector_allocation_domain, |
Ingo Molnar | d26b6d6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 78 | .init_apic_ldr = init_apic_ldr, |
| 79 | |
| 80 | .ioapic_phys_id_map = ioapic_phys_id_map, |
| 81 | .setup_apic_routing = setup_apic_routing, |
| 82 | .multi_timer_check = multi_timer_check, |
| 83 | .apicid_to_node = apicid_to_node, |
| 84 | .cpu_to_logical_apicid = cpu_to_logical_apicid, |
| 85 | .cpu_present_to_apicid = cpu_present_to_apicid, |
| 86 | .apicid_to_cpu_present = apicid_to_cpu_present, |
| 87 | .setup_portio_remap = setup_portio_remap, |
| 88 | .check_phys_apicid_present = check_phys_apicid_present, |
| 89 | .enable_apic_mode = enable_apic_mode, |
| 90 | .phys_pkg_id = phys_pkg_id, |
| 91 | .mps_oem_check = mps_oem_check, |
| 92 | |
| 93 | .get_apic_id = get_apic_id, |
| 94 | .set_apic_id = NULL, |
| 95 | .apic_id_mask = APIC_ID_MASK, |
| 96 | |
| 97 | .cpu_mask_to_apicid = cpu_mask_to_apicid, |
| 98 | .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, |
| 99 | |
| 100 | .send_IPI_mask = send_IPI_mask, |
| 101 | .send_IPI_mask_allbutself = NULL, |
| 102 | .send_IPI_allbutself = send_IPI_allbutself, |
| 103 | .send_IPI_all = send_IPI_all, |
| 104 | .send_IPI_self = NULL, |
| 105 | |
| 106 | .wakeup_cpu = NULL, |
| 107 | .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, |
| 108 | .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, |
| 109 | .wait_for_init_deassert = wait_for_init_deassert, |
| 110 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, |
| 111 | .store_NMI_vector = store_NMI_vector, |
| 112 | .restore_NMI_vector = restore_NMI_vector, |
| 113 | .inquire_remote_apic = inquire_remote_apic, |
| 114 | }; |