blob: da4ed653506a3dd9f303b9bcfd0484988ea1e7bd [file] [log] [blame]
Yinghai Lud49c4282008-06-08 18:31:54 -07001/*
2 * APIC driver for the IBM NUMAQ chipset.
3 */
4#define APIC_DEFINITION 1
5#include <linux/threads.h>
6#include <linux/cpumask.h>
Yinghai Lud49c4282008-06-08 18:31:54 -07007#include <asm/mpspec.h>
8#include <asm/genapic.h>
9#include <asm/fixmap.h>
10#include <asm/apicdef.h>
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/init.h>
Yinghai Luedb181a2008-07-25 02:17:55 -070014#include <asm/numaq/apicdef.h>
Yinghai Lu4696ca52008-07-11 18:43:10 -070015#include <linux/smp.h>
Yinghai Luedb181a2008-07-25 02:17:55 -070016#include <asm/numaq/apic.h>
17#include <asm/numaq/ipi.h>
18#include <asm/numaq/mpparse.h>
19#include <asm/numaq/wakecpu.h>
Yinghai Lud49c4282008-06-08 18:31:54 -070020#include <asm/numaq.h>
21
Jaswinder Singh Rajputf29521e2009-01-03 15:46:57 +053022static int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
Yinghai Lud49c4282008-06-08 18:31:54 -070023{
24 numaq_mps_oem_check(mpc, oem, productid);
25 return found_numaq;
26}
27
28static int probe_numaq(void)
29{
30 /* already know from get_memcfg_numaq() */
31 return found_numaq;
32}
33
Ingo Molnare2d40b12009-01-28 06:50:47 +010034static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
Yinghai Lu497c9a12008-08-19 20:50:28 -070035{
36 /* Careful. Some cpus do not strictly honor the set of cpus
37 * specified in the interrupt destination when using lowest
38 * priority interrupt delivery mode.
39 *
40 * In particular there was a hyperthreading cpu observed to
41 * deliver interrupts to the wrong hyperthread when only one
42 * hyperthread was specified in the interrupt desitination.
43 */
Mike Travise7986732008-12-16 17:33:52 -080044 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
Yinghai Lu497c9a12008-08-19 20:50:28 -070045}
46
Ingo Molnarfea34372009-01-28 03:32:03 +010047struct genapic apic_numaq = {
48
49 .name = "NUMAQ",
50 .probe = probe_numaq,
Ingo Molnar306db032009-01-28 03:43:47 +010051 .acpi_madt_oem_check = NULL,
Ingo Molnar7ed248d2009-01-28 03:43:47 +010052 .apic_id_registered = numaq_apic_id_registered,
Ingo Molnarfea34372009-01-28 03:32:03 +010053
Ingo Molnar1b1bcb32009-01-28 04:16:01 +010054 .irq_delivery_mode = dest_LowestPrio,
55 /* physical delivery on LOCAL quad: */
56 .irq_dest_mode = 0,
Ingo Molnarfea34372009-01-28 03:32:03 +010057
Ingo Molnar0a9cc202009-01-28 04:30:40 +010058 .target_cpus = numaq_target_cpus,
Ingo Molnar08125d32009-01-28 05:08:44 +010059 .disable_esr = 1,
Ingo Molnarbdb1a9b2009-01-28 05:29:25 +010060 .dest_logical = APIC_DEST_LOGICAL,
Ingo Molnard1d7cae2009-01-28 05:41:42 +010061 .check_apicid_used = numaq_check_apicid_used,
62 .check_apicid_present = numaq_check_apicid_present,
Ingo Molnarfea34372009-01-28 03:32:03 +010063
Ingo Molnare2d40b12009-01-28 06:50:47 +010064 .vector_allocation_domain = numaq_vector_allocation_domain,
Ingo Molnara5c43292009-01-28 06:50:47 +010065 .init_apic_ldr = numaq_init_apic_ldr,
Ingo Molnarfea34372009-01-28 03:32:03 +010066
Ingo Molnard190cb82009-01-28 06:50:47 +010067 .ioapic_phys_id_map = numaq_ioapic_phys_id_map,
Ingo Molnar72ce0162009-01-28 06:50:47 +010068 .setup_apic_routing = numaq_setup_apic_routing,
Ingo Molnar33a201f2009-01-28 07:17:26 +010069 .multi_timer_check = numaq_multi_timer_check,
Ingo Molnarfea34372009-01-28 03:32:03 +010070 .apicid_to_node = apicid_to_node,
71 .cpu_to_logical_apicid = cpu_to_logical_apicid,
72 .cpu_present_to_apicid = cpu_present_to_apicid,
73 .apicid_to_cpu_present = apicid_to_cpu_present,
74 .setup_portio_remap = setup_portio_remap,
75 .check_phys_apicid_present = check_phys_apicid_present,
76 .enable_apic_mode = enable_apic_mode,
77 .phys_pkg_id = phys_pkg_id,
78 .mps_oem_check = mps_oem_check,
79
80 .get_apic_id = get_apic_id,
81 .set_apic_id = NULL,
82 .apic_id_mask = APIC_ID_MASK,
83
84 .cpu_mask_to_apicid = cpu_mask_to_apicid,
85 .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
86
87 .send_IPI_mask = send_IPI_mask,
88 .send_IPI_mask_allbutself = NULL,
89 .send_IPI_allbutself = send_IPI_allbutself,
90 .send_IPI_all = send_IPI_all,
91 .send_IPI_self = NULL,
92
93 .wakeup_cpu = NULL,
94 .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
95 .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
96 .wait_for_init_deassert = wait_for_init_deassert,
97 .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
98 .store_NMI_vector = store_NMI_vector,
99 .restore_NMI_vector = restore_NMI_vector,
100 .inquire_remote_apic = inquire_remote_apic,
101};