2 * Setup pointers to hardware-dependent routines.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
9 * Copyright (C) 2001 MIPS Technologies, Inc.
11 #include <linux/config.h>
12 #include <linux/hdreg.h>
13 #include <linux/init.h>
14 #include <linux/ioport.h>
15 #include <linux/sched.h>
16 #include <linux/interrupt.h>
18 #include <linux/console.h>
20 #include <linux/mc146818rtc.h>
21 #include <linux/ide.h>
22 #include <asm/bootinfo.h>
25 #include <asm/jazzdma.h>
26 #include <asm/ptrace.h>
27 #include <asm/reboot.h>
29 #include <asm/pgtable.h>
30 #include <asm/traps.h>
33 * Initial irq handlers.
35 static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
38 * IRQ2 is cascade interrupt to second interrupt controller
40 static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
42 extern asmlinkage void jazz_handle_int(void);
44 extern void jazz_machine_restart(char *command);
45 extern void jazz_machine_halt(void);
46 extern void jazz_machine_power_off(void);
48 extern struct ide_ops std_ide_ops;
49 extern struct rtc_ops jazz_rtc_ops;
50 extern struct kbd_ops jazz_kbd_ops;
51 extern struct fd_ops *fd_ops;
52 extern struct fd_ops jazz_fd_ops;
54 void (*board_time_init)(struct irqaction *irq);
56 static void __init jazz_time_init(struct irqaction *irq)
58 /* set the clock to 100 Hz */
59 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
60 i8259_setup_irq(JAZZ_TIMER_IRQ, irq);
63 static void __init jazz_irq_setup(void)
65 set_except_vector(0, jazz_handle_int);
66 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE,
73 r4030_read_reg16(JAZZ_IO_IRQ_SOURCE); /* clear pending IRQs */
74 r4030_read_reg32(JAZZ_R4030_INVAL_ADDR); /* clear error bits */
75 change_c0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1);
76 /* set the clock to 100 Hz */
77 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
78 request_region(0x20, 0x20, "pic1");
79 request_region(0xa0, 0x20, "pic2");
80 i8259_setup_irq(2, &irq2);
84 void __init jazz_setup(void)
86 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
87 add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K);
89 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
90 add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M);
92 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
93 add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M);
95 irq_setup = jazz_irq_setup;
96 set_io_port_base(JAZZ_PORT_BASE);
98 if (mips_machtype == MACH_MIPS_MAGNUM_4000)
101 isa_slot_offset = 0xe3000000;
102 request_region(0x00,0x20,"dma1");
103 request_region(0x40,0x20,"timer");
104 request_region(0x80,0x10,"dma page reg");
105 request_region(0xc0,0x20,"dma2");
106 board_time_init = jazz_time_init;
107 /* The RTC is outside the port address space */
109 _machine_restart = jazz_machine_restart;
110 _machine_halt = jazz_machine_halt;
111 _machine_power_off = jazz_machine_power_off;
113 #ifdef CONFIG_BLK_DEV_IDE
114 ide_ops = &std_ide_ops;
116 #ifdef CONFIG_BLK_DEV_FD
117 fd_ops = &jazz_fd_ops;
120 conswitchp = &dummy_con;
123 #warning "Somebody should check if screen_info is ok for Jazz."
125 screen_info = (struct screen_info) {
126 0, 0, /* orig-x, orig-y */
128 0, /* orig_video_page */
129 0, /* orig_video_mode */
130 160, /* orig_video_cols */
131 0, 0, 0, /* unused, ega_bx, unused */
132 64, /* orig_video_lines */
133 0, /* orig_video_isVGA */
134 16 /* orig_video_points */
137 rtc_ops = &jazz_rtc_ops;
138 kbd_ops = &jazz_kbd_ops;