blob: 8fc704a3db7cc6f6bcd020ef3666c5a80cc7e4f4 [file] [log] [blame]
Paolo Ciarrocchi651bbe12008-02-20 00:02:58 +01001/*
Simon Arlott27b46d72007-10-20 01:13:56 +02002 * Default generic APIC driver. This handles up to 8 CPUs.
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 */
4#define APIC_DEFINITION 1
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <linux/threads.h>
6#include <linux/cpumask.h>
7#include <asm/mpspec.h>
8#include <asm/mach-default/mach_apicdef.h>
9#include <asm/genapic.h>
10#include <asm/fixmap.h>
11#include <asm/apicdef.h>
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/smp.h>
15#include <linux/init.h>
16#include <asm/mach-default/mach_apic.h>
17#include <asm/mach-default/mach_ipi.h>
18#include <asm/mach-default/mach_mpparse.h>
Yinghai Lu569712b2008-11-16 03:12:49 -080019#include <asm/mach-default/mach_wakecpu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Ingo Molnare2d40b12009-01-28 06:50:47 +010021static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
22{
23 /*
24 * Careful. Some cpus do not strictly honor the set of cpus
25 * specified in the interrupt destination when using lowest
26 * priority interrupt delivery mode.
27 *
28 * In particular there was a hyperthreading cpu observed to
29 * deliver interrupts to the wrong hyperthread when only one
30 * hyperthread was specified in the interrupt desitination.
31 */
32 *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } };
33}
34
Linus Torvalds1da177e2005-04-16 15:20:36 -070035/* should be called last. */
Vivek Goyale96763d2007-01-11 01:52:44 +010036static int probe_default(void)
Paolo Ciarrocchi651bbe12008-02-20 00:02:58 +010037{
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 return 1;
Paolo Ciarrocchi651bbe12008-02-20 00:02:58 +010039}
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Ingo Molnar0a7e8c62009-01-28 03:32:03 +010041struct genapic apic_default = {
42
43 .name = "default",
44 .probe = probe_default,
Ingo Molnar306db032009-01-28 03:43:47 +010045 .acpi_madt_oem_check = NULL,
Ingo Molnar7ed248d2009-01-28 03:43:47 +010046 .apic_id_registered = default_apic_id_registered,
Ingo Molnar0a7e8c62009-01-28 03:32:03 +010047
Ingo Molnardcafa4a2009-01-28 04:16:01 +010048 .irq_delivery_mode = dest_LowestPrio,
49 /* logical delivery broadcast to all CPUs: */
50 .irq_dest_mode = 1,
Ingo Molnar0a7e8c62009-01-28 03:32:03 +010051
Ingo Molnar0a9cc202009-01-28 04:30:40 +010052 .target_cpus = default_target_cpus,
Ingo Molnar08125d32009-01-28 05:08:44 +010053 .disable_esr = 0,
Ingo Molnarbdb1a9b2009-01-28 05:29:25 +010054 .dest_logical = APIC_DEST_LOGICAL,
Ingo Molnard1d7cae2009-01-28 05:41:42 +010055 .check_apicid_used = default_check_apicid_used,
56 .check_apicid_present = default_check_apicid_present,
Ingo Molnar0a7e8c62009-01-28 03:32:03 +010057
Ingo Molnare2d40b12009-01-28 06:50:47 +010058 .vector_allocation_domain = default_vector_allocation_domain,
Ingo Molnara5c43292009-01-28 06:50:47 +010059 .init_apic_ldr = default_init_apic_ldr,
Ingo Molnar0a7e8c62009-01-28 03:32:03 +010060
Ingo Molnard190cb82009-01-28 06:50:47 +010061 .ioapic_phys_id_map = default_ioapic_phys_id_map,
Ingo Molnar72ce0162009-01-28 06:50:47 +010062 .setup_apic_routing = default_setup_apic_routing,
Ingo Molnar33a201f2009-01-28 07:17:26 +010063 .multi_timer_check = NULL,
Ingo Molnar3f57a312009-01-28 06:50:47 +010064 .apicid_to_node = default_apicid_to_node,
Ingo Molnar5257c512009-01-28 06:50:47 +010065 .cpu_to_logical_apicid = default_cpu_to_logical_apicid,
Ingo Molnara21769a42009-01-28 06:50:47 +010066 .cpu_present_to_apicid = default_cpu_present_to_apicid,
Ingo Molnar80587142009-01-28 06:50:47 +010067 .apicid_to_cpu_present = default_apicid_to_cpu_present,
Ingo Molnar0a7e8c62009-01-28 03:32:03 +010068 .setup_portio_remap = setup_portio_remap,
69 .check_phys_apicid_present = check_phys_apicid_present,
70 .enable_apic_mode = enable_apic_mode,
71 .phys_pkg_id = phys_pkg_id,
72 .mps_oem_check = mps_oem_check,
73
74 .get_apic_id = get_apic_id,
75 .set_apic_id = NULL,
76 .apic_id_mask = APIC_ID_MASK,
77
78 .cpu_mask_to_apicid = cpu_mask_to_apicid,
79 .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
80
81 .send_IPI_mask = send_IPI_mask,
82 .send_IPI_mask_allbutself = NULL,
83 .send_IPI_allbutself = send_IPI_allbutself,
84 .send_IPI_all = send_IPI_all,
85 .send_IPI_self = NULL,
86
87 .wakeup_cpu = NULL,
88 .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
89 .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
90 .wait_for_init_deassert = wait_for_init_deassert,
91 .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
92 .store_NMI_vector = store_NMI_vector,
93 .restore_NMI_vector = restore_NMI_vector,
94 .inquire_remote_apic = inquire_remote_apic,
95};