2 * APIC driver for the Unisys ES7000 chipset.
4 #define APIC_DEFINITION 1
5 #include <linux/threads.h>
6 #include <linux/cpumask.h>
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>
13 #include <linux/init.h>
14 #include <asm/es7000/apicdef.h>
15 #include <linux/smp.h>
16 #include <asm/es7000/apic.h>
17 #include <asm/es7000/ipi.h>
18 #include <asm/es7000/mpparse.h>
19 #include <asm/mach-default/mach_wakecpu.h>
21 void __init es7000_update_genapic_to_cluster(void)
23 apic->target_cpus = target_cpus_cluster;
24 apic->irq_delivery_mode = INT_DELIVERY_MODE_CLUSTER;
25 apic->irq_dest_mode = INT_DEST_MODE_CLUSTER;
27 apic->init_apic_ldr = es7000_init_apic_ldr_cluster;
29 apic->cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster;
32 static int probe_es7000(void)
34 /* probed later in mptable/ACPI hooks */
39 es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
42 struct mpc_oemtable *oem_table =
43 (struct mpc_oemtable *)mpc->oemptr;
45 if (!strncmp(oem, "UNISYS", 6))
46 return parse_unisys_oem((char *)oem_table);
52 /* Hook from generic ACPI tables.c */
53 static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
55 unsigned long oem_addr = 0;
59 /* check dsdt at first to avoid clear fix_map for oem_addr */
60 check_dsdt = es7000_check_dsdt();
62 if (!find_unisys_acpi_oem_table(&oem_addr)) {
64 ret = parse_unisys_oem((char *)oem_addr);
72 unmap_unisys_acpi_oem_table(oem_addr);
77 static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
83 static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask)
85 /* Careful. Some cpus do not strictly honor the set of cpus
86 * specified in the interrupt destination when using lowest
87 * priority interrupt delivery mode.
89 * In particular there was a hyperthreading cpu observed to
90 * deliver interrupts to the wrong hyperthread when only one
91 * hyperthread was specified in the interrupt desitination.
93 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
96 struct genapic apic_es7000 = {
99 .probe = probe_es7000,
100 .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
101 .apic_id_registered = es7000_apic_id_registered,
103 .irq_delivery_mode = dest_Fixed,
104 /* phys delivery to target CPUs: */
107 .target_cpus = es7000_target_cpus,
110 .check_apicid_used = es7000_check_apicid_used,
111 .check_apicid_present = es7000_check_apicid_present,
113 .vector_allocation_domain = es7000_vector_allocation_domain,
114 .init_apic_ldr = es7000_init_apic_ldr,
116 .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
117 .setup_apic_routing = es7000_setup_apic_routing,
118 .multi_timer_check = NULL,
119 .apicid_to_node = es7000_apicid_to_node,
120 .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
121 .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
122 .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
123 .setup_portio_remap = NULL,
124 .check_phys_apicid_present = es7000_check_phys_apicid_present,
125 .enable_apic_mode = es7000_enable_apic_mode,
126 .phys_pkg_id = es7000_phys_pkg_id,
127 .mps_oem_check = es7000_mps_oem_check,
129 .get_apic_id = es7000_get_apic_id,
131 .apic_id_mask = 0xFF << 24,
133 .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
134 .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
136 .send_IPI_mask = es7000_send_IPI_mask,
137 .send_IPI_mask_allbutself = NULL,
138 .send_IPI_allbutself = es7000_send_IPI_allbutself,
139 .send_IPI_all = es7000_send_IPI_all,
140 .send_IPI_self = NULL,
143 .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
144 .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
145 .wait_for_init_deassert = wait_for_init_deassert,
146 .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
147 .store_NMI_vector = store_NMI_vector,
148 .restore_NMI_vector = restore_NMI_vector,
149 .inquire_remote_apic = inquire_remote_apic,