blob: b00f5ad10ca11e50f975d6b07add96fb9029af62 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Machine specific setup for generic
3 */
4
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <linux/smp.h>
6#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <linux/interrupt.h>
8#include <asm/acpi.h>
9#include <asm/arch_hooks.h>
Jeremy Fitzhardingee75eac32006-06-25 05:46:50 -070010#include <asm/e820.h>
11#include <asm/setup.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Ashok Raj67664c82005-06-25 14:54:52 -070013#ifdef CONFIG_HOTPLUG_CPU
14#define DEFAULT_SEND_IPI (1)
15#else
16#define DEFAULT_SEND_IPI (0)
17#endif
18
19int no_broadcast=DEFAULT_SEND_IPI;
20
Linus Torvalds1da177e2005-04-16 15:20:36 -070021/**
22 * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
23 *
24 * Description:
25 * Perform any necessary interrupt initialisation prior to setting up
26 * the "ordinary" interrupt call gates. For legacy reasons, the ISA
27 * interrupts should be initialised here if the machine emulates a PC
28 * in any way.
29 **/
30void __init pre_intr_init_hook(void)
31{
Yinghai Lu3c9cb6d2008-07-19 02:07:25 -070032 if (x86_quirks->arch_pre_intr_init) {
33 if (x86_quirks->arch_pre_intr_init())
Ingo Molnar078c0bb2008-07-10 15:48:48 +020034 return;
35 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 init_ISA_irqs();
37}
38
Linus Torvalds1da177e2005-04-16 15:20:36 -070039/**
40 * intr_init_hook - post gate setup interrupt initialisation
41 *
42 * Description:
43 * Fill in any interrupts that may have been left out by the general
44 * init_IRQ() routine. interrupts having to do with the machine rather
45 * than the devices on the I/O bus (like APIC interrupts in intel MP
46 * systems) are started here.
47 **/
48void __init intr_init_hook(void)
49{
Yinghai Lu3c9cb6d2008-07-19 02:07:25 -070050 if (x86_quirks->arch_intr_init) {
51 if (x86_quirks->arch_intr_init())
Ingo Molnar078c0bb2008-07-10 15:48:48 +020052 return;
53 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070054}
55
56/**
57 * pre_setup_arch_hook - hook called prior to any setup_arch() execution
58 *
59 * Description:
60 * generally used to activate any machine specific identification
Ingo Molnar15e551d2008-07-10 17:02:10 +020061 * routines that may be needed before setup_arch() runs. On Voyager
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 * this is used to get the board revision and type.
63 **/
64void __init pre_setup_arch_hook(void)
65{
66}
67
68/**
69 * trap_init_hook - initialise system specific traps
70 *
71 * Description:
72 * Called as the final act of trap_init(). Used in VISWS to initialise
73 * the various board specific APIC traps.
74 **/
75void __init trap_init_hook(void)
76{
Yinghai Lu3c9cb6d2008-07-19 02:07:25 -070077 if (x86_quirks->arch_trap_init) {
78 if (x86_quirks->arch_trap_init())
Ingo Molnar078c0bb2008-07-10 15:48:48 +020079 return;
80 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070081}
82
Thomas Gleixnere9e2cdb2007-02-16 01:28:04 -080083static struct irqaction irq0 = {
84 .handler = timer_interrupt,
Bernhard Walleb34942f2007-05-08 00:35:29 -070085 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
Thomas Gleixnere9e2cdb2007-02-16 01:28:04 -080086 .mask = CPU_MASK_NONE,
87 .name = "timer"
88};
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
90/**
Yinghai Lu63b5d7a2008-07-19 18:02:26 -070091 * pre_time_init_hook - do any specific initialisations before.
92 *
93 **/
94void __init pre_time_init_hook(void)
95{
96 if (x86_quirks->arch_pre_time_init)
97 x86_quirks->arch_pre_time_init();
98}
99
100/**
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 * time_init_hook - do any specific initialisations for the system timer.
102 *
103 * Description:
104 * Must plug the system timer interrupt source at HZ into the IRQ listed
105 * in irq_vectors.h:TIMER_IRQ
106 **/
107void __init time_init_hook(void)
108{
Yinghai Lu3c9cb6d2008-07-19 02:07:25 -0700109 if (x86_quirks->arch_time_init) {
Ingo Molnar078c0bb2008-07-10 15:48:48 +0200110 /*
111 * A nonzero return code does not mean failure, it means
112 * that the architecture quirk does not want any
113 * generic (timer) setup to be performed after this:
114 */
Yinghai Lu3c9cb6d2008-07-19 02:07:25 -0700115 if (x86_quirks->arch_time_init())
Ingo Molnar078c0bb2008-07-10 15:48:48 +0200116 return;
117 }
118
Thomas Gleixnere9e2cdb2007-02-16 01:28:04 -0800119 irq0.mask = cpumask_of_cpu(0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 setup_irq(0, &irq0);
121}
122
123#ifdef CONFIG_MCA
124/**
125 * mca_nmi_hook - hook into MCA specific NMI chain
126 *
127 * Description:
Simon Arlott27b46d72007-10-20 01:13:56 +0200128 * The MCA (Microchannel Architecture) has an NMI chain for NMI sources
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 * along the MCA bus. Use this to hook into that chain if you will need
130 * it.
131 **/
Al Viroaaba6d42007-02-01 13:52:28 +0000132void mca_nmi_hook(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133{
134 /* If I recall correctly, there's a whole bunch of other things that
135 * we can do to check for NMI problems, but that's all I know about
136 * at the moment.
137 */
138
139 printk("NMI generated from unknown source!\n");
140}
141#endif
Ashok Raj67664c82005-06-25 14:54:52 -0700142
143static __init int no_ipi_broadcast(char *str)
144{
145 get_option(&str, &no_broadcast);
146 printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" :
147 "IPI Broadcast");
148 return 1;
149}
150
Robert P. J. Day4aad7942007-10-20 00:19:06 +0200151__setup("no_ipi_broadcast=", no_ipi_broadcast);
Ashok Raj67664c82005-06-25 14:54:52 -0700152
153static int __init print_ipi_mode(void)
154{
155 printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" :
156 "Shortcut");
157 return 0;
158}
159
160late_initcall(print_ipi_mode);
Jeremy Fitzhardingee75eac32006-06-25 05:46:50 -0700161