bigsmp.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
  3. * Drives the local APIC in "clustered mode".
  4. */
  5. #define APIC_DEFINITION 1
  6. #include <linux/threads.h>
  7. #include <linux/cpumask.h>
  8. #include <asm/mpspec.h>
  9. #include <asm/genapic.h>
  10. #include <asm/fixmap.h>
  11. #include <asm/apicdef.h>
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/dmi.h>
  15. #include <asm/bigsmp/apicdef.h>
  16. #include <linux/smp.h>
  17. #include <asm/bigsmp/apic.h>
  18. #include <asm/bigsmp/ipi.h>
  19. #include <asm/mach-default/mach_mpparse.h>
  20. #include <asm/mach-default/mach_wakecpu.h>
  21. static int dmi_bigsmp; /* can be set by dmi scanners */
  22. static int hp_ht_bigsmp(const struct dmi_system_id *d)
  23. {
  24. printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
  25. dmi_bigsmp = 1;
  26. return 0;
  27. }
  28. static const struct dmi_system_id bigsmp_dmi_table[] = {
  29. { hp_ht_bigsmp, "HP ProLiant DL760 G2",
  30. { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
  31. DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
  32. },
  33. { hp_ht_bigsmp, "HP ProLiant DL740",
  34. { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
  35. DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
  36. },
  37. { }
  38. };
  39. static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask)
  40. {
  41. cpus_clear(*retmask);
  42. cpu_set(cpu, *retmask);
  43. }
  44. static int probe_bigsmp(void)
  45. {
  46. if (def_to_bigsmp)
  47. dmi_bigsmp = 1;
  48. else
  49. dmi_check_system(bigsmp_dmi_table);
  50. return dmi_bigsmp;
  51. }
  52. struct genapic apic_bigsmp = {
  53. .name = "bigsmp",
  54. .probe = probe_bigsmp,
  55. .acpi_madt_oem_check = NULL,
  56. .apic_id_registered = bigsmp_apic_id_registered,
  57. .irq_delivery_mode = dest_Fixed,
  58. /* phys delivery to target CPU: */
  59. .irq_dest_mode = 0,
  60. .target_cpus = bigsmp_target_cpus,
  61. .disable_esr = 1,
  62. .dest_logical = 0,
  63. .check_apicid_used = bigsmp_check_apicid_used,
  64. .check_apicid_present = bigsmp_check_apicid_present,
  65. .vector_allocation_domain = bigsmp_vector_allocation_domain,
  66. .init_apic_ldr = bigsmp_init_apic_ldr,
  67. .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map,
  68. .setup_apic_routing = bigsmp_setup_apic_routing,
  69. .multi_timer_check = NULL,
  70. .apicid_to_node = apicid_to_node,
  71. .cpu_to_logical_apicid = cpu_to_logical_apicid,
  72. .cpu_present_to_apicid = cpu_present_to_apicid,
  73. .apicid_to_cpu_present = apicid_to_cpu_present,
  74. .setup_portio_remap = setup_portio_remap,
  75. .check_phys_apicid_present = check_phys_apicid_present,
  76. .enable_apic_mode = enable_apic_mode,
  77. .phys_pkg_id = phys_pkg_id,
  78. .mps_oem_check = mps_oem_check,
  79. .get_apic_id = get_apic_id,
  80. .set_apic_id = NULL,
  81. .apic_id_mask = APIC_ID_MASK,
  82. .cpu_mask_to_apicid = cpu_mask_to_apicid,
  83. .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
  84. .send_IPI_mask = send_IPI_mask,
  85. .send_IPI_mask_allbutself = NULL,
  86. .send_IPI_allbutself = send_IPI_allbutself,
  87. .send_IPI_all = send_IPI_all,
  88. .send_IPI_self = NULL,
  89. .wakeup_cpu = NULL,
  90. .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
  91. .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
  92. .wait_for_init_deassert = wait_for_init_deassert,
  93. .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
  94. .store_NMI_vector = store_NMI_vector,
  95. .restore_NMI_vector = restore_NMI_vector,
  96. .inquire_remote_apic = inquire_remote_apic,
  97. };