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>
9 #include <linux/types.h>
11 #include <linux/console.h>
12 #include <linux/init.h>
14 #include <asm/system.h>
15 #include <asm/machdep.h>
17 #include <asm/sun3x.h>
21 static volatile unsigned char *sun3x_intreg
= (unsigned char *)SUN3X_INTREG
;
22 extern int serial_console
;
26 /* Disable interrupts */
29 /* we can't drop back to PROM, so we loop here */
33 void sun3x_reboot(void)
35 /* This never returns, don't bother saving things */
38 /* no idea, whether this works */
42 int __init
sun3x_keyb_init(void)
47 int sun3x_kbdrate(struct kbd_repeat
*r
)
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
);
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
)
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
) {
124 conswitchp
= &dummy_con
;