aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mipssim/sim_setup.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-07-10 12:32:56 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-07-10 12:32:56 -0400
commitf6e2373ad6148476464fc7bb2610c6450c18cd2a (patch)
treef73cb9a4d26b30b2cbf8530047c3825809867be5 /arch/mips/mipssim/sim_setup.c
parent24e9d0b96dac5503c0b6f034d553030c604228a7 (diff)
[MIPS] MIPSsim: Move code away from the other MIPS Inc. BSP code.
It shares no code at all. While at it also fix up the beginning bitrot. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mipssim/sim_setup.c')
-rw-r--r--arch/mips/mipssim/sim_setup.c98
1 files changed, 98 insertions, 0 deletions
diff --git a/arch/mips/mipssim/sim_setup.c b/arch/mips/mipssim/sim_setup.c
new file mode 100644
index 000000000000..3643582bdade
--- /dev/null
+++ b/arch/mips/mipssim/sim_setup.c
@@ -0,0 +1,98 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
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.
7 *
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.
12 *
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.
16 *
17 */
18
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/serial.h>
26#include <linux/tty.h>
27#include <linux/serial.h>
28#include <linux/serial_core.h>
29
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
38
39extern void sim_time_init(void);
40static void __init serial_init(void);
41unsigned int _isbonito = 0;
42
43extern void __init sanitize_tlb_entries(void);
44
45
46const char *get_system_type(void)
47{
48 return "MIPSsim";
49}
50
51void __init plat_mem_setup(void)
52{
53 set_io_port_base(0xbfd00000);
54
55 serial_init();
56
57 board_time_init = sim_time_init;
58 pr_info("Linux started...\n");
59
60#ifdef CONFIG_MIPS_MT_SMP
61 sanitize_tlb_entries();
62#endif
63}
64
65void __init prom_init(void)
66{
67 set_io_port_base(0xbfd00000);
68
69 pr_info("\nLINUX started...\n");
70 prom_init_cmdline();
71 prom_meminit();
72}
73
74
75static void __init serial_init(void)
76{
77#ifdef CONFIG_SERIAL_8250
78 struct uart_port s;
79
80 memset(&s, 0, sizeof(s));
81
82 s.iobase = 0x3f8;
83
84 /* hardware int 4 - the serial int, is CPU int 6
85 but poll for now */
86 s.irq = 0;
87 s.uartclk = BASE_BAUD * 16;
88 s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
89 s.iotype = UPIO_PORT;
90 s.regshift = 0;
91 s.timeout = 4;
92
93 if (early_serial_setup(&s) != 0) {
94 printk(KERN_ERR "Serial setup failed!\n");
95 }
96
97#endif
98}