blob: 45a14dbbddafe602a4910ce90fc59b5b7ac08ee2 [file] [log] [blame]
Thomas Gleixner57844a82009-08-19 14:48:38 +02001/*
2 * Copyright (C) 2009 Thomas Gleixner <tglx@linutronix.de>
3 *
4 * For licencing details see kernel-base/COPYING
5 */
6#include <linux/init.h>
Thomas Gleixner9325a282009-08-29 17:51:26 +02007#include <linux/ioport.h>
H. Peter Anvin72550b32010-07-07 16:57:46 -07008#include <linux/module.h>
Stefano Stabellini294ee6f2010-10-06 16:12:28 -04009#include <linux/pci.h>
Thomas Gleixner57844a82009-08-19 14:48:38 +020010
Thomas Gleixner816c25e2009-08-19 14:36:27 +020011#include <asm/bios_ebda.h>
Thomas Gleixner6f30c1a2009-08-20 13:19:57 +020012#include <asm/paravirt.h>
Thomas Gleixnerb72d0db2009-08-29 16:24:51 +020013#include <asm/pci_x86.h>
Stefano Stabellini294ee6f2010-10-06 16:12:28 -040014#include <asm/pci.h>
Thomas Gleixnerfd6c6662009-08-20 10:41:58 +020015#include <asm/mpspec.h>
Thomas Gleixner8fee6972009-08-19 14:55:50 +020016#include <asm/setup.h>
Thomas Gleixner736deca2009-08-19 12:35:53 +020017#include <asm/apic.h>
Thomas Gleixner6b18ae32009-08-20 10:19:54 +020018#include <asm/e820.h>
Thomas Gleixner845b3942009-08-19 15:37:03 +020019#include <asm/time.h>
Thomas Gleixnerd9112f42009-08-20 09:41:38 +020020#include <asm/irq.h>
Konrad Rzeszutek Wilk4a8e2a32012-03-28 12:37:36 -040021#include <asm/io_apic.h>
Joerg Roedel71054d82012-09-26 12:44:37 +020022#include <asm/hpet.h>
Jack Steinerfd12a0d2009-11-19 14:23:41 -060023#include <asm/pat.h>
Thomas Gleixner2d826402009-08-20 17:06:25 +020024#include <asm/tsc.h>
FUJITA Tomonori338bac52009-10-27 16:34:44 +090025#include <asm/iommu.h>
Jacob Pan064a59b2011-11-10 13:43:05 +000026#include <asm/mach_traps.h>
Thomas Gleixner57844a82009-08-19 14:48:38 +020027
28void __cpuinit x86_init_noop(void) { }
Thomas Gleixnerf4848472009-08-20 12:05:01 +020029void __init x86_init_uint_noop(unsigned int unused) { }
FUJITA Tomonorid07c1be2009-11-10 19:46:12 +090030int __init iommu_init_noop(void) { return 0; }
Hiroshi Shimamoto62ad33f2009-11-16 11:44:30 +090031void iommu_shutdown_noop(void) { }
Thomas Gleixner57844a82009-08-19 14:48:38 +020032
33/*
34 * The platform setup functions are preset with the default functions
35 * for standard PC hardware.
36 */
Thomas Gleixner54e26032009-09-16 08:42:26 +020037struct x86_init_ops x86_init __initdata = {
Thomas Gleixnerf7cf5a52009-08-19 14:43:56 +020038
39 .resources = {
Dan Williams5d94e812011-03-08 10:36:19 -080040 .probe_roms = probe_roms,
Thomas Gleixner8fee6972009-08-19 14:55:50 +020041 .reserve_resources = reserve_standard_io_resources,
Thomas Gleixner6b18ae32009-08-20 10:19:54 +020042 .memory_setup = default_machine_specific_memory_setup,
Thomas Gleixnerf7cf5a52009-08-19 14:43:56 +020043 },
Thomas Gleixnerf4848472009-08-20 12:05:01 +020044
45 .mpparse = {
46 .mpc_record = x86_init_uint_noop,
Thomas Gleixnerde934102009-08-20 09:27:29 +020047 .setup_ioapic_ids = x86_init_noop,
Thomas Gleixnerfd6c6662009-08-20 10:41:58 +020048 .mpc_apic_id = default_mpc_apic_id,
Thomas Gleixner72302142009-08-20 12:18:32 +020049 .smp_read_mpc_oem = default_smp_read_mpc_oem,
Thomas Gleixner90e1c692009-08-20 12:34:47 +020050 .mpc_oem_bus_info = default_mpc_oem_bus_info,
Thomas Gleixnerb3f1b612009-08-20 11:11:52 +020051 .find_smp_config = default_find_smp_config,
52 .get_smp_config = default_get_smp_config,
Thomas Gleixnerf4848472009-08-20 12:05:01 +020053 },
Thomas Gleixnerd9112f42009-08-20 09:41:38 +020054
55 .irqs = {
56 .pre_vector_init = init_ISA_irqs,
Thomas Gleixner66bcaf02009-08-20 09:59:09 +020057 .intr_init = native_init_IRQ,
Thomas Gleixner428cf902009-08-20 10:35:46 +020058 .trap_init = x86_init_noop,
Thomas Gleixnerd9112f42009-08-20 09:41:38 +020059 },
Thomas Gleixner42bbdb42009-08-20 13:04:10 +020060
61 .oem = {
62 .arch_setup = x86_init_noop,
Thomas Gleixner6f30c1a2009-08-20 13:19:57 +020063 .banner = default_banner,
Thomas Gleixner42bbdb42009-08-20 13:04:10 +020064 },
Thomas Gleixner030cb6c2009-08-20 14:30:02 +020065
66 .paging = {
Attilio Rao7737b212012-08-21 21:22:38 +010067 .pagetable_init = native_pagetable_init,
Thomas Gleixner030cb6c2009-08-20 14:30:02 +020068 },
Thomas Gleixner736deca2009-08-19 12:35:53 +020069
70 .timers = {
71 .setup_percpu_clockev = setup_boot_APIC_clock,
Thomas Gleixner845b3942009-08-19 15:37:03 +020072 .tsc_pre_init = x86_init_noop,
73 .timer_init = hpet_time_init,
Feng Tang6b617e22011-02-15 00:13:31 +080074 .wallclock_init = x86_init_noop,
Thomas Gleixner736deca2009-08-19 12:35:53 +020075 },
FUJITA Tomonorid07c1be2009-11-10 19:46:12 +090076
77 .iommu = {
78 .iommu_init = iommu_init_noop,
79 },
Thomas Gleixnerb72d0db2009-08-29 16:24:51 +020080
81 .pci = {
82 .init = x86_default_pci_init,
Thomas Gleixnerab3b3792009-08-29 17:47:33 +020083 .init_irq = x86_default_pci_init_irq,
Thomas Gleixner9325a282009-08-29 17:51:26 +020084 .fixup_irqs = x86_default_pci_fixup_irqs,
Thomas Gleixnerb72d0db2009-08-29 16:24:51 +020085 },
Thomas Gleixner736deca2009-08-19 12:35:53 +020086};
87
Thomas Gleixner54e26032009-09-16 08:42:26 +020088struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
Igor Mammedovdf156f92012-02-07 15:52:44 +010089 .early_percpu_clock_init = x86_init_noop,
Thomas Gleixner736deca2009-08-19 12:35:53 +020090 .setup_percpu_clockev = setup_secondary_APIC_clock,
Thomas Gleixner57844a82009-08-19 14:48:38 +020091};
Thomas Gleixner2d826402009-08-20 17:06:25 +020092
Russ Anderson78c06172010-02-26 10:49:12 -060093static void default_nmi_init(void) { };
Feng Tangc516ac52010-07-05 23:03:18 +080094static int default_i8042_detect(void) { return 1; };
Russ Anderson78c06172010-02-26 10:49:12 -060095
Thomas Gleixner2d826402009-08-20 17:06:25 +020096struct x86_platform_ops x86_platform = {
97 .calibrate_tsc = native_calibrate_tsc,
Feng Tang7bd867d2009-09-10 10:48:56 +080098 .get_wallclock = mach_get_cmos_time,
99 .set_wallclock = mach_set_rtc_mmss,
FUJITA Tomonori338bac52009-10-27 16:34:44 +0900100 .iommu_shutdown = iommu_shutdown_noop,
H. Peter Anvineb41c8b2009-11-23 14:46:07 -0800101 .is_untracked_pat_range = is_ISA_range,
Feng Tangc516ac52010-07-05 23:03:18 +0800102 .nmi_init = default_nmi_init,
Jacob Pan064a59b2011-11-10 13:43:05 +0000103 .get_nmi_reason = default_get_nmi_reason,
Marcelo Tosattib74f05d62012-02-13 11:07:27 -0200104 .i8042_detect = default_i8042_detect,
105 .save_sched_clock_state = tsc_save_sched_clock_state,
106 .restore_sched_clock_state = tsc_restore_sched_clock_state,
Thomas Gleixner2d826402009-08-20 17:06:25 +0200107};
H. Peter Anvin72550b32010-07-07 16:57:46 -0700108
109EXPORT_SYMBOL_GPL(x86_platform);
Stefano Stabellini294ee6f2010-10-06 16:12:28 -0400110struct x86_msi_ops x86_msi = {
Joerg Roedel71054d82012-09-26 12:44:37 +0200111 .setup_msi_irqs = native_setup_msi_irqs,
Joerg Roedel76013842012-09-26 12:44:49 +0200112 .compose_msi_msg = native_compose_msi_msg,
Joerg Roedel71054d82012-09-26 12:44:37 +0200113 .teardown_msi_irq = native_teardown_msi_irq,
114 .teardown_msi_irqs = default_teardown_msi_irqs,
115 .restore_msi_irqs = default_restore_msi_irqs,
116 .setup_hpet_msi = default_setup_hpet_msi,
Stefano Stabellini294ee6f2010-10-06 16:12:28 -0400117};
Konrad Rzeszutek Wilk4a8e2a32012-03-28 12:37:36 -0400118
119struct x86_io_apic_ops x86_io_apic_ops = {
Joerg Roedel1c4248c2012-09-26 12:44:35 +0200120 .init = native_io_apic_init_mappings,
121 .read = native_io_apic_read,
122 .write = native_io_apic_write,
123 .modify = native_io_apic_modify,
124 .disable = native_disable_io_apic,
Joerg Roedelafcc8a42012-09-26 12:44:36 +0200125 .print_entries = native_io_apic_print_entries,
Joerg Roedel373dd7a2012-09-26 12:44:39 +0200126 .set_affinity = native_ioapic_set_affinity,
Joerg Roedela6a25dd2012-09-26 12:44:40 +0200127 .setup_entry = native_setup_ioapic_entry,
Joerg Roedelda165322012-09-26 12:44:50 +0200128 .eoi_ioapic_pin = native_eoi_ioapic_pin,
Konrad Rzeszutek Wilk4a8e2a32012-03-28 12:37:36 -0400129};