x86_init.c 2.9 KB
Newer Older
1 2 3 4 5 6
/*
 * Copyright (C) 2009 Thomas Gleixner <tglx@linutronix.de>
 *
 *  For licencing details see kernel-base/COPYING
 */
#include <linux/init.h>
7
#include <linux/ioport.h>
8
#include <linux/module.h>
S
Stefano Stabellini 已提交
9
#include <linux/pci.h>
10

11
#include <asm/bios_ebda.h>
12
#include <asm/paravirt.h>
13
#include <asm/pci_x86.h>
S
Stefano Stabellini 已提交
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 25

void __cpuinit x86_init_noop(void) { }
26
void __init x86_init_uint_noop(unsigned int unused) { }
27
void __init x86_init_pgd_noop(pgd_t *unused) { }
28
int __init iommu_init_noop(void) { return 0; }
29
void iommu_shutdown_noop(void) { }
30
void wallclock_init_noop(void) { }
31 32 33 34 35

/*
 * The platform setup functions are preset with the default functions
 * for standard PC hardware.
 */
36
struct x86_init_ops x86_init __initdata = {
37 38

	.resources = {
D
Dan Williams 已提交
39
		.probe_roms		= probe_roms,
40
		.reserve_resources	= reserve_standard_io_resources,
41
		.memory_setup		= default_machine_specific_memory_setup,
42
	},
43 44 45

	.mpparse = {
		.mpc_record		= x86_init_uint_noop,
46
		.setup_ioapic_ids	= x86_init_noop,
47
		.mpc_apic_id		= default_mpc_apic_id,
48
		.smp_read_mpc_oem	= default_smp_read_mpc_oem,
49
		.mpc_oem_bus_info	= default_mpc_oem_bus_info,
50 51
		.find_smp_config	= default_find_smp_config,
		.get_smp_config		= default_get_smp_config,
52
	},
53 54 55

	.irqs = {
		.pre_vector_init	= init_ISA_irqs,
56
		.intr_init		= native_init_IRQ,
57
		.trap_init		= x86_init_noop,
58
	},
59 60 61

	.oem = {
		.arch_setup		= x86_init_noop,
62
		.banner			= default_banner,
63
	},
64

65 66 67 68
	.mapping = {
		.pagetable_reserve		= native_pagetable_reserve,
	},

69 70 71 72
	.paging = {
		.pagetable_setup_start	= native_pagetable_setup_start,
		.pagetable_setup_done	= native_pagetable_setup_done,
	},
73 74 75

	.timers = {
		.setup_percpu_clockev	= setup_boot_APIC_clock,
76 77
		.tsc_pre_init		= x86_init_noop,
		.timer_init		= hpet_time_init,
78
		.wallclock_init		= x86_init_noop,
79
	},
80 81 82 83

	.iommu = {
		.iommu_init		= iommu_init_noop,
	},
84 85 86

	.pci = {
		.init			= x86_default_pci_init,
87
		.init_irq		= x86_default_pci_init_irq,
88
		.fixup_irqs		= x86_default_pci_fixup_irqs,
89
	},
90 91
};

92
struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
93
	.setup_percpu_clockev		= setup_secondary_APIC_clock,
94
};
95

96
static void default_nmi_init(void) { };
97
static int default_i8042_detect(void) { return 1; };
98

99 100
struct x86_platform_ops x86_platform = {
	.calibrate_tsc			= native_calibrate_tsc,
101
	.wallclock_init			= wallclock_init_noop,
102 103
	.get_wallclock			= mach_get_cmos_time,
	.set_wallclock			= mach_set_rtc_mmss,
104
	.iommu_shutdown			= iommu_shutdown_noop,
105
	.is_untracked_pat_range		= is_ISA_range,
106 107
	.nmi_init			= default_nmi_init,
	.i8042_detect			= default_i8042_detect
108
};
109 110

EXPORT_SYMBOL_GPL(x86_platform);
S
Stefano Stabellini 已提交
111 112 113 114 115
struct x86_msi_ops x86_msi = {
	.setup_msi_irqs = native_setup_msi_irqs,
	.teardown_msi_irq = native_teardown_msi_irq,
	.teardown_msi_irqs = default_teardown_msi_irqs,
};