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
11 #include <asm/bios_ebda.h>
12 #include <asm/paravirt.h>
13 #include <asm/pci_x86.h>
14 #include <asm/pci.h>
15 #include <asm/mpspec.h>
16 #include <asm/setup.h>
17 #include <asm/apic.h>
18 #include <asm/e820.h>
19 #include <asm/time.h>
20 #include <asm/irq.h>
21 #include <asm/pat.h>
22 #include <asm/tsc.h>
23 #include <asm/iommu.h>
24 #include <asm/mach_traps.h>
25
x86_init_noop(void)26 void __cpuinit x86_init_noop(void) { }
x86_init_uint_noop(unsigned int unused)27 void __init x86_init_uint_noop(unsigned int unused) { }
x86_init_pgd_noop(pgd_t * unused)28 void __init x86_init_pgd_noop(pgd_t *unused) { }
iommu_init_noop(void)29 int __init iommu_init_noop(void) { return 0; }
iommu_shutdown_noop(void)30 void iommu_shutdown_noop(void) { }
wallclock_init_noop(void)31 void wallclock_init_noop(void) { }
32
33 /*
34 * The platform setup functions are preset with the default functions
35 * for standard PC hardware.
36 */
37 struct x86_init_ops x86_init __initdata = {
38
39 .resources = {
40 .probe_roms = probe_roms,
41 .reserve_resources = reserve_standard_io_resources,
42 .memory_setup = default_machine_specific_memory_setup,
43 },
44
45 .mpparse = {
46 .mpc_record = x86_init_uint_noop,
47 .setup_ioapic_ids = x86_init_noop,
48 .mpc_apic_id = default_mpc_apic_id,
49 .smp_read_mpc_oem = default_smp_read_mpc_oem,
50 .mpc_oem_bus_info = default_mpc_oem_bus_info,
51 .find_smp_config = default_find_smp_config,
52 .get_smp_config = default_get_smp_config,
53 },
54
55 .irqs = {
56 .pre_vector_init = init_ISA_irqs,
57 .intr_init = native_init_IRQ,
58 .trap_init = x86_init_noop,
59 },
60
61 .oem = {
62 .arch_setup = x86_init_noop,
63 .banner = default_banner,
64 },
65
66 .mapping = {
67 .pagetable_reserve = native_pagetable_reserve,
68 },
69
70 .paging = {
71 .pagetable_setup_start = native_pagetable_setup_start,
72 .pagetable_setup_done = native_pagetable_setup_done,
73 },
74
75 .timers = {
76 .setup_percpu_clockev = setup_boot_APIC_clock,
77 .tsc_pre_init = x86_init_noop,
78 .timer_init = hpet_time_init,
79 .wallclock_init = x86_init_noop,
80 },
81
82 .iommu = {
83 .iommu_init = iommu_init_noop,
84 },
85
86 .pci = {
87 .init = x86_default_pci_init,
88 .init_irq = x86_default_pci_init_irq,
89 .fixup_irqs = x86_default_pci_fixup_irqs,
90 },
91 };
92
93 struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
94 .early_percpu_clock_init = x86_init_noop,
95 .setup_percpu_clockev = setup_secondary_APIC_clock,
96 };
97
default_nmi_init(void)98 static void default_nmi_init(void) { };
default_i8042_detect(void)99 static int default_i8042_detect(void) { return 1; };
100
101 struct x86_platform_ops x86_platform = {
102 .calibrate_tsc = native_calibrate_tsc,
103 .wallclock_init = wallclock_init_noop,
104 .get_wallclock = mach_get_cmos_time,
105 .set_wallclock = mach_set_rtc_mmss,
106 .iommu_shutdown = iommu_shutdown_noop,
107 .is_untracked_pat_range = is_ISA_range,
108 .nmi_init = default_nmi_init,
109 .get_nmi_reason = default_get_nmi_reason,
110 .i8042_detect = default_i8042_detect,
111 .save_sched_clock_state = tsc_save_sched_clock_state,
112 .restore_sched_clock_state = tsc_restore_sched_clock_state,
113 };
114
115 EXPORT_SYMBOL_GPL(x86_platform);
116 struct x86_msi_ops x86_msi = {
117 .setup_msi_irqs = native_setup_msi_irqs,
118 .teardown_msi_irq = native_teardown_msi_irq,
119 .teardown_msi_irqs = default_teardown_msi_irqs,
120 .restore_msi_irqs = default_restore_msi_irqs,
121 };
122