[IA64] Increase max node count on SN platforms
[linux-2.6/cjktty.git] / arch / mips / sibyte / swarm / setup.c
blobb661d2425a369bae38caa0b60141449c9f9c6655
1 /*
2 * Copyright (C) 2000, 2001, 2002, 2003, 2004 Broadcom Corporation
3 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Setup code for the SWARM board
24 #include <linux/config.h>
25 #include <linux/spinlock.h>
26 #include <linux/mm.h>
27 #include <linux/bootmem.h>
28 #include <linux/blkdev.h>
29 #include <linux/init.h>
30 #include <linux/kernel.h>
31 #include <linux/tty.h>
32 #include <linux/initrd.h>
34 #include <asm/irq.h>
35 #include <asm/io.h>
36 #include <asm/bootinfo.h>
37 #include <asm/mipsregs.h>
38 #include <asm/reboot.h>
39 #include <asm/time.h>
40 #include <asm/traps.h>
41 #include <asm/sibyte/sb1250.h>
42 #if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
43 #include <asm/sibyte/bcm1480_regs.h>
44 #elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
45 #include <asm/sibyte/sb1250_regs.h>
46 #else
47 #error invalid SiByte board configuation
48 #endif
49 #include <asm/sibyte/sb1250_genbus.h>
50 #include <asm/sibyte/board.h>
52 #if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
53 extern void bcm1480_setup(void);
54 #elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
55 extern void sb1250_setup(void);
56 #else
57 #error invalid SiByte board configuation
58 #endif
60 extern int xicor_probe(void);
61 extern int xicor_set_time(unsigned long);
62 extern unsigned long xicor_get_time(void);
64 extern int m41t81_probe(void);
65 extern int m41t81_set_time(unsigned long);
66 extern unsigned long m41t81_get_time(void);
68 const char *get_system_type(void)
70 return "SiByte " SIBYTE_BOARD_NAME;
73 void __init swarm_time_init(void)
75 /* Setup HPT */
76 sb1250_hpt_setup();
79 void __init swarm_timer_setup(struct irqaction *irq)
82 * we don't set up irqaction, because we will deliver timer
83 * interrupts through low-level (direct) meachanism.
86 /* We only need to setup the generic timer */
87 #if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
88 bcm1480_time_init();
89 #elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
90 sb1250_time_init();
91 #else
92 #error invalid SiByte board configuation
93 #endif
96 int swarm_be_handler(struct pt_regs *regs, int is_fixup)
98 if (!is_fixup && (regs->cp0_cause & 4)) {
99 /* Data bus error - print PA */
100 printk("DBE physical address: %010Lx\n",
101 __read_64bit_c0_register($26, 1));
103 return (is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL);
106 void __init plat_setup(void)
108 #if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
109 bcm1480_setup();
110 #elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
111 sb1250_setup();
112 #else
113 #error invalid SiByte board configuation
114 #endif
116 panic_timeout = 5; /* For debug. */
118 board_time_init = swarm_time_init;
119 board_timer_setup = swarm_timer_setup;
120 board_be_handler = swarm_be_handler;
122 if (xicor_probe()) {
123 printk("swarm setup: Xicor 1241 RTC detected.\n");
124 rtc_get_time = xicor_get_time;
125 rtc_set_time = xicor_set_time;
128 if (m41t81_probe()) {
129 printk("swarm setup: M41T81 RTC detected.\n");
130 rtc_get_time = m41t81_get_time;
131 rtc_set_time = m41t81_set_time;
134 printk("This kernel optimized for "
135 #ifdef CONFIG_SIMULATION
136 "simulation"
137 #else
138 "board"
139 #endif
140 " runs "
141 #ifdef CONFIG_SIBYTE_CFE
142 "with"
143 #else
144 "without"
145 #endif
146 " CFE\n");
148 #ifdef CONFIG_VT
149 screen_info = (struct screen_info) {
150 0, 0, /* orig-x, orig-y */
151 0, /* unused */
152 52, /* orig_video_page */
153 3, /* orig_video_mode */
154 80, /* orig_video_cols */
155 4626, 3, 9, /* unused, ega_bx, unused */
156 25, /* orig_video_lines */
157 0x22, /* orig_video_isVGA */
158 16 /* orig_video_points */
160 /* XXXKW for CFE, get lines/cols from environment */
161 #endif
164 #ifdef LEDS_PHYS
166 #ifdef CONFIG_SIBYTE_CARMEL
167 /* XXXKW need to detect Monterey/LittleSur/etc */
168 #undef LEDS_PHYS
169 #define LEDS_PHYS MLEDS_PHYS
170 #endif
172 #define setled(index, c) \
173 ((unsigned char *)(IOADDR(LEDS_PHYS)+0x20))[(3-(index))<<3] = (c)
174 void setleds(char *str)
176 int i;
177 for (i = 0; i < 4; i++) {
178 if (!str[i]) {
179 setled(i, ' ');
180 } else {
181 setled(i, str[i]);
185 #endif