2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18 #include <linux/config.h>
19 #include <linux/init.h>
20 #include <linux/sched.h>
21 #include <linux/mc146818rtc.h>
22 #include <linux/ioport.h>
23 #include <linux/pci.h>
24 #ifdef CONFIG_BLK_DEV_IDE
25 #include <linux/ide.h>
29 #include <asm/bootinfo.h>
31 #include <asm/mips-boards/generic.h>
32 #include <asm/mips-boards/prom.h>
33 #include <asm/mips-boards/malta.h>
34 #include <asm/mips-boards/maltaint.h>
35 #ifdef CONFIG_BLK_DEV_FD
36 #include <asm/floppy.h>
40 #include <asm/traps.h>
42 #include <asm/keyboard.h>
45 #include <linux/console.h>
49 extern void rs_kgdb_hook(int);
53 extern struct ide_ops std_ide_ops;
54 extern struct fd_ops std_fd_ops;
55 extern struct rtc_ops malta_rtc_ops;
56 extern struct kbd_ops std_kbd_ops;
58 extern void mips_reboot_setup(void);
60 extern void mips_time_init(void);
61 extern void mips_timer_setup(struct irqaction *irq);
62 extern unsigned long mips_rtc_get_time(void);
64 struct resource standard_io_resources[] = {
65 { "dma1", 0x00, 0x1f, IORESOURCE_BUSY },
66 { "timer", 0x40, 0x5f, IORESOURCE_BUSY },
67 { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY },
68 { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY },
71 #define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource))
73 const char *get_system_type(void)
78 void __init malta_setup(void)
81 int rs_putDebugChar(char);
82 char rs_getDebugChar(void);
83 extern int (*generic_putDebugChar)(char);
84 extern char (*generic_getDebugChar)(void);
89 /* Request I/O space for devices used on the Malta board. */
90 for (i = 0; i < STANDARD_IO_RESOURCES; i++)
91 request_resource(&ioport_resource, standard_io_resources+i);
94 * Enable DMA channel 4 (cascade channel) in the PIIX4 south bridge.
98 #ifdef CONFIG_SERIAL_CONSOLE
99 argptr = prom_getcmdline();
100 if ((argptr = strstr(argptr, "console=")) == NULL) {
101 argptr = prom_getcmdline();
102 strcat(argptr, " console=ttyS0,38400");
107 argptr = prom_getcmdline();
108 if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
110 argptr += strlen("kgdb=ttyS");
111 if (*argptr != '0' && *argptr != '1')
112 printk("KGDB: Uknown serial line /dev/ttyS%c, "
113 "falling back to /dev/ttyS1\n", *argptr);
114 line = *argptr == '0' ? 0 : 1;
115 printk("KGDB: Using serial line /dev/ttyS%d for session\n",
119 generic_putDebugChar = rs_putDebugChar;
120 generic_getDebugChar = rs_getDebugChar;
122 prom_printf("KGDB: Using serial line /dev/ttyS%d for session, "
123 "please connect your debugger\n", line ? 1 : 0);
126 /* Breakpoints are in init_IRQ() */
130 argptr = prom_getcmdline();
131 if ((argptr = strstr(argptr, "nofpu")) != NULL)
132 cpu_data[0].options &= ~MIPS_CPU_FPU;
134 rtc_ops = &malta_rtc_ops;
136 #ifdef CONFIG_BLK_DEV_IDE
137 ide_ops = &std_ide_ops;
139 #ifdef CONFIG_BLK_DEV_FD
140 fd_ops = &std_fd_ops;
142 #ifdef CONFIG_PC_KEYB
143 kbd_ops = &std_kbd_ops;
146 #if defined(CONFIG_VGA_CONSOLE)
147 conswitchp = &vga_con;
149 screen_info = (struct screen_info) {
150 0, 25, /* orig-x, orig-y */
152 0, /* orig-video-page */
153 0, /* orig-video-mode */
154 80, /* orig-video-cols */
155 0,0,0, /* ega_ax, ega_bx, ega_cx */
156 25, /* orig-video-lines */
157 1, /* orig-video-isVGA */
158 16 /* orig-video-points */
160 #elif defined(CONFIG_DUMMY_CONSOLE)
161 conswitchp = &dummy_con;
166 board_time_init = mips_time_init;
167 board_timer_setup = mips_timer_setup;
168 rtc_get_time = mips_rtc_get_time;