2 * Copyright (C) 2000, 2001, 2002, 2003 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/config.h>
24 #include <linux/spinlock.h>
26 #include <linux/bootmem.h>
27 #include <linux/blkdev.h>
28 #include <linux/init.h>
32 #include <asm/bootinfo.h>
33 #include <asm/mipsregs.h>
34 #include <asm/reboot.h>
36 #include <asm/traps.h>
37 #include <asm/pci_channel.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 void sb1250_setup(void);
45 extern int xicor_probe(void);
46 extern int xicor_set_time(unsigned long);
47 extern unsigned long xicor_get_time(void);
49 extern int m41t81_probe(void);
50 extern int m41t81_set_time(unsigned long);
51 extern unsigned long m41t81_get_time(void);
53 const char *get_system_type(void)
55 return "SiByte " SIBYTE_BOARD_NAME;
58 void __init swarm_timer_setup(struct irqaction *irq)
61 * we don't set up irqaction, because we will deliver timer
62 * interrupts through low-level (direct) meachanism.
65 /* We only need to setup the generic timer */
69 int swarm_be_handler(struct pt_regs *regs, int is_fixup)
71 if (!is_fixup && (regs->cp0_cause & 4)) {
72 /* Data bus error - print PA */
74 printk("DBE physical address: %010lx\n",
75 __read_64bit_c0_register($26, 1));
77 printk("DBE physical address: %010llx\n",
78 __read_64bit_c0_split($26, 1));
81 return (is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL);
84 static int __init swarm_setup(void)
86 extern int panic_timeout;
90 panic_timeout = 5; /* For debug. */
92 board_timer_setup = swarm_timer_setup;
93 board_be_handler = swarm_be_handler;
96 printk("swarm setup: Xicor 1241 RTC detected.\n");
97 rtc_get_time = xicor_get_time;
98 rtc_set_time = xicor_set_time;
101 if (m41t81_probe()) {
102 printk("swarm setup: M41T81 RTC detected.\n");
103 rtc_get_time = m41t81_get_time;
104 rtc_set_time = m41t81_set_time;
107 printk("This kernel optimized for "
108 #ifdef CONFIG_SIMULATION
114 #ifdef CONFIG_SIBYTE_CFE
122 screen_info = (struct screen_info) {
123 0, 0, /* orig-x, orig-y */
125 52, /* orig_video_page */
126 3, /* orig_video_mode */
127 80, /* orig_video_cols */
128 4626, 3, 9, /* unused, ega_bx, unused */
129 25, /* orig_video_lines */
130 0x22, /* orig_video_isVGA */
131 16 /* orig_video_points */
133 /* XXXKW for CFE, get lines/cols from environment */
139 early_initcall(swarm_setup);
143 #ifdef CONFIG_SIBYTE_CARMEL
144 /* XXXKW need to detect Monterey/LittleSur/etc */
146 #define LEDS_PHYS MLEDS_PHYS
149 #define setled(index, c) \
150 ((unsigned char *)(IOADDR(LEDS_PHYS)+0x20))[(3-(index))<<3] = (c)
151 void setleds(char *str)
154 for (i = 0; i < 4; i++) {