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