2 * Copyright (C) 2000, 2001 Broadcom Corporation
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Setup code for the SWARM board
23 #include <linux/spinlock.h>
25 #include <linux/bootmem.h>
26 #include <linux/blkdev.h>
27 #include <linux/init.h>
28 #include <linux/ide.h>
29 #include <linux/console.h>
33 #include <asm/bootinfo.h>
34 #include <asm/mipsregs.h>
35 #include <asm/reboot.h>
37 #include <asm/traps.h>
38 #include <asm/sibyte/sb1250.h>
39 #include <asm/sibyte/sb1250_regs.h>
40 #include <asm/sibyte/sb1250_genbus.h>
41 #include <asm/sibyte/board.h>
43 extern struct rtc_ops *rtc_ops;
44 extern struct rtc_ops swarm_rtc_ops;
46 #ifdef CONFIG_BLK_DEV_IDE
47 extern struct ide_ops sibyte_ide_ops;
50 extern void sb1250_setup(void);
52 extern int xicor_probe(void);
53 extern int xicor_set_time(unsigned long);
54 extern unsigned long xicor_get_time(void);
56 extern int m41t81_probe(void);
57 extern int m41t81_set_time(unsigned long);
58 extern unsigned long m41t81_get_time(void);
60 const char *get_system_type(void)
62 return "SiByte " SIBYTE_BOARD_NAME;
65 void __init swarm_timer_setup(struct irqaction *irq)
68 * we don't set up irqaction, because we will deliver timer
69 * interrupts through low-level (direct) meachanism.
72 /* We only need to setup the generic timer */
76 int swarm_be_handler(struct pt_regs *regs, int is_fixup)
78 if (!is_fixup && (regs->cp0_cause & 4)) {
79 /* Data bus error - print PA */
81 printk("DBE physical address: %010lx\n",
82 __read_64bit_c0_register($26, 1));
84 printk("DBE physical address: %010llx\n",
85 __read_64bit_c0_split($26, 1));
88 return (is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL);
91 void __init swarm_setup(void)
93 extern int panic_timeout;
97 panic_timeout = 5; /* For debug. */
99 board_timer_setup = swarm_timer_setup;
100 board_be_handler = swarm_be_handler;
103 printk("swarm setup: Xicor 1241 RTC detected.\n");
104 rtc_get_time = xicor_get_time;
105 rtc_set_time = xicor_set_time;
108 if (m41t81_probe()) {
109 printk("swarm setup: M41T81 RTC detected.\n");
110 rtc_get_time = m41t81_get_time;
111 rtc_set_time = m41t81_set_time;
114 printk("This kernel optimized for "
115 #ifdef CONFIG_SIMULATION
121 #ifdef CONFIG_SIBYTE_CFE
128 #ifdef CONFIG_BLK_DEV_IDE
129 ide_ops = &sibyte_ide_ops;
133 #ifdef CONFIG_DUMMY_CONSOLE
134 conswitchp = &dummy_con;
136 screen_info = (struct screen_info) {
137 0, 0, /* orig-x, orig-y */
139 52, /* orig_video_page */
140 3, /* orig_video_mode */
141 80, /* orig_video_cols */
142 4626, 3, 9, /* unused, ega_bx, unused */
143 25, /* orig_video_lines */
144 0x22, /* orig_video_isVGA */
145 16 /* orig_video_points */
147 /* XXXKW for CFE, get lines/cols from environment */
153 #ifdef CONFIG_SIBYTE_CARMEL
154 /* XXXKW need to detect Monterey/LittleSur/etc */
156 #define LEDS_PHYS MLEDS_PHYS
159 #define setled(index, c) \
160 ((unsigned char *)(LEDS_PHYS|IO_SPACE_BASE|0x20))[(3-(index))<<3] = (c)
161 void setleds(char *str)
164 for (i = 0; i < 4; i++) {