ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / i386 / mach-pc9800 / setup.c
1 /*
2  *      Machine specific setup for pc9800
3  */
4
5 #include <linux/config.h>
6 #include <linux/mm.h>
7 #include <linux/smp.h>
8 #include <linux/init.h>
9 #include <linux/irq.h>
10 #include <linux/interrupt.h>
11 #include <linux/apm_bios.h>
12 #include <asm/setup.h>
13 #include <asm/arch_hooks.h>
14
15 struct sys_desc_table_struct {
16         unsigned short length;
17         unsigned char table[0];
18 };
19
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  * IRQ7 is cascade interrupt to second interrupt controller
36  */
37 static struct irqaction irq7 = { no_action, 0, 0, "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         setup_irq(7, &irq7);
55 }
56
57 /**
58  * pre_setup_arch_hook - hook called prior to any setup_arch() execution
59  *
60  * Description:
61  *      generally used to activate any machine specific identification
62  *      routines that may be needed before setup_arch() runs.  On VISWS
63  *      this is used to get the board revision and type.
64  **/
65 void __init pre_setup_arch_hook(void)
66 {
67         SYS_DESC_TABLE.length = 0;
68         MCA_bus = 0;
69         /* In PC-9800, APM BIOS version is written in BCD...?? */
70         APM_BIOS_INFO.version = (APM_BIOS_INFO.version & 0xff00)
71                                 | ((APM_BIOS_INFO.version & 0x00f0) >> 4);
72 }
73
74 /**
75  * trap_init_hook - initialise system specific traps
76  *
77  * Description:
78  *      Called as the final act of trap_init().  Used in VISWS to initialise
79  *      the various board specific APIC traps.
80  **/
81 void __init trap_init_hook(void)
82 {
83 }
84
85 static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
86
87 /**
88  * time_init_hook - do any specific initialisations for the system timer.
89  *
90  * Description:
91  *      Must plug the system timer interrupt source at HZ into the IRQ listed
92  *      in irq_vectors.h:TIMER_IRQ
93  **/
94 void __init time_init_hook(void)
95 {
96         setup_irq(0, &irq0);
97 }
98
99 #ifdef CONFIG_MCA
100 /**
101  * mca_nmi_hook - hook into MCA specific NMI chain
102  *
103  * Description:
104  *      The MCA (Microchannel Architecture) has an NMI chain for NMI sources
105  *      along the MCA bus.  Use this to hook into that chain if you will need
106  *      it.
107  **/
108 void __init mca_nmi_hook(void)
109 {
110         /* If I recall correctly, there's a whole bunch of other things that
111          * we can do to check for NMI problems, but that's all I know about
112          * at the moment.
113          */
114
115         printk("NMI generated from unknown source!\n");
116 }
117 #endif