commented early_printk patch because of rejects.
[linux-flexiantxendom0-3.2.10.git] / arch / mips / jazz / setup.c
1 /*
2  * Setup pointers to hardware-dependent routines.
3  *
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
6  * for more details.
7  *
8  * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
9  * Copyright (C) 2001 MIPS Technologies, Inc.
10  */
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>
17 #include <linux/mm.h>
18 #include <linux/console.h>
19 #include <linux/fb.h>
20 #include <linux/mc146818rtc.h>
21 #include <linux/ide.h>
22 #include <asm/bootinfo.h>
23 #include <asm/irq.h>
24 #include <asm/jazz.h>
25 #include <asm/jazzdma.h>
26 #include <asm/ptrace.h>
27 #include <asm/reboot.h>
28 #include <asm/io.h>
29 #include <asm/pgtable.h>
30 #include <asm/traps.h>
31
32 /*
33  * Initial irq handlers.
34  */
35 static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
36
37 /*
38  * IRQ2 is cascade interrupt to second interrupt controller
39  */
40 static struct irqaction irq2  = { no_action, 0, 0, "cascade", NULL, NULL};
41
42 extern asmlinkage void jazz_handle_int(void);
43
44 extern void jazz_machine_restart(char *command);
45 extern void jazz_machine_halt(void);
46 extern void jazz_machine_power_off(void);
47
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;
53
54 void (*board_time_init)(struct irqaction *irq);
55
56 static void __init jazz_time_init(struct irqaction *irq)
57 {
58         /* set the clock to 100 Hz */
59         r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
60         i8259_setup_irq(JAZZ_TIMER_IRQ, irq);
61 }
62
63 static void __init jazz_irq_setup(void)
64 {
65         set_except_vector(0, jazz_handle_int);
66         r4030_write_reg16(JAZZ_IO_IRQ_ENABLE,
67                           JAZZ_IE_ETHERNET |
68                           JAZZ_IE_SCSI     |
69                           JAZZ_IE_SERIAL1  |
70                           JAZZ_IE_SERIAL2  |
71                           JAZZ_IE_PARALLEL |
72                           JAZZ_IE_FLOPPY);
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);
81 }
82
83
84 void __init jazz_setup(void)
85 {
86         /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
87         add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K);
88
89         /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
90         add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M);
91
92         /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
93         add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M);
94
95         irq_setup = jazz_irq_setup;
96         set_io_port_base(JAZZ_PORT_BASE);
97 #ifdef CONFIG_EISA
98         if (mips_machtype == MACH_MIPS_MAGNUM_4000)
99                 EISA_bus = 1;
100 #endif
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 */
108
109         _machine_restart = jazz_machine_restart;
110         _machine_halt = jazz_machine_halt;
111         _machine_power_off = jazz_machine_power_off;
112
113 #ifdef CONFIG_BLK_DEV_IDE
114         ide_ops = &std_ide_ops;
115 #endif
116 #ifdef CONFIG_BLK_DEV_FD
117         fd_ops = &jazz_fd_ops;
118 #endif
119 #ifdef CONFIG_VT
120         conswitchp = &dummy_con;
121 #endif
122
123 #warning "Somebody should check if screen_info is ok for Jazz."
124
125         screen_info = (struct screen_info) {
126                 0, 0,           /* orig-x, orig-y */
127                 0,              /* unused */
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 */
135         };
136
137         rtc_ops = &jazz_rtc_ops;
138         kbd_ops = &jazz_kbd_ops;
139
140         vdma_init();
141 }