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>
23 #include <asm/keyboard.h>
26 #include <asm/jazzdma.h>
27 #include <asm/ptrace.h>
28 #include <asm/reboot.h>
30 #include <asm/pgtable.h>
31 #include <asm/traps.h>
34 * Initial irq handlers.
36 static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
39 * IRQ2 is cascade interrupt to second interrupt controller
41 static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
43 extern asmlinkage void jazz_handle_int(void);
45 extern void jazz_machine_restart(char *command);
46 extern void jazz_machine_halt(void);
47 extern void jazz_machine_power_off(void);
49 extern struct ide_ops std_ide_ops;
50 extern struct rtc_ops jazz_rtc_ops;
51 extern struct kbd_ops jazz_kbd_ops;
52 extern struct fd_ops *fd_ops;
53 extern struct fd_ops jazz_fd_ops;
55 void (*board_time_init)(struct irqaction *irq);
57 static void __init jazz_time_init(struct irqaction *irq)
59 /* set the clock to 100 Hz */
60 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
61 i8259_setup_irq(JAZZ_TIMER_IRQ, irq);
64 static void __init jazz_irq_setup(void)
66 set_except_vector(0, jazz_handle_int);
67 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE,
74 r4030_read_reg16(JAZZ_IO_IRQ_SOURCE); /* clear pending IRQs */
75 r4030_read_reg32(JAZZ_R4030_INVAL_ADDR); /* clear error bits */
76 change_c0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1);
77 /* set the clock to 100 Hz */
78 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
79 request_region(0x20, 0x20, "pic1");
80 request_region(0xa0, 0x20, "pic2");
81 i8259_setup_irq(2, &irq2);
85 void __init jazz_setup(void)
87 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
88 add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K);
90 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
91 add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M);
93 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
94 add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M);
96 irq_setup = jazz_irq_setup;
97 set_io_port_base(JAZZ_PORT_BASE);
98 if (mips_machtype == MACH_MIPS_MAGNUM_4000)
100 isa_slot_offset = 0xe3000000;
101 request_region(0x00,0x20,"dma1");
102 request_region(0x40,0x20,"timer");
103 request_region(0x80,0x10,"dma page reg");
104 request_region(0xc0,0x20,"dma2");
105 board_time_init = jazz_time_init;
106 /* The RTC is outside the port address space */
108 _machine_restart = jazz_machine_restart;
109 _machine_halt = jazz_machine_halt;
110 _machine_power_off = jazz_machine_power_off;
112 #ifdef CONFIG_BLK_DEV_IDE
113 ide_ops = &std_ide_ops;
115 #ifdef CONFIG_BLK_DEV_FD
116 fd_ops = &jazz_fd_ops;
119 conswitchp = &dummy_con;
122 #warning "Somebody should check if screen_info is ok for Jazz."
124 screen_info = (struct screen_info) {
125 0, 0, /* orig-x, orig-y */
127 0, /* orig_video_page */
128 0, /* orig_video_mode */
129 160, /* orig_video_cols */
130 0, 0, 0, /* unused, ega_bx, unused */
131 64, /* orig_video_lines */
132 0, /* orig_video_isVGA */
133 16 /* orig_video_points */
136 rtc_ops = &jazz_rtc_ops;
137 kbd_ops = &jazz_kbd_ops;