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->int_delivery_mode = INT_DELIVERY_MODE_CLUSTER;
25 apic->int_dest_mode = INT_DEST_MODE_CLUSTER;
26 apic->no_balance_irq = NO_BALANCE_IRQ_CLUSTER;
28 apic->init_apic_ldr = init_apic_ldr_cluster;
30 apic->cpu_mask_to_apicid = cpu_mask_to_apicid_cluster;
33 static int probe_es7000(void)
35 /* probed later in mptable/ACPI hooks */
39 extern void es7000_sw_apic(void);
40 static void __init enable_apic_mode(void)
47 mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
50 struct mpc_oemtable *oem_table =
51 (struct mpc_oemtable *)mpc->oemptr;
52 if (!strncmp(oem, "UNISYS", 6))
53 return parse_unisys_oem((char *)oem_table);
59 /* Hook from generic ACPI tables.c */
60 static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
62 unsigned long oem_addr = 0;
66 /* check dsdt at first to avoid clear fix_map for oem_addr */
67 check_dsdt = es7000_check_dsdt();
69 if (!find_unisys_acpi_oem_table(&oem_addr)) {
71 ret = parse_unisys_oem((char *)oem_addr);
79 unmap_unisys_acpi_oem_table(oem_addr);
84 static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
90 static void vector_allocation_domain(int cpu, cpumask_t *retmask)
92 /* Careful. Some cpus do not strictly honor the set of cpus
93 * specified in the interrupt destination when using lowest
94 * priority interrupt delivery mode.
96 * In particular there was a hyperthreading cpu observed to
97 * deliver interrupts to the wrong hyperthread when only one
98 * hyperthread was specified in the interrupt desitination.
100 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
103 struct genapic apic_es7000 = {
106 .probe = probe_es7000,
107 .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
108 .apic_id_registered = es7000_apic_id_registered,
110 .int_delivery_mode = INT_DELIVERY_MODE,
111 .int_dest_mode = INT_DEST_MODE,
113 .target_cpus = target_cpus,
114 .ESR_DISABLE = esr_disable,
115 .apic_destination_logical = APIC_DEST_LOGICAL,
116 .check_apicid_used = check_apicid_used,
117 .check_apicid_present = check_apicid_present,
119 .no_balance_irq = NO_BALANCE_IRQ,
120 .no_ioapic_check = 0,
122 .vector_allocation_domain = vector_allocation_domain,
123 .init_apic_ldr = init_apic_ldr,
125 .ioapic_phys_id_map = ioapic_phys_id_map,
126 .setup_apic_routing = setup_apic_routing,
127 .multi_timer_check = multi_timer_check,
128 .apicid_to_node = apicid_to_node,
129 .cpu_to_logical_apicid = cpu_to_logical_apicid,
130 .cpu_present_to_apicid = cpu_present_to_apicid,
131 .apicid_to_cpu_present = apicid_to_cpu_present,
132 .setup_portio_remap = setup_portio_remap,
133 .check_phys_apicid_present = check_phys_apicid_present,
134 .enable_apic_mode = enable_apic_mode,
135 .phys_pkg_id = phys_pkg_id,
136 .mps_oem_check = mps_oem_check,
138 .get_apic_id = get_apic_id,
140 .apic_id_mask = APIC_ID_MASK,
142 .cpu_mask_to_apicid = cpu_mask_to_apicid,
143 .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
145 .send_IPI_mask = send_IPI_mask,
146 .send_IPI_mask_allbutself = NULL,
147 .send_IPI_allbutself = send_IPI_allbutself,
148 .send_IPI_all = send_IPI_all,
149 .send_IPI_self = NULL,
152 .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
153 .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
154 .wait_for_init_deassert = wait_for_init_deassert,
155 .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
156 .store_NMI_vector = store_NMI_vector,
157 .restore_NMI_vector = restore_NMI_vector,
158 .inquire_remote_apic = inquire_remote_apic,