4 * Carsten Langgaard, carstenl@mips.com
5 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
7 * Thomas Horsten <thh@lasat.com>
8 * Copyright (C) 2000 LASAT Networks A/S.
10 * Brian Murphy <brian@murphy.dk>
12 * ########################################################################
14 * This program is free software; you can distribute it and/or modify it
15 * under the terms of the GNU General Public License (Version 2) as
16 * published by the Free Software Foundation.
18 * This program is distributed in the hope it will be useful, but WITHOUT
19 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
27 * ########################################################################
29 * Lasat specific setup.
31 #include <linux/config.h>
32 #include <linux/init.h>
33 #include <linux/sched.h>
34 #include <linux/pci.h>
35 #include <linux/ide.h>
37 #include <linux/interrupt.h>
41 #include <asm/bootinfo.h>
43 #include <asm/lasat/lasat.h>
45 #include <linux/serial.h>
46 #include <asm/serial.h>
47 #include <asm/lasat/serial.h>
50 #include <linux/notifier.h>
55 #include <asm/lasat/ds1603.h>
56 #include <asm/lasat/picvue.h>
57 #include <asm/lasat/eeprom.h>
61 int lasat_command_line = 0;
62 void lasatint_init(void);
64 #ifdef CONFIG_BLK_DEV_IDE
65 extern struct ide_ops std_ide_ops;
66 extern struct ide_ops *ide_ops;
69 extern char arcs_cmdline[CL_SIZE];
71 extern void lasat_reboot_setup(void);
72 extern void pcisetup(void);
73 extern void edhac_init(void *, void *, void *);
74 extern void addrflt_init(void);
76 struct lasat_misc lasat_misc_info[N_MACHTYPES] = {
77 {(void *)KSEG1ADDR(0x1c840000), (void *)KSEG1ADDR(0x1c800000), 2},
78 {(void *)KSEG1ADDR(0x11080000), (void *)KSEG1ADDR(0x11000000), 6}
81 struct lasat_misc *lasat_misc = NULL;
84 static struct ds_defs ds_defs[N_MACHTYPES] = {
85 { (void *)DS1603_REG_100, (void *)DS1603_REG_100,
86 DS1603_RST_100, DS1603_CLK_100, DS1603_DATA_100,
87 DS1603_DATA_SHIFT_100, 0, 0 },
88 { (void *)DS1603_REG_200, (void *)DS1603_DATA_REG_200,
89 DS1603_RST_200, DS1603_CLK_200, DS1603_DATA_200,
90 DS1603_DATA_READ_SHIFT_200, 1, 2000 }
96 static struct pvc_defs pvc_defs[N_MACHTYPES] = {
97 { (void *)PVC_REG_100, PVC_DATA_SHIFT_100, PVC_DATA_M_100,
98 PVC_E_100, PVC_RW_100, PVC_RS_100 },
99 { (void *)PVC_REG_200, PVC_DATA_SHIFT_200, PVC_DATA_M_200,
100 PVC_E_200, PVC_RW_200, PVC_RS_200 }
104 static int lasat_panic_display(struct notifier_block *this,
105 unsigned long event, void *ptr)
108 unsigned char *string = ptr;
110 string = "Kernel Panic";
111 pvc_dump_string(string);
116 static int lasat_panic_prom_monitor(struct notifier_block *this,
117 unsigned long event, void *ptr)
123 static struct notifier_block lasat_panic_block[] =
125 { lasat_panic_display, NULL, INT_MAX },
126 { lasat_panic_prom_monitor, NULL, INT_MIN }
129 #ifdef CONFIG_BLK_DEV_IDE
130 static int lasat_ide_default_irq(ide_ioreg_t base) {
134 static ide_ioreg_t lasat_ide_default_io_base(int index) {
139 static void lasat_time_init(void)
141 mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
144 static void lasat_timer_setup(struct irqaction *irq)
149 mips_hpt_frequency / HZ);
150 change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
153 #define MIPS_CPU_TIMER_IRQ 7
154 asmlinkage void lasat_timer_interrupt(struct pt_regs *regs)
156 ll_timer_interrupt(MIPS_CPU_TIMER_IRQ, regs);
159 void __init serial_init(void)
162 struct serial_struct s;
164 memset(&s, 0, sizeof(s));
166 s.flags = STD_COM_FLAGS;
167 s.io_type = SERIAL_IO_MEM;
169 if (mips_machtype == MACH_LASAT_100) {
170 s.baud_base = LASAT_BASE_BAUD_100;
171 s.irq = LASATINT_UART_100;
172 s.iomem_reg_shift = LASAT_UART_REGS_SHIFT_100;
173 s.iomem_base = (u8 *)KSEG1ADDR(LASAT_UART_REGS_BASE_100);
175 s.baud_base = LASAT_BASE_BAUD_200;
176 s.irq = LASATINT_UART_200;
177 s.iomem_reg_shift = LASAT_UART_REGS_SHIFT_200;
178 s.iomem_base = (u8 *)KSEG1ADDR(LASAT_UART_REGS_BASE_200);
181 if (early_serial_setup(&s) != 0)
182 printk(KERN_ERR "Serial setup failed!\n");
186 void __init lasat_setup(void)
189 lasat_misc = &lasat_misc_info[mips_machtype];
191 picvue = &pvc_defs[mips_machtype];
194 /* Set up panic notifier */
195 for (i = 0; i < sizeof(lasat_panic_block) / sizeof(struct notifier_block); i++)
196 notifier_chain_register(&panic_notifier_list, &lasat_panic_block[i]);
198 #ifdef CONFIG_BLK_DEV_IDE
199 ide_ops = &std_ide_ops;
200 ide_ops->ide_default_irq = &lasat_ide_default_irq;
201 ide_ops->ide_default_io_base = &lasat_ide_default_io_base;
204 lasat_reboot_setup();
206 board_time_init = lasat_time_init;
207 board_timer_setup = lasat_timer_setup;
210 ds1603 = &ds_defs[mips_machtype];
211 rtc_get_time = ds1603_read;
212 rtc_set_time = ds1603_set;
217 /* Switch from prom exception handler to normal mode */
218 change_c0_status(ST0_BEV,0);
220 prom_printf("Lasat specific initialization complete\n");