Paolo Ciarrocchi | 8108576 | 2008-02-20 00:17:34 +0100 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * APIC driver for the IBM "Summit" chipset. |
| 3 | */ |
| 4 | #define APIC_DEFINITION 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | #include <linux/threads.h> |
| 6 | #include <linux/cpumask.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #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> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <linux/init.h> |
Yinghai Lu | e8c48ef | 2008-07-25 02:17:44 -0700 | [diff] [blame] | 14 | #include <asm/summit/apicdef.h> |
Yinghai Lu | 4696ca5 | 2008-07-11 18:43:10 -0700 | [diff] [blame] | 15 | #include <linux/smp.h> |
Yinghai Lu | e8c48ef | 2008-07-25 02:17:44 -0700 | [diff] [blame] | 16 | #include <asm/summit/apic.h> |
| 17 | #include <asm/summit/ipi.h> |
| 18 | #include <asm/summit/mpparse.h> |
Yinghai Lu | 569712b | 2008-11-16 03:12:49 -0800 | [diff] [blame] | 19 | #include <asm/mach-default/mach_wakecpu.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
Vivek Goyal | e96763d | 2007-01-11 01:52:44 +0100 | [diff] [blame] | 21 | static int probe_summit(void) |
Paolo Ciarrocchi | 8108576 | 2008-02-20 00:17:34 +0100 | [diff] [blame] | 22 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | /* probed later in mptable/ACPI hooks */ |
| 24 | return 0; |
Paolo Ciarrocchi | 8108576 | 2008-02-20 00:17:34 +0100 | [diff] [blame] | 25 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
Ingo Molnar | e2d40b1 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 27 | static void summit_vector_allocation_domain(int cpu, cpumask_t *retmask) |
Yinghai Lu | 497c9a1 | 2008-08-19 20:50:28 -0700 | [diff] [blame] | 28 | { |
| 29 | /* Careful. Some cpus do not strictly honor the set of cpus |
| 30 | * specified in the interrupt destination when using lowest |
| 31 | * priority interrupt delivery mode. |
| 32 | * |
| 33 | * In particular there was a hyperthreading cpu observed to |
| 34 | * deliver interrupts to the wrong hyperthread when only one |
| 35 | * hyperthread was specified in the interrupt desitination. |
| 36 | */ |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 37 | *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } }; |
Yinghai Lu | 497c9a1 | 2008-08-19 20:50:28 -0700 | [diff] [blame] | 38 | } |
| 39 | |
Ingo Molnar | 491a50c | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 40 | struct genapic apic_summit = { |
| 41 | |
| 42 | .name = "summit", |
| 43 | .probe = probe_summit, |
Ingo Molnar | 306db03 | 2009-01-28 03:43:47 +0100 | [diff] [blame] | 44 | .acpi_madt_oem_check = summit_acpi_madt_oem_check, |
Ingo Molnar | 7ed248d | 2009-01-28 03:43:47 +0100 | [diff] [blame] | 45 | .apic_id_registered = summit_apic_id_registered, |
Ingo Molnar | 491a50c | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 46 | |
Ingo Molnar | 82daea6b | 2009-01-28 04:16:01 +0100 | [diff] [blame] | 47 | .irq_delivery_mode = dest_LowestPrio, |
| 48 | /* logical delivery broadcast to all CPUs: */ |
| 49 | .irq_dest_mode = 1, |
Ingo Molnar | 491a50c | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 50 | |
Ingo Molnar | 0a9cc20 | 2009-01-28 04:30:40 +0100 | [diff] [blame] | 51 | .target_cpus = summit_target_cpus, |
Ingo Molnar | 08125d3 | 2009-01-28 05:08:44 +0100 | [diff] [blame] | 52 | .disable_esr = 1, |
Ingo Molnar | bdb1a9b | 2009-01-28 05:29:25 +0100 | [diff] [blame] | 53 | .dest_logical = APIC_DEST_LOGICAL, |
Ingo Molnar | d1d7cae | 2009-01-28 05:41:42 +0100 | [diff] [blame] | 54 | .check_apicid_used = summit_check_apicid_used, |
| 55 | .check_apicid_present = summit_check_apicid_present, |
Ingo Molnar | 491a50c | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 56 | |
Ingo Molnar | e2d40b1 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 57 | .vector_allocation_domain = summit_vector_allocation_domain, |
Ingo Molnar | a5c4329 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 58 | .init_apic_ldr = summit_init_apic_ldr, |
Ingo Molnar | 491a50c | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 59 | |
Ingo Molnar | d190cb8 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 60 | .ioapic_phys_id_map = summit_ioapic_phys_id_map, |
Ingo Molnar | 72ce016 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 61 | .setup_apic_routing = summit_setup_apic_routing, |
Ingo Molnar | 33a201f | 2009-01-28 07:17:26 +0100 | [diff] [blame] | 62 | .multi_timer_check = NULL, |
Ingo Molnar | 3f57a31 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 63 | .apicid_to_node = summit_apicid_to_node, |
Ingo Molnar | 5257c51 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 64 | .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, |
Ingo Molnar | a21769a4 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 65 | .cpu_present_to_apicid = summit_cpu_present_to_apicid, |
Ingo Molnar | 8058714 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 66 | .apicid_to_cpu_present = summit_apicid_to_cpu_present, |
Ingo Molnar | d83093b | 2009-01-28 12:43:18 +0100 | [diff] [blame] | 67 | .setup_portio_remap = NULL, |
Ingo Molnar | a27a621 | 2009-01-28 12:43:18 +0100 | [diff] [blame] | 68 | .check_phys_apicid_present = summit_check_phys_apicid_present, |
Ingo Molnar | 4904033 | 2009-01-28 12:43:18 +0100 | [diff] [blame] | 69 | .enable_apic_mode = NULL, |
Ingo Molnar | cb8cc44 | 2009-01-28 13:24:54 +0100 | [diff] [blame] | 70 | .phys_pkg_id = summit_phys_pkg_id, |
Ingo Molnar | 9c76424 | 2009-01-28 13:44:32 +0100 | [diff] [blame] | 71 | .mps_oem_check = summit_mps_oem_check, |
Ingo Molnar | 491a50c | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 72 | |
Ingo Molnar | ca6c8ed | 2009-01-28 14:08:38 +0100 | [diff] [blame^] | 73 | .get_apic_id = summit_get_apic_id, |
Ingo Molnar | 491a50c | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 74 | .set_apic_id = NULL, |
| 75 | .apic_id_mask = APIC_ID_MASK, |
| 76 | |
| 77 | .cpu_mask_to_apicid = cpu_mask_to_apicid, |
| 78 | .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, |
| 79 | |
| 80 | .send_IPI_mask = send_IPI_mask, |
| 81 | .send_IPI_mask_allbutself = NULL, |
| 82 | .send_IPI_allbutself = send_IPI_allbutself, |
| 83 | .send_IPI_all = send_IPI_all, |
| 84 | .send_IPI_self = NULL, |
| 85 | |
| 86 | .wakeup_cpu = NULL, |
| 87 | .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, |
| 88 | .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, |
| 89 | .wait_for_init_deassert = wait_for_init_deassert, |
| 90 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, |
| 91 | .store_NMI_vector = store_NMI_vector, |
| 92 | .restore_NMI_vector = restore_NMI_vector, |
| 93 | .inquire_remote_apic = inquire_remote_apic, |
| 94 | }; |