| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | *	Machine specific setup for generic | 
|  | 3 | */ | 
|  | 4 |  | 
|  | 5 | #include <linux/config.h> | 
|  | 6 | #include <linux/smp.h> | 
|  | 7 | #include <linux/init.h> | 
|  | 8 | #include <linux/irq.h> | 
|  | 9 | #include <linux/interrupt.h> | 
|  | 10 | #include <asm/acpi.h> | 
|  | 11 | #include <asm/arch_hooks.h> | 
|  | 12 |  | 
| Ashok Raj | 67664c8 | 2005-06-25 14:54:52 -0700 | [diff] [blame] | 13 | #ifdef CONFIG_HOTPLUG_CPU | 
|  | 14 | #define DEFAULT_SEND_IPI	(1) | 
|  | 15 | #else | 
|  | 16 | #define DEFAULT_SEND_IPI	(0) | 
|  | 17 | #endif | 
|  | 18 |  | 
|  | 19 | int no_broadcast=DEFAULT_SEND_IPI; | 
|  | 20 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | /** | 
|  | 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 | **/ | 
|  | 30 | void __init pre_intr_init_hook(void) | 
|  | 31 | { | 
|  | 32 | init_ISA_irqs(); | 
|  | 33 | } | 
|  | 34 |  | 
|  | 35 | /* | 
|  | 36 | * IRQ2 is cascade interrupt to second interrupt controller | 
|  | 37 | */ | 
|  | 38 | static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL}; | 
|  | 39 |  | 
|  | 40 | /** | 
|  | 41 | * intr_init_hook - post gate setup interrupt initialisation | 
|  | 42 | * | 
|  | 43 | * Description: | 
|  | 44 | *	Fill in any interrupts that may have been left out by the general | 
|  | 45 | *	init_IRQ() routine.  interrupts having to do with the machine rather | 
|  | 46 | *	than the devices on the I/O bus (like APIC interrupts in intel MP | 
|  | 47 | *	systems) are started here. | 
|  | 48 | **/ | 
|  | 49 | void __init intr_init_hook(void) | 
|  | 50 | { | 
|  | 51 | #ifdef CONFIG_X86_LOCAL_APIC | 
|  | 52 | apic_intr_init(); | 
|  | 53 | #endif | 
|  | 54 |  | 
|  | 55 | if (!acpi_ioapic) | 
|  | 56 | setup_irq(2, &irq2); | 
|  | 57 | } | 
|  | 58 |  | 
|  | 59 | /** | 
|  | 60 | * pre_setup_arch_hook - hook called prior to any setup_arch() execution | 
|  | 61 | * | 
|  | 62 | * Description: | 
|  | 63 | *	generally used to activate any machine specific identification | 
|  | 64 | *	routines that may be needed before setup_arch() runs.  On VISWS | 
|  | 65 | *	this is used to get the board revision and type. | 
|  | 66 | **/ | 
|  | 67 | void __init pre_setup_arch_hook(void) | 
|  | 68 | { | 
|  | 69 | } | 
|  | 70 |  | 
|  | 71 | /** | 
|  | 72 | * trap_init_hook - initialise system specific traps | 
|  | 73 | * | 
|  | 74 | * Description: | 
|  | 75 | *	Called as the final act of trap_init().  Used in VISWS to initialise | 
|  | 76 | *	the various board specific APIC traps. | 
|  | 77 | **/ | 
|  | 78 | void __init trap_init_hook(void) | 
|  | 79 | { | 
|  | 80 | } | 
|  | 81 |  | 
|  | 82 | static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL}; | 
|  | 83 |  | 
|  | 84 | /** | 
|  | 85 | * time_init_hook - do any specific initialisations for the system timer. | 
|  | 86 | * | 
|  | 87 | * Description: | 
|  | 88 | *	Must plug the system timer interrupt source at HZ into the IRQ listed | 
|  | 89 | *	in irq_vectors.h:TIMER_IRQ | 
|  | 90 | **/ | 
|  | 91 | void __init time_init_hook(void) | 
|  | 92 | { | 
|  | 93 | setup_irq(0, &irq0); | 
|  | 94 | } | 
|  | 95 |  | 
|  | 96 | #ifdef CONFIG_MCA | 
|  | 97 | /** | 
|  | 98 | * mca_nmi_hook - hook into MCA specific NMI chain | 
|  | 99 | * | 
|  | 100 | * Description: | 
|  | 101 | *	The MCA (Microchannel Arcitecture) has an NMI chain for NMI sources | 
|  | 102 | *	along the MCA bus.  Use this to hook into that chain if you will need | 
|  | 103 | *	it. | 
|  | 104 | **/ | 
|  | 105 | void __init mca_nmi_hook(void) | 
|  | 106 | { | 
|  | 107 | /* If I recall correctly, there's a whole bunch of other things that | 
|  | 108 | * we can do to check for NMI problems, but that's all I know about | 
|  | 109 | * at the moment. | 
|  | 110 | */ | 
|  | 111 |  | 
|  | 112 | printk("NMI generated from unknown source!\n"); | 
|  | 113 | } | 
|  | 114 | #endif | 
| Ashok Raj | 67664c8 | 2005-06-25 14:54:52 -0700 | [diff] [blame] | 115 |  | 
|  | 116 | static __init int no_ipi_broadcast(char *str) | 
|  | 117 | { | 
|  | 118 | get_option(&str, &no_broadcast); | 
|  | 119 | printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" : | 
|  | 120 | "IPI Broadcast"); | 
|  | 121 | return 1; | 
|  | 122 | } | 
|  | 123 |  | 
|  | 124 | __setup("no_ipi_broadcast", no_ipi_broadcast); | 
|  | 125 |  | 
|  | 126 | static int __init print_ipi_mode(void) | 
|  | 127 | { | 
|  | 128 | printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" : | 
|  | 129 | "Shortcut"); | 
|  | 130 | return 0; | 
|  | 131 | } | 
|  | 132 |  | 
|  | 133 | late_initcall(print_ipi_mode); |