* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / arch / m68k / sun3x / config.c
blob6983e5850f9aac064d635474cd5b8ea4cd2915ee
1 /*
2 * Setup kernel for a Sun3x machine
4 * (C) 1999 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
6 * based on code from Oliver Jowett <oliver@jowett.manawatu.gen.nz>
7 */
9 #include <linux/types.h>
10 #include <linux/mm.h>
11 #include <linux/console.h>
12 #include <linux/init.h>
14 #include <asm/system.h>
15 #include <asm/machdep.h>
16 #include <asm/irq.h>
17 #include <asm/sun3x.h>
19 #include "time.h"
21 static volatile unsigned char *sun3x_intreg = (unsigned char *)SUN3X_INTREG;
22 extern int serial_console;
24 void sun3x_halt(void)
26 /* Disable interrupts */
27 cli();
29 /* we can't drop back to PROM, so we loop here */
30 for (;;);
33 void sun3x_reboot(void)
35 /* This never returns, don't bother saving things */
36 cli();
38 /* no idea, whether this works */
39 asm ("reset");
42 int __init sun3x_keyb_init(void)
44 return 0;
47 int sun3x_kbdrate(struct kbd_repeat *r)
49 return 0;
52 void sun3x_kbd_leds(unsigned int i)
57 static void sun3x_badint (int irq, void *dev_id, struct pt_regs *fp)
59 printk ("received spurious interrupt %d\n",irq);
60 num_spurious += 1;
63 void (*sun3x_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
64 sun3x_badint, sun3x_badint, sun3x_badint, sun3x_badint,
65 sun3x_badint, sun3x_badint, sun3x_badint, sun3x_badint
68 void sun3x_enable_irq(unsigned int irq)
70 *sun3x_intreg |= (1 << irq);
73 void sun3x_disable_irq(unsigned int irq)
75 *sun3x_intreg &= ~(1 << irq);
78 void __init sun3x_init_IRQ(void)
80 /* disable all interrupts initially */
81 *sun3x_intreg = 1; /* master enable only */
84 int sun3x_get_irq_list(char *buf)
86 return 0;
90 * Setup the sun3x configuration info
92 void __init config_sun3x(void)
94 mach_get_irq_list = sun3x_get_irq_list;
95 mach_max_dma_address = 0xffffffff; /* we can DMA anywhere, whee */
97 mach_keyb_init = sun3x_keyb_init;
98 mach_kbdrate = sun3x_kbdrate;
99 mach_kbd_leds = sun3x_kbd_leds;
101 mach_sched_init = sun3x_sched_init;
102 mach_init_IRQ = sun3x_init_IRQ;
103 enable_irq = sun3x_enable_irq;
104 disable_irq = sun3x_disable_irq;
105 mach_request_irq = sys_request_irq;
106 mach_free_irq = sys_free_irq;
107 mach_default_handler = &sun3x_default_handler;
108 mach_gettimeoffset = sun3x_gettimeoffset;
109 mach_reset = sun3x_reboot;
111 mach_gettod = sun3x_gettod;
113 switch (*(unsigned char *)SUN3X_EEPROM_CONS) {
114 case 0x10:
115 serial_console = 1;
116 conswitchp = NULL;
117 break;
118 case 0x11:
119 serial_console = 2;
120 conswitchp = NULL;
121 break;
122 default:
123 serial_console = 0;
124 conswitchp = &dummy_con;
125 break;