bigsmp_32.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. static int dmi_bigsmp; /* can be set by dmi scanners */
  20. static int hp_ht_bigsmp(const struct dmi_system_id *d)
  21. {
  22. printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
  23. dmi_bigsmp = 1;
  24. return 0;
  25. }
  26. static const struct dmi_system_id bigsmp_dmi_table[] = {
  27. { hp_ht_bigsmp, "HP ProLiant DL760 G2",
  28. { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
  29. DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
  30. },
  31. { hp_ht_bigsmp, "HP ProLiant DL740",
  32. { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
  33. DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
  34. },
  35. { }
  36. };
  37. static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask)
  38. {
  39. cpus_clear(*retmask);
  40. cpu_set(cpu, *retmask);
  41. }
  42. static int probe_bigsmp(void)
  43. {
  44. if (def_to_bigsmp)
  45. dmi_bigsmp = 1;
  46. else
  47. dmi_check_system(bigsmp_dmi_table);
  48. return dmi_bigsmp;
  49. }
  50. struct genapic apic_bigsmp = {
  51. .name = "bigsmp",
  52. .probe = probe_bigsmp,
  53. .acpi_madt_oem_check = NULL,
  54. .apic_id_registered = bigsmp_apic_id_registered,
  55. .irq_delivery_mode = dest_Fixed,
  56. /* phys delivery to target CPU: */
  57. .irq_dest_mode = 0,
  58. .target_cpus = bigsmp_target_cpus,
  59. .disable_esr = 1,
  60. .dest_logical = 0,
  61. .check_apicid_used = bigsmp_check_apicid_used,
  62. .check_apicid_present = bigsmp_check_apicid_present,
  63. .vector_allocation_domain = bigsmp_vector_allocation_domain,
  64. .init_apic_ldr = bigsmp_init_apic_ldr,
  65. .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map,
  66. .setup_apic_routing = bigsmp_setup_apic_routing,
  67. .multi_timer_check = NULL,
  68. .apicid_to_node = bigsmp_apicid_to_node,
  69. .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid,
  70. .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
  71. .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present,
  72. .setup_portio_remap = NULL,
  73. .check_phys_apicid_present = bigsmp_check_phys_apicid_present,
  74. .enable_apic_mode = NULL,
  75. .phys_pkg_id = bigsmp_phys_pkg_id,
  76. .mps_oem_check = NULL,
  77. .get_apic_id = bigsmp_get_apic_id,
  78. .set_apic_id = NULL,
  79. .apic_id_mask = 0xFF << 24,
  80. .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid,
  81. .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and,
  82. .send_IPI_mask = default_send_IPI_mask,
  83. .send_IPI_mask_allbutself = NULL,
  84. .send_IPI_allbutself = bigsmp_send_IPI_allbutself,
  85. .send_IPI_all = bigsmp_send_IPI_all,
  86. .send_IPI_self = NULL,
  87. .wakeup_cpu = NULL,
  88. .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
  89. .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
  90. .wait_for_init_deassert = default_wait_for_init_deassert,
  91. .smp_callin_clear_local_apic = NULL,
  92. .store_NMI_vector = NULL,
  93. .inquire_remote_apic = default_inquire_remote_apic,
  94. };