Merge branch 'merge' of git://git.secretlab.ca/git/linux-2.6-mpc52xx into merge
[linux-2.6-block.git] / arch / x86 / mach-generic / es7000.c
CommitLineData
1da177e4
LT
1/*
2 * APIC driver for the Unisys ES7000 chipset.
3 */
4#define APIC_DEFINITION 1
1da177e4
LT
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>
1da177e4 13#include <linux/init.h>
c7e7964c 14#include <asm/es7000/apicdef.h>
4696ca5b 15#include <linux/smp.h>
c7e7964c
YL
16#include <asm/es7000/apic.h>
17#include <asm/es7000/ipi.h>
18#include <asm/es7000/mpparse.h>
19#include <asm/es7000/wakecpu.h>
1da177e4 20
e96763d6 21static int probe_es7000(void)
1da177e4
LT
22{
23 /* probed later in mptable/ACPI hooks */
24 return 0;
25}
26
1833d6bc
VG
27extern void es7000_sw_apic(void);
28static void __init enable_apic_mode(void)
29{
30 es7000_sw_apic();
31 return;
32}
33
34static __init int mps_oem_check(struct mp_config_table *mpc, char *oem,
35 char *productid)
36{
37 if (mpc->mpc_oemptr) {
38 struct mp_config_oemtable *oem_table =
39 (struct mp_config_oemtable *)mpc->mpc_oemptr;
40 if (!strncmp(oem, "UNISYS", 6))
41 return parse_unisys_oem((char *)oem_table);
42 }
43 return 0;
44}
45
46#ifdef CONFIG_ACPI
47/* Hook from generic ACPI tables.c */
48static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
49{
a73aaedd
YL
50 unsigned long oem_addr = 0;
51 int check_dsdt;
52 int ret = 0;
53
54 /* check dsdt at first to avoid clear fix_map for oem_addr */
55 check_dsdt = es7000_check_dsdt();
56
1833d6bc 57 if (!find_unisys_acpi_oem_table(&oem_addr)) {
a73aaedd
YL
58 if (check_dsdt)
59 ret = parse_unisys_oem((char *)oem_addr);
1833d6bc
VG
60 else {
61 setup_unisys();
a73aaedd 62 ret = 1;
1833d6bc 63 }
a73aaedd
YL
64 /*
65 * we need to unmap it
66 */
67 unmap_unisys_acpi_oem_table(oem_addr);
1833d6bc 68 }
a73aaedd 69 return ret;
1833d6bc
VG
70}
71#else
72static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
73{
74 return 0;
75}
76#endif
77
497c9a19
YL
78static cpumask_t vector_allocation_domain(int cpu)
79{
80 /* Careful. Some cpus do not strictly honor the set of cpus
81 * specified in the interrupt destination when using lowest
82 * priority interrupt delivery mode.
83 *
84 * In particular there was a hyperthreading cpu observed to
85 * deliver interrupts to the wrong hyperthread when only one
86 * hyperthread was specified in the interrupt desitination.
87 */
88 cpumask_t domain = { { [0] = APIC_ALL_CPUS, } };
89 return domain;
90}
91
d3ab7856 92struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000);