es7000.c 2.5 KB

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