Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * APIC driver for the Unisys ES7000 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 | c7e7964 | 2008-07-25 02:17:33 -0700 | [diff] [blame] | 14 | #include <asm/es7000/apicdef.h> |
Yinghai Lu | 4696ca5 | 2008-07-11 18:43:10 -0700 | [diff] [blame] | 15 | #include <linux/smp.h> |
Yinghai Lu | c7e7964 | 2008-07-25 02:17:33 -0700 | [diff] [blame] | 16 | #include <asm/es7000/apic.h> |
| 17 | #include <asm/es7000/ipi.h> |
| 18 | #include <asm/es7000/mpparse.h> |
| 19 | #include <asm/es7000/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_es7000(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | { |
| 23 | /* probed later in mptable/ACPI hooks */ |
| 24 | return 0; |
| 25 | } |
| 26 | |
Vivek Goyal | 1833d6b | 2007-05-02 19:27:08 +0200 | [diff] [blame] | 27 | extern void es7000_sw_apic(void); |
| 28 | static void __init enable_apic_mode(void) |
| 29 | { |
| 30 | es7000_sw_apic(); |
| 31 | return; |
| 32 | } |
| 33 | |
| 34 | static __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 */ |
| 48 | static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
| 49 | { |
Yinghai Lu | a73aaed | 2008-09-14 02:33:14 -0700 | [diff] [blame] | 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 | |
Vivek Goyal | 1833d6b | 2007-05-02 19:27:08 +0200 | [diff] [blame] | 57 | if (!find_unisys_acpi_oem_table(&oem_addr)) { |
Yinghai Lu | a73aaed | 2008-09-14 02:33:14 -0700 | [diff] [blame] | 58 | if (check_dsdt) |
| 59 | ret = parse_unisys_oem((char *)oem_addr); |
Vivek Goyal | 1833d6b | 2007-05-02 19:27:08 +0200 | [diff] [blame] | 60 | else { |
| 61 | setup_unisys(); |
Yinghai Lu | a73aaed | 2008-09-14 02:33:14 -0700 | [diff] [blame] | 62 | ret = 1; |
Vivek Goyal | 1833d6b | 2007-05-02 19:27:08 +0200 | [diff] [blame] | 63 | } |
Yinghai Lu | a73aaed | 2008-09-14 02:33:14 -0700 | [diff] [blame] | 64 | /* |
| 65 | * we need to unmap it |
| 66 | */ |
| 67 | unmap_unisys_acpi_oem_table(oem_addr); |
Vivek Goyal | 1833d6b | 2007-05-02 19:27:08 +0200 | [diff] [blame] | 68 | } |
Yinghai Lu | a73aaed | 2008-09-14 02:33:14 -0700 | [diff] [blame] | 69 | return ret; |
Vivek Goyal | 1833d6b | 2007-05-02 19:27:08 +0200 | [diff] [blame] | 70 | } |
| 71 | #else |
| 72 | static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
| 73 | { |
| 74 | return 0; |
| 75 | } |
| 76 | #endif |
| 77 | |
Sam Ravnborg | d3ab785 | 2007-06-03 00:05:10 +0200 | [diff] [blame] | 78 | struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000); |