blob: 83b05adaadf1f73473f89840c63f3fcfe4b2293c [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>
Jack Steinerfd12a0d2009-11-19 14:23:41 -060021#include <asm/pat.h>
Thomas Gleixner2d826402009-08-20 17:06:25 +020022#include <asm/tsc.h>
FUJITA Tomonori338bac52009-10-27 16:34:44 +090023#include <asm/iommu.h>
Jacob Pan064a59b2011-11-10 13:43:05 +000024#include <asm/mach_traps.h>
Thomas Gleixner57844a82009-08-19 14:48:38 +020025
26void __cpuinit x86_init_noop(void) { }
Thomas Gleixnerf4848472009-08-20 12:05:01 +020027void __init x86_init_uint_noop(unsigned int unused) { }
Thomas Gleixner030cb6c2009-08-20 14:30:02 +020028void __init x86_init_pgd_noop(pgd_t *unused) { }
FUJITA Tomonorid07c1be2009-11-10 19:46:12 +090029int __init iommu_init_noop(void) { return 0; }
Hiroshi Shimamoto62ad33f2009-11-16 11:44:30 +090030void iommu_shutdown_noop(void) { }
Feng Tangcf8ff6b2011-11-10 13:42:02 +000031void wallclock_init_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
Stefano Stabellini279b7062011-04-14 15:49:41 +010066 .mapping = {
67 .pagetable_reserve = native_pagetable_reserve,
68 },
69
Thomas Gleixner030cb6c2009-08-20 14:30:02 +020070 .paging = {
71 .pagetable_setup_start = native_pagetable_setup_start,
72 .pagetable_setup_done = native_pagetable_setup_done,
73 },
Thomas Gleixner736deca2009-08-19 12:35:53 +020074
75 .timers = {
76 .setup_percpu_clockev = setup_boot_APIC_clock,
Thomas Gleixner845b3942009-08-19 15:37:03 +020077 .tsc_pre_init = x86_init_noop,
78 .timer_init = hpet_time_init,
Feng Tang6b617e22011-02-15 00:13:31 +080079 .wallclock_init = x86_init_noop,
Thomas Gleixner736deca2009-08-19 12:35:53 +020080 },
FUJITA Tomonorid07c1be2009-11-10 19:46:12 +090081
82 .iommu = {
83 .iommu_init = iommu_init_noop,
84 },
Thomas Gleixnerb72d0db2009-08-29 16:24:51 +020085
86 .pci = {
87 .init = x86_default_pci_init,
Thomas Gleixnerab3b3792009-08-29 17:47:33 +020088 .init_irq = x86_default_pci_init_irq,
Thomas Gleixner9325a282009-08-29 17:51:26 +020089 .fixup_irqs = x86_default_pci_fixup_irqs,
Thomas Gleixnerb72d0db2009-08-29 16:24:51 +020090 },
Thomas Gleixner736deca2009-08-19 12:35:53 +020091};
92
Thomas Gleixner54e26032009-09-16 08:42:26 +020093struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
Thomas Gleixner736deca2009-08-19 12:35:53 +020094 .setup_percpu_clockev = setup_secondary_APIC_clock,
Thomas Gleixner57844a82009-08-19 14:48:38 +020095};
Thomas Gleixner2d826402009-08-20 17:06:25 +020096
Russ Anderson78c06172010-02-26 10:49:12 -060097static void default_nmi_init(void) { };
Feng Tangc516ac52010-07-05 23:03:18 +080098static int default_i8042_detect(void) { return 1; };
Russ Anderson78c06172010-02-26 10:49:12 -060099
Thomas Gleixner2d826402009-08-20 17:06:25 +0200100struct x86_platform_ops x86_platform = {
101 .calibrate_tsc = native_calibrate_tsc,
Feng Tangcf8ff6b2011-11-10 13:42:02 +0000102 .wallclock_init = wallclock_init_noop,
Feng Tang7bd867d2009-09-10 10:48:56 +0800103 .get_wallclock = mach_get_cmos_time,
104 .set_wallclock = mach_set_rtc_mmss,
FUJITA Tomonori338bac52009-10-27 16:34:44 +0900105 .iommu_shutdown = iommu_shutdown_noop,
H. Peter Anvineb41c8b2009-11-23 14:46:07 -0800106 .is_untracked_pat_range = is_ISA_range,
Feng Tangc516ac52010-07-05 23:03:18 +0800107 .nmi_init = default_nmi_init,
Jacob Pan064a59b2011-11-10 13:43:05 +0000108 .get_nmi_reason = default_get_nmi_reason,
Feng Tangc516ac52010-07-05 23:03:18 +0800109 .i8042_detect = default_i8042_detect
Thomas Gleixner2d826402009-08-20 17:06:25 +0200110};
H. Peter Anvin72550b32010-07-07 16:57:46 -0700111
112EXPORT_SYMBOL_GPL(x86_platform);
Stefano Stabellini294ee6f2010-10-06 16:12:28 -0400113struct x86_msi_ops x86_msi = {
114 .setup_msi_irqs = native_setup_msi_irqs,
115 .teardown_msi_irq = native_teardown_msi_irq,
116 .teardown_msi_irqs = default_teardown_msi_irqs,
Konrad Rzeszutek Wilk76ccc292011-12-16 17:38:18 -0500117 .restore_msi_irqs = default_restore_msi_irqs,
Stefano Stabellini294ee6f2010-10-06 16:12:28 -0400118};