es7000.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * APIC driver for the Unisys ES7000 chipset.
  3. */
  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/es7000/wakecpu.h>
  20. static int probe_es7000(void)
  21. {
  22. /* probed later in mptable/ACPI hooks */
  23. return 0;
  24. }
  25. extern void es7000_sw_apic(void);
  26. static void __init enable_apic_mode(void)
  27. {
  28. es7000_sw_apic();
  29. return;
  30. }
  31. static __init int mps_oem_check(struct mp_config_table *mpc, char *oem,
  32. char *productid)
  33. {
  34. if (mpc->mpc_oemptr) {
  35. struct mp_config_oemtable *oem_table =
  36. (struct mp_config_oemtable *)mpc->mpc_oemptr;
  37. if (!strncmp(oem, "UNISYS", 6))
  38. return parse_unisys_oem((char *)oem_table);
  39. }
  40. return 0;
  41. }
  42. #ifdef CONFIG_ACPI
  43. /* Hook from generic ACPI tables.c */
  44. static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
  45. {
  46. unsigned long oem_addr = 0;
  47. int check_dsdt;
  48. int ret = 0;
  49. /* check dsdt at first to avoid clear fix_map for oem_addr */
  50. check_dsdt = es7000_check_dsdt();
  51. if (!find_unisys_acpi_oem_table(&oem_addr)) {
  52. if (check_dsdt)
  53. ret = parse_unisys_oem((char *)oem_addr);
  54. else {
  55. setup_unisys();
  56. ret = 1;
  57. }
  58. /*
  59. * we need to unmap it
  60. */
  61. unmap_unisys_acpi_oem_table(oem_addr);
  62. }
  63. return ret;
  64. }
  65. #else
  66. static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
  67. {
  68. return 0;
  69. }
  70. #endif
  71. static cpumask_t vector_allocation_domain(int cpu)
  72. {
  73. /* Careful. Some cpus do not strictly honor the set of cpus
  74. * specified in the interrupt destination when using lowest
  75. * priority interrupt delivery mode.
  76. *
  77. * In particular there was a hyperthreading cpu observed to
  78. * deliver interrupts to the wrong hyperthread when only one
  79. * hyperthread was specified in the interrupt desitination.
  80. */
  81. cpumask_t domain = { { [0] = APIC_ALL_CPUS, } };
  82. return domain;
  83. }
  84. struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000);