]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/x86/include/asm/x86_init.h
PCI/portdrv: Remove superfluous name cast
[mirror_ubuntu-artful-kernel.git] / arch / x86 / include / asm / x86_init.h
CommitLineData
57844a8f
TG
1#ifndef _ASM_X86_PLATFORM_H
2#define _ASM_X86_PLATFORM_H
3
030cb6c0 4#include <asm/pgtable_types.h>
47a3d5da 5#include <asm/bootparam.h>
030cb6c0 6
52fdb568 7struct mpc_bus;
fd6c6661 8struct mpc_cpu;
72302142 9struct mpc_table;
64be4c1c 10struct cpuinfo_x86;
fd6c6661 11
f4848472
TG
12/**
13 * struct x86_init_mpparse - platform specific mpparse ops
14 * @mpc_record: platform specific mpc record accounting
de934103 15 * @setup_ioapic_ids: platform specific ioapic id override
fd6c6661 16 * @mpc_apic_id: platform specific mpc apic id assignment
72302142 17 * @smp_read_mpc_oem: platform specific oem mpc table setup
52fdb568 18 * @mpc_oem_pci_bus: platform specific pci bus setup (default NULL)
90e1c696 19 * @mpc_oem_bus_info: platform specific mpc bus info
b3f1b617
TG
20 * @find_smp_config: find the smp configuration
21 * @get_smp_config: get the smp configuration
f4848472
TG
22 */
23struct x86_init_mpparse {
24 void (*mpc_record)(unsigned int mode);
de934103 25 void (*setup_ioapic_ids)(void);
fd6c6661 26 int (*mpc_apic_id)(struct mpc_cpu *m);
72302142 27 void (*smp_read_mpc_oem)(struct mpc_table *mpc);
52fdb568 28 void (*mpc_oem_pci_bus)(struct mpc_bus *m);
90e1c696 29 void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
b24c2a92 30 void (*find_smp_config)(void);
b3f1b617 31 void (*get_smp_config)(unsigned int early);
f4848472
TG
32};
33
f7cf5a5b
TG
34/**
35 * struct x86_init_resources - platform specific resource related ops
36 * @probe_roms: probe BIOS roms
8fee697d
TG
37 * @reserve_resources: reserve the standard resources for the
38 * platform
6b18ae3e 39 * @memory_setup: platform specific memory setup
f7cf5a5b
TG
40 *
41 */
42struct x86_init_resources {
43 void (*probe_roms)(void);
8fee697d 44 void (*reserve_resources)(void);
6b18ae3e 45 char *(*memory_setup)(void);
f7cf5a5b
TG
46};
47
d9112f43
TG
48/**
49 * struct x86_init_irqs - platform specific interrupt setup
50 * @pre_vector_init: init code to run before interrupt vectors
51 * are set up.
66bcaf0b 52 * @intr_init: interrupt init code
428cf902 53 * @trap_init: platform specific trap setup
d9112f43
TG
54 */
55struct x86_init_irqs {
56 void (*pre_vector_init)(void);
66bcaf0b 57 void (*intr_init)(void);
428cf902 58 void (*trap_init)(void);
d9112f43
TG
59};
60
42bbdb43
TG
61/**
62 * struct x86_init_oem - oem platform specific customizing functions
63 * @arch_setup: platform specific architecure setup
6f30c1ac 64 * @banner: print a platform specific banner
42bbdb43
TG
65 */
66struct x86_init_oem {
67 void (*arch_setup)(void);
6f30c1ac 68 void (*banner)(void);
42bbdb43
TG
69};
70
030cb6c0
TG
71/**
72 * struct x86_init_paging - platform specific paging functions
64282278
AR
73 * @pagetable_init: platform specific paging initialization call to setup
74 * the kernel pagetables and prepare accessors functions.
75 * Callback must call paging_init(). Called once after the
76 * direct mapping for phys memory is available.
030cb6c0
TG
77 */
78struct x86_init_paging {
7737b215 79 void (*pagetable_init)(void);
030cb6c0
TG
80};
81
736decac
TG
82/**
83 * struct x86_init_timers - platform specific timer setup
84 * @setup_perpcu_clockev: set up the per cpu clock event device for the
85 * boot cpu
845b3944
TG
86 * @tsc_pre_init: platform function called before TSC init
87 * @timer_init: initialize the platform timer (default PIT/HPET)
6b617e22 88 * @wallclock_init: init the wallclock device
736decac
TG
89 */
90struct x86_init_timers {
91 void (*setup_percpu_clockev)(void);
845b3944
TG
92 void (*tsc_pre_init)(void);
93 void (*timer_init)(void);
6b617e22 94 void (*wallclock_init)(void);
736decac
TG
95};
96
d07c1be0
FT
97/**
98 * struct x86_init_iommu - platform specific iommu setup
99 * @iommu_init: platform specific iommu setup
100 */
101struct x86_init_iommu {
102 int (*iommu_init)(void);
103};
104
4fb6088a
TG
105/**
106 * struct x86_init_pci - platform specific pci init functions
107 * @arch_init: platform specific pci arch init call
108 * @init: platform specific pci subsystem init
ab3b3793 109 * @init_irq: platform specific pci irq init
9325a28c 110 * @fixup_irqs: platform specific pci irq fixup
b72d0db9
TG
111 */
112struct x86_init_pci {
4fb6088a 113 int (*arch_init)(void);
b72d0db9 114 int (*init)(void);
ab3b3793 115 void (*init_irq)(void);
9325a28c 116 void (*fixup_irqs)(void);
b72d0db9
TG
117};
118
57844a8f
TG
119/**
120 * struct x86_init_ops - functions for platform specific setup
121 *
122 */
123struct x86_init_ops {
f4848472
TG
124 struct x86_init_resources resources;
125 struct x86_init_mpparse mpparse;
d9112f43 126 struct x86_init_irqs irqs;
42bbdb43 127 struct x86_init_oem oem;
030cb6c0 128 struct x86_init_paging paging;
736decac 129 struct x86_init_timers timers;
d07c1be0 130 struct x86_init_iommu iommu;
b72d0db9 131 struct x86_init_pci pci;
736decac
TG
132};
133
134/**
135 * struct x86_cpuinit_ops - platform specific cpu hotplug setups
136 * @setup_percpu_clockev: set up the per cpu clock event device
df156f90 137 * @early_percpu_clock_init: early init of the per cpu clock event device
736decac
TG
138 */
139struct x86_cpuinit_ops {
140 void (*setup_percpu_clockev)(void);
df156f90 141 void (*early_percpu_clock_init)(void);
64be4c1c 142 void (*fixup_cpu_id)(struct cpuinfo_x86 *c, int node);
57844a8f
TG
143};
144
3565184e
DV
145struct timespec;
146
2d826404
TG
147/**
148 * struct x86_platform_ops - platform specific runtime functions
149 * @calibrate_tsc: calibrate TSC
7bd867df
FT
150 * @get_wallclock: get time from HW clock like RTC etc.
151 * @set_wallclock: set time back to HW clock
eb41c8be 152 * @is_untracked_pat_range exclude from PAT logic
78c06176 153 * @nmi_init enable NMI on cpus
c516ac58 154 * @i8042_detect pre-detect if i8042 controller exists
b74f05d6
MT
155 * @save_sched_clock_state: save state for sched_clock() on suspend
156 * @restore_sched_clock_state: restore state for sched_clock() on resume
7db971b2 157 * @apic_post_init: adjust apic if neeeded
2d826404
TG
158 */
159struct x86_platform_ops {
160 unsigned long (*calibrate_tsc)(void);
3565184e
DV
161 void (*get_wallclock)(struct timespec *ts);
162 int (*set_wallclock)(const struct timespec *ts);
338bac52 163 void (*iommu_shutdown)(void);
eb41c8be 164 bool (*is_untracked_pat_range)(u64 start, u64 end);
78c06176 165 void (*nmi_init)(void);
064a59b6 166 unsigned char (*get_nmi_reason)(void);
c516ac58 167 int (*i8042_detect)(void);
b74f05d6
MT
168 void (*save_sched_clock_state)(void);
169 void (*restore_sched_clock_state)(void);
7db971b2 170 void (*apic_post_init)(void);
2d826404
TG
171};
172
294ee6f8 173struct pci_dev;
7601384f 174struct msi_msg;
0e4ccb15 175struct msi_desc;
294ee6f8
SS
176
177struct x86_msi_ops {
178 int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type);
7601384f
JR
179 void (*compose_msi_msg)(struct pci_dev *dev, unsigned int irq,
180 unsigned int dest, struct msi_msg *msg,
181 u8 hpet_id);
294ee6f8
SS
182 void (*teardown_msi_irq)(unsigned int irq);
183 void (*teardown_msi_irqs)(struct pci_dev *dev);
76ccc297 184 void (*restore_msi_irqs)(struct pci_dev *dev, int irq);
71054d88 185 int (*setup_hpet_msi)(unsigned int irq, unsigned int id);
0e4ccb15
KRW
186 u32 (*msi_mask_irq)(struct msi_desc *desc, u32 mask, u32 flag);
187 u32 (*msix_mask_irq)(struct msi_desc *desc, u32 flag);
294ee6f8
SS
188};
189
a6a25dd3
JR
190struct IO_APIC_route_entry;
191struct io_apic_irq_attr;
373dd7a2
JR
192struct irq_data;
193struct cpumask;
194
4a8e2a31 195struct x86_io_apic_ops {
1c4248ca
JR
196 void (*init) (void);
197 unsigned int (*read) (unsigned int apic, unsigned int reg);
198 void (*write) (unsigned int apic, unsigned int reg, unsigned int value);
199 void (*modify) (unsigned int apic, unsigned int reg, unsigned int value);
200 void (*disable)(void);
afcc8a40 201 void (*print_entries)(unsigned int apic, unsigned int nr_entries);
373dd7a2
JR
202 int (*set_affinity)(struct irq_data *data,
203 const struct cpumask *mask,
204 bool force);
a6a25dd3
JR
205 int (*setup_entry)(int irq, struct IO_APIC_route_entry *entry,
206 unsigned int destination, int vector,
207 struct io_apic_irq_attr *attr);
da165322 208 void (*eoi_ioapic_pin)(int apic, int pin, int vector);
4a8e2a31
KRW
209};
210
57844a8f 211extern struct x86_init_ops x86_init;
736decac 212extern struct x86_cpuinit_ops x86_cpuinit;
2d826404 213extern struct x86_platform_ops x86_platform;
294ee6f8 214extern struct x86_msi_ops x86_msi;
4a8e2a31 215extern struct x86_io_apic_ops x86_io_apic_ops;
57844a8f 216extern void x86_init_noop(void);
f4848472 217extern void x86_init_uint_noop(unsigned int unused);
57844a8f
TG
218
219#endif