blob: 626f45ca4e7ecf64c4b924a6dfe93f7dcfed2210 [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
20static int dmi_bigsmp; /* can be set by dmi scanners */
21
Jeff Garzik18552562007-10-03 15:15:40 -040022static int hp_ht_bigsmp(const struct dmi_system_id *d)
Linus Torvalds1da177e2005-04-16 15:20:36 -070023{
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
25 dmi_bigsmp = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 return 0;
27}
28
29
Jeff Garzik18552562007-10-03 15:15:40 -040030static const struct dmi_system_id bigsmp_dmi_table[] = {
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +010031 { hp_ht_bigsmp, "HP ProLiant DL760 G2",
32 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
33 DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
34 },
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +010036 { hp_ht_bigsmp, "HP ProLiant DL740",
37 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
38 DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
39 },
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 { }
41};
42
Ingo Molnare2d40b12009-01-28 06:50:47 +010043static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask)
Yinghai Lu497c9a12008-08-19 20:50:28 -070044{
Mike Travise7986732008-12-16 17:33:52 -080045 cpus_clear(*retmask);
46 cpu_set(cpu, *retmask);
Yinghai Lu497c9a12008-08-19 20:50:28 -070047}
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
William Lee Irwin IIIaf669c92007-05-23 13:58:23 -070049static int probe_bigsmp(void)
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +010050{
Venkatesh Pallipadi911a62d2005-09-03 15:56:31 -070051 if (def_to_bigsmp)
Yinghai Lue0da3362008-06-08 18:29:22 -070052 dmi_bigsmp = 1;
Venkatesh Pallipadi911a62d2005-09-03 15:56:31 -070053 else
54 dmi_check_system(bigsmp_dmi_table);
Paolo Ciarrocchi637cba02008-02-20 00:18:52 +010055 return dmi_bigsmp;
56}
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Ingo Molnard26b6d62009-01-28 03:32:03 +010058struct genapic apic_bigsmp = {
59
60 .name = "bigsmp",
61 .probe = probe_bigsmp,
Ingo Molnar306db032009-01-28 03:43:47 +010062 .acpi_madt_oem_check = NULL,
Ingo Molnar7ed248d2009-01-28 03:43:47 +010063 .apic_id_registered = bigsmp_apic_id_registered,
Ingo Molnard26b6d62009-01-28 03:32:03 +010064
Ingo Molnard8a35392009-01-28 04:16:01 +010065 .irq_delivery_mode = dest_Fixed,
66 /* phys delivery to target CPU: */
67 .irq_dest_mode = 0,
Ingo Molnard26b6d62009-01-28 03:32:03 +010068
Ingo Molnar0a9cc202009-01-28 04:30:40 +010069 .target_cpus = bigsmp_target_cpus,
Ingo Molnar08125d32009-01-28 05:08:44 +010070 .disable_esr = 1,
Ingo Molnarbdb1a9b2009-01-28 05:29:25 +010071 .dest_logical = 0,
Ingo Molnard1d7cae2009-01-28 05:41:42 +010072 .check_apicid_used = bigsmp_check_apicid_used,
73 .check_apicid_present = bigsmp_check_apicid_present,
Ingo Molnard26b6d62009-01-28 03:32:03 +010074
Ingo Molnare2d40b12009-01-28 06:50:47 +010075 .vector_allocation_domain = bigsmp_vector_allocation_domain,
Ingo Molnara5c43292009-01-28 06:50:47 +010076 .init_apic_ldr = bigsmp_init_apic_ldr,
Ingo Molnard26b6d62009-01-28 03:32:03 +010077
Ingo Molnard190cb82009-01-28 06:50:47 +010078 .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map,
Ingo Molnar72ce0162009-01-28 06:50:47 +010079 .setup_apic_routing = bigsmp_setup_apic_routing,
Ingo Molnar33a201f2009-01-28 07:17:26 +010080 .multi_timer_check = NULL,
Ingo Molnar3f57a312009-01-28 06:50:47 +010081 .apicid_to_node = bigsmp_apicid_to_node,
Ingo Molnar5257c512009-01-28 06:50:47 +010082 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid,
Ingo Molnara21769a42009-01-28 06:50:47 +010083 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
Ingo Molnar80587142009-01-28 06:50:47 +010084 .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present,
Ingo Molnard83093b2009-01-28 12:43:18 +010085 .setup_portio_remap = NULL,
Ingo Molnara27a6212009-01-28 12:43:18 +010086 .check_phys_apicid_present = bigsmp_check_phys_apicid_present,
Ingo Molnar49040332009-01-28 12:43:18 +010087 .enable_apic_mode = NULL,
Ingo Molnarcb8cc442009-01-28 13:24:54 +010088 .phys_pkg_id = bigsmp_phys_pkg_id,
Ingo Molnar9c764242009-01-28 13:44:32 +010089 .mps_oem_check = NULL,
Ingo Molnard26b6d62009-01-28 03:32:03 +010090
Ingo Molnarca6c8ed2009-01-28 14:08:38 +010091 .get_apic_id = bigsmp_get_apic_id,
Ingo Molnard26b6d62009-01-28 03:32:03 +010092 .set_apic_id = NULL,
Ingo Molnar94af1872009-01-28 15:08:53 +010093 .apic_id_mask = 0xFF << 24,
Ingo Molnard26b6d62009-01-28 03:32:03 +010094
Ingo Molnardebccb32009-01-28 15:20:18 +010095 .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid,
96 .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and,
Ingo Molnard26b6d62009-01-28 03:32:03 +010097
Ingo Molnardac5f412009-01-28 15:42:24 +010098 .send_IPI_mask = default_send_IPI_mask,
Ingo Molnard26b6d62009-01-28 03:32:03 +010099 .send_IPI_mask_allbutself = NULL,
Ingo Molnardac5f412009-01-28 15:42:24 +0100100 .send_IPI_allbutself = bigsmp_send_IPI_allbutself,
101 .send_IPI_all = bigsmp_send_IPI_all,
Ingo Molnard26b6d62009-01-28 03:32:03 +0100102 .send_IPI_self = NULL,
103
104 .wakeup_cpu = NULL,
Ingo Molnar6f177c02009-01-28 16:09:23 +0100105 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
106 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
Ingo Molnara9659362009-01-28 16:21:32 +0100107
108 .wait_for_init_deassert = default_wait_for_init_deassert,
109
Ingo Molnar333344d2009-01-28 16:31:52 +0100110 .smp_callin_clear_local_apic = NULL,
Ingo Molnar7bd06ec2009-01-28 16:31:52 +0100111 .store_NMI_vector = NULL,
Ingo Molnar25dc0042009-01-28 16:31:52 +0100112 .inquire_remote_apic = default_inquire_remote_apic,
Ingo Molnard26b6d62009-01-28 03:32:03 +0100113};