numaq.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * APIC driver for the IBM NUMAQ 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/numaq/apicdef.h>
  15. #include <linux/smp.h>
  16. #include <asm/numaq/apic.h>
  17. #include <asm/numaq/ipi.h>
  18. #include <asm/numaq/mpparse.h>
  19. #include <asm/numaq/wakecpu.h>
  20. #include <asm/numaq.h>
  21. static int __numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
  22. {
  23. numaq_mps_oem_check(mpc, oem, productid);
  24. return found_numaq;
  25. }
  26. static int probe_numaq(void)
  27. {
  28. /* already know from get_memcfg_numaq() */
  29. return found_numaq;
  30. }
  31. static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
  32. {
  33. /* Careful. Some cpus do not strictly honor the set of cpus
  34. * specified in the interrupt destination when using lowest
  35. * priority interrupt delivery mode.
  36. *
  37. * In particular there was a hyperthreading cpu observed to
  38. * deliver interrupts to the wrong hyperthread when only one
  39. * hyperthread was specified in the interrupt desitination.
  40. */
  41. *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
  42. }
  43. static void numaq_setup_portio_remap(void)
  44. {
  45. int num_quads = num_online_nodes();
  46. if (num_quads <= 1)
  47. return;
  48. printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
  49. xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
  50. printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
  51. (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
  52. }
  53. struct genapic apic_numaq = {
  54. .name = "NUMAQ",
  55. .probe = probe_numaq,
  56. .acpi_madt_oem_check = NULL,
  57. .apic_id_registered = numaq_apic_id_registered,
  58. .irq_delivery_mode = dest_LowestPrio,
  59. /* physical delivery on LOCAL quad: */
  60. .irq_dest_mode = 0,
  61. .target_cpus = numaq_target_cpus,
  62. .disable_esr = 1,
  63. .dest_logical = APIC_DEST_LOGICAL,
  64. .check_apicid_used = numaq_check_apicid_used,
  65. .check_apicid_present = numaq_check_apicid_present,
  66. .vector_allocation_domain = numaq_vector_allocation_domain,
  67. .init_apic_ldr = numaq_init_apic_ldr,
  68. .ioapic_phys_id_map = numaq_ioapic_phys_id_map,
  69. .setup_apic_routing = numaq_setup_apic_routing,
  70. .multi_timer_check = numaq_multi_timer_check,
  71. .apicid_to_node = numaq_apicid_to_node,
  72. .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid,
  73. .cpu_present_to_apicid = numaq_cpu_present_to_apicid,
  74. .apicid_to_cpu_present = numaq_apicid_to_cpu_present,
  75. .setup_portio_remap = numaq_setup_portio_remap,
  76. .check_phys_apicid_present = numaq_check_phys_apicid_present,
  77. .enable_apic_mode = NULL,
  78. .phys_pkg_id = numaq_phys_pkg_id,
  79. .mps_oem_check = __numaq_mps_oem_check,
  80. .get_apic_id = numaq_get_apic_id,
  81. .set_apic_id = NULL,
  82. .apic_id_mask = APIC_ID_MASK,
  83. .cpu_mask_to_apicid = cpu_mask_to_apicid,
  84. .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
  85. .send_IPI_mask = send_IPI_mask,
  86. .send_IPI_mask_allbutself = NULL,
  87. .send_IPI_allbutself = send_IPI_allbutself,
  88. .send_IPI_all = send_IPI_all,
  89. .send_IPI_self = NULL,
  90. .wakeup_cpu = NULL,
  91. .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
  92. .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
  93. .wait_for_init_deassert = wait_for_init_deassert,
  94. .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
  95. .store_NMI_vector = store_NMI_vector,
  96. .restore_NMI_vector = restore_NMI_vector,
  97. .inquire_remote_apic = inquire_remote_apic,
  98. };