1 /* $Id: setup.c,v 1.20 1999/02/25 21:57:47 tsbogend Exp $
3 * Setup pointers to hardware-dependent routines.
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
9 * Copyright (C) 1996, 1997, 1998 by Ralf Baechle
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 <asm/bootinfo.h>
22 #include <asm/keyboard.h>
26 #include <asm/ptrace.h>
27 #include <asm/reboot.h>
29 #include <asm/pgtable.h>
32 * Initial irq handlers.
34 static void no_action(int cpl
, void *dev_id
, struct pt_regs
*regs
) { }
37 * IRQ2 is cascade interrupt to second interrupt controller
39 static struct irqaction irq2
= { no_action
, 0, 0, "cascade", NULL
, NULL
};
41 extern asmlinkage
void jazz_handle_int(void);
43 extern void jazz_machine_restart(char *command
);
44 extern void jazz_machine_halt(void);
45 extern void jazz_machine_power_off(void);
47 extern struct ide_ops std_ide_ops
;
48 extern struct rtc_ops jazz_rtc_ops
;
49 extern struct kbd_ops jazz_kbd_ops
;
50 extern struct fd_ops
*fd_ops
;
51 extern struct fd_ops jazz_fd_ops
;
53 void (*board_time_init
)(struct irqaction
*irq
);
55 static void __init
jazz_time_init(struct irqaction
*irq
)
57 /* set the clock to 100 Hz */
58 r4030_write_reg32(JAZZ_TIMER_INTERVAL
, 9);
59 i8259_setup_irq(JAZZ_TIMER_IRQ
, irq
);
62 static void __init
jazz_irq_setup(void)
64 set_except_vector(0, jazz_handle_int
);
65 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE
,
72 r4030_read_reg16(JAZZ_IO_IRQ_SOURCE
); /* clear pending IRQs */
73 r4030_read_reg32(JAZZ_R4030_INVAL_ADDR
); /* clear error bits */
74 set_cp0_status(ST0_IM
, IE_IRQ4
| IE_IRQ3
| IE_IRQ2
| IE_IRQ1
);
75 /* set the clock to 100 Hz */
76 r4030_write_reg32(JAZZ_TIMER_INTERVAL
, 9);
77 request_region(0x20, 0x20, "pic1");
78 request_region(0xa0, 0x20, "pic2");
79 i8259_setup_irq(2, &irq2
);
82 void __init
jazz_setup(void)
84 add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K
);
85 add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M
);
86 add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M
);
88 irq_setup
= jazz_irq_setup
;
89 mips_io_port_base
= JAZZ_PORT_BASE
;
90 isa_slot_offset
= 0xe3000000;
91 request_region(0x00,0x20,"dma1");
92 request_region(0x40,0x20,"timer");
93 request_region(0x80,0x10,"dma page reg");
94 request_region(0xc0,0x20,"dma2");
95 board_time_init
= jazz_time_init
;
96 /* The RTC is outside the port address space */
98 _machine_restart
= jazz_machine_restart
;
99 _machine_halt
= jazz_machine_halt
;
100 _machine_power_off
= jazz_machine_power_off
;
102 #ifdef CONFIG_BLK_DEV_IDE
103 ide_ops
= &std_ide_ops
;
105 conswitchp
= &dummy_con
;
106 rtc_ops
= &jazz_rtc_ops
;
107 kbd_ops
= &jazz_kbd_ops
;
108 fd_ops
= &jazz_fd_ops
;