Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / arch / mips / mipssim / sim_setup.c
blob256e0cdaa499ff45fa730fb7dd080d72d6724966
1 /*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 #include <linux/init.h>
20 #include <linux/string.h>
21 #include <linux/kernel.h>
22 #include <linux/io.h>
23 #include <linux/irq.h>
24 #include <linux/ioport.h>
25 #include <linux/tty.h>
26 #include <linux/serial.h>
27 #include <linux/serial_core.h>
28 #include <linux/serial_8250.h>
30 #include <asm/cpu.h>
31 #include <asm/bootinfo.h>
32 #include <asm/mips-boards/generic.h>
33 #include <asm/mips-boards/prom.h>
34 #include <asm/time.h>
35 #include <asm/mips-boards/sim.h>
36 #include <asm/mips-boards/simint.h>
37 #include <asm/smp-ops.h>
40 static void __init serial_init(void);
41 unsigned int _isbonito;
43 const char *get_system_type(void)
45 return "MIPSsim";
48 void __init plat_mem_setup(void)
50 set_io_port_base(0xbfd00000);
52 serial_init();
55 extern struct plat_smp_ops ssmtc_smp_ops;
57 void __init prom_init(void)
59 set_io_port_base(0xbfd00000);
61 prom_meminit();
63 if (cpu_has_mipsmt) {
64 if (!register_vsmp_smp_ops())
65 return;
67 #ifdef CONFIG_MIPS_MT_SMTC
68 register_smp_ops(&ssmtc_smp_ops);
69 return;
70 #endif
73 register_up_smp_ops();
76 static void __init serial_init(void)
78 #ifdef CONFIG_SERIAL_8250
79 struct uart_port s;
81 memset(&s, 0, sizeof(s));
83 s.iobase = 0x3f8;
85 /* hardware int 4 - the serial int, is CPU int 6
86 but poll for now */
87 s.irq = 0;
88 s.uartclk = 1843200;
89 s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
90 s.iotype = UPIO_PORT;
91 s.regshift = 0;
92 s.timeout = 4;
94 if (early_serial_setup(&s) != 0) {
95 printk(KERN_ERR "Serial setup failed!\n");
98 #endif