x86_init.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * Copyright (C) 2009 Thomas Gleixner <tglx@linutronix.de>
  3. *
  4. * For licencing details see kernel-base/COPYING
  5. */
  6. #include <linux/init.h>
  7. #include <linux/ioport.h>
  8. #include <linux/module.h>
  9. #include <linux/pci.h>
  10. #include <asm/bios_ebda.h>
  11. #include <asm/paravirt.h>
  12. #include <asm/pci_x86.h>
  13. #include <asm/mpspec.h>
  14. #include <asm/setup.h>
  15. #include <asm/apic.h>
  16. #include <asm/e820.h>
  17. #include <asm/time.h>
  18. #include <asm/irq.h>
  19. #include <asm/io_apic.h>
  20. #include <asm/hpet.h>
  21. #include <asm/pat.h>
  22. #include <asm/tsc.h>
  23. #include <asm/iommu.h>
  24. #include <asm/mach_traps.h>
  25. void x86_init_noop(void) { }
  26. void __init x86_init_uint_noop(unsigned int unused) { }
  27. int __init iommu_init_noop(void) { return 0; }
  28. void iommu_shutdown_noop(void) { }
  29. /*
  30. * The platform setup functions are preset with the default functions
  31. * for standard PC hardware.
  32. */
  33. struct x86_init_ops x86_init __initdata = {
  34. .resources = {
  35. .probe_roms = probe_roms,
  36. .reserve_resources = reserve_standard_io_resources,
  37. .memory_setup = default_machine_specific_memory_setup,
  38. },
  39. .mpparse = {
  40. .mpc_record = x86_init_uint_noop,
  41. .setup_ioapic_ids = x86_init_noop,
  42. .mpc_apic_id = default_mpc_apic_id,
  43. .smp_read_mpc_oem = default_smp_read_mpc_oem,
  44. .mpc_oem_bus_info = default_mpc_oem_bus_info,
  45. .find_smp_config = default_find_smp_config,
  46. .get_smp_config = default_get_smp_config,
  47. },
  48. .irqs = {
  49. .pre_vector_init = init_ISA_irqs,
  50. .intr_init = native_init_IRQ,
  51. .trap_init = x86_init_noop,
  52. },
  53. .oem = {
  54. .arch_setup = x86_init_noop,
  55. .banner = default_banner,
  56. },
  57. .paging = {
  58. .pagetable_init = native_pagetable_init,
  59. },
  60. .timers = {
  61. .setup_percpu_clockev = setup_boot_APIC_clock,
  62. .tsc_pre_init = x86_init_noop,
  63. .timer_init = hpet_time_init,
  64. .wallclock_init = x86_init_noop,
  65. },
  66. .iommu = {
  67. .iommu_init = iommu_init_noop,
  68. },
  69. .pci = {
  70. .init = x86_default_pci_init,
  71. .init_irq = x86_default_pci_init_irq,
  72. .fixup_irqs = x86_default_pci_fixup_irqs,
  73. },
  74. };
  75. struct x86_cpuinit_ops x86_cpuinit = {
  76. .early_percpu_clock_init = x86_init_noop,
  77. .setup_percpu_clockev = setup_secondary_APIC_clock,
  78. };
  79. static void default_nmi_init(void) { };
  80. static int default_i8042_detect(void) { return 1; };
  81. struct x86_platform_ops x86_platform = {
  82. .calibrate_tsc = native_calibrate_tsc,
  83. .get_wallclock = mach_get_cmos_time,
  84. .set_wallclock = mach_set_rtc_mmss,
  85. .iommu_shutdown = iommu_shutdown_noop,
  86. .is_untracked_pat_range = is_ISA_range,
  87. .nmi_init = default_nmi_init,
  88. .get_nmi_reason = default_get_nmi_reason,
  89. .i8042_detect = default_i8042_detect,
  90. .save_sched_clock_state = tsc_save_sched_clock_state,
  91. .restore_sched_clock_state = tsc_restore_sched_clock_state,
  92. };
  93. EXPORT_SYMBOL_GPL(x86_platform);
  94. #if defined(CONFIG_PCI_MSI)
  95. struct x86_msi_ops x86_msi = {
  96. .setup_msi_irqs = native_setup_msi_irqs,
  97. .teardown_msi_irq = native_teardown_msi_irq,
  98. .teardown_msi_irqs = default_teardown_msi_irqs,
  99. .restore_msi_irqs = default_restore_msi_irqs,
  100. };
  101. /* MSI arch specific hooks */
  102. int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
  103. {
  104. return x86_msi.setup_msi_irqs(dev, nvec, type);
  105. }
  106. void arch_teardown_msi_irqs(struct pci_dev *dev)
  107. {
  108. x86_msi.teardown_msi_irqs(dev);
  109. }
  110. void arch_teardown_msi_irq(unsigned int irq)
  111. {
  112. x86_msi.teardown_msi_irq(irq);
  113. }
  114. void arch_restore_msi_irqs(struct pci_dev *dev)
  115. {
  116. x86_msi.restore_msi_irqs(dev);
  117. }
  118. #endif
  119. struct x86_io_apic_ops x86_io_apic_ops = {
  120. .read = native_io_apic_read,
  121. .disable = native_disable_io_apic,
  122. };