2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
5 * Thomas Horsten <thh@lasat.com>
6 * Copyright (C) 2000 LASAT Networks A/S.
8 * Brian Murphy <brian@murphy.dk>
10 * This program is free software; you can distribute it and/or modify it
11 * under the terms of the GNU General Public License (Version 2) as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Lasat specific setup.
25 #include <linux/init.h>
26 #include <linux/sched.h>
27 #include <linux/pci.h>
28 #include <linux/interrupt.h>
29 #include <linux/tty.h>
30 #include <linux/serial.h>
31 #include <linux/serial_core.h>
35 #include <asm/bootinfo.h>
37 #include <asm/serial.h>
38 #include <asm/lasat/lasat.h>
39 #include <asm/lasat/serial.h>
42 #include <linux/notifier.h>
46 #include <asm/lasat/ds1603.h>
47 #include <asm/lasat/picvue.h>
48 #include <asm/lasat/eeprom.h>
52 int lasat_command_line = 0;
53 void lasatint_init(void);
55 extern void lasat_reboot_setup(void);
56 extern void pcisetup(void);
57 extern void edhac_init(void *, void *, void *);
58 extern void addrflt_init(void);
60 struct lasat_misc lasat_misc_info[N_MACHTYPES] = {
61 {(void *)KSEG1ADDR(0x1c840000), (void *)KSEG1ADDR(0x1c800000), 2},
62 {(void *)KSEG1ADDR(0x11080000), (void *)KSEG1ADDR(0x11000000), 6}
65 struct lasat_misc *lasat_misc = NULL;
68 static struct ds_defs ds_defs[N_MACHTYPES] = {
69 { (void *)DS1603_REG_100, (void *)DS1603_REG_100,
70 DS1603_RST_100, DS1603_CLK_100, DS1603_DATA_100,
71 DS1603_DATA_SHIFT_100, 0, 0 },
72 { (void *)DS1603_REG_200, (void *)DS1603_DATA_REG_200,
73 DS1603_RST_200, DS1603_CLK_200, DS1603_DATA_200,
74 DS1603_DATA_READ_SHIFT_200, 1, 2000 }
80 static struct pvc_defs pvc_defs[N_MACHTYPES] = {
81 { (void *)PVC_REG_100, PVC_DATA_SHIFT_100, PVC_DATA_M_100,
82 PVC_E_100, PVC_RW_100, PVC_RS_100 },
83 { (void *)PVC_REG_200, PVC_DATA_SHIFT_200, PVC_DATA_M_200,
84 PVC_E_200, PVC_RW_200, PVC_RS_200 }
88 static int lasat_panic_display(struct notifier_block *this,
89 unsigned long event, void *ptr)
92 unsigned char *string = ptr;
94 string = "Kernel Panic";
95 pvc_dump_string(string);
100 static int lasat_panic_prom_monitor(struct notifier_block *this,
101 unsigned long event, void *ptr)
107 static struct notifier_block lasat_panic_block[] =
109 { lasat_panic_display, NULL, INT_MAX },
110 { lasat_panic_prom_monitor, NULL, INT_MIN }
113 static void lasat_time_init(void)
115 mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
118 void __init plat_timer_setup(struct irqaction *irq)
120 write_c0_compare( read_c0_count() + mips_hpt_frequency / HZ);
121 change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
124 #define DYNAMIC_SERIAL_INIT
125 #ifdef DYNAMIC_SERIAL_INIT
126 void __init serial_init(void)
128 #ifdef CONFIG_SERIAL_8250
131 memset(&s, 0, sizeof(s));
133 s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
136 if (mips_machtype == MACH_LASAT_100) {
137 s.uartclk = LASAT_BASE_BAUD_100 * 16;
138 s.irq = LASATINT_UART_100;
139 s.regshift = LASAT_UART_REGS_SHIFT_100;
140 s.membase = (char *)KSEG1ADDR(LASAT_UART_REGS_BASE_100);
142 s.uartclk = LASAT_BASE_BAUD_200 * 16;
143 s.irq = LASATINT_UART_200;
144 s.regshift = LASAT_UART_REGS_SHIFT_200;
145 s.membase = (char *)KSEG1ADDR(LASAT_UART_REGS_BASE_200);
148 if (early_serial_setup(&s) != 0)
149 printk(KERN_ERR "Serial setup failed!\n");
154 void __init plat_mem_setup(void)
157 lasat_misc = &lasat_misc_info[mips_machtype];
159 picvue = &pvc_defs[mips_machtype];
162 /* Set up panic notifier */
163 for (i = 0; i < sizeof(lasat_panic_block) / sizeof(struct notifier_block); i++)
164 atomic_notifier_chain_register(&panic_notifier_list,
165 &lasat_panic_block[i]);
167 lasat_reboot_setup();
169 board_time_init = lasat_time_init;
172 ds1603 = &ds_defs[mips_machtype];
173 rtc_mips_get_time = ds1603_read;
174 rtc_mips_set_time = ds1603_set;
177 #ifdef DYNAMIC_SERIAL_INIT
180 /* Switch from prom exception handler to normal mode */
181 change_c0_status(ST0_BEV,0);
183 prom_printf("Lasat specific initialization complete\n");