blob: 60e66906be659089d4b5e07d19f30be8a5c13d64 [file] [log] [blame]
Ralf Baechlec78cbf42005-09-30 13:59:37 +01001/*
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
Ralf Baechlec78cbf42005-09-30 13:59:37 +010019#include <linux/init.h>
20#include <linux/string.h>
21#include <linux/kernel.h>
Ralf Baechlef6e23732007-07-10 17:32:56 +010022#include <linux/io.h>
23#include <linux/irq.h>
Ralf Baechlec78cbf42005-09-30 13:59:37 +010024#include <linux/ioport.h>
Ralf Baechlef6e23732007-07-10 17:32:56 +010025#include <linux/serial.h>
Ralf Baechlec78cbf42005-09-30 13:59:37 +010026#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>
Ralf Baechlec78cbf42005-09-30 13:59:37 +010032#include <asm/mips-boards/generic.h>
33#include <asm/mips-boards/prom.h>
Ralf Baechlec78cbf42005-09-30 13:59:37 +010034#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);
Ralf Baechlec78cbf42005-09-30 13:59:37 +010040static 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
Ralf Baechle2925aba2006-06-18 01:32:22 +010051void __init plat_mem_setup(void)
Ralf Baechlec78cbf42005-09-30 13:59:37 +010052{
53 set_io_port_base(0xbfd00000);
54
55 serial_init();
56
57 board_time_init = sim_time_init;
Ralf Baechle36a88532007-03-01 11:56:43 +000058 pr_info("Linux started...\n");
Ralf Baechlec78cbf42005-09-30 13:59:37 +010059
Robert P. J. Day9616d542007-01-25 18:41:35 -050060#ifdef CONFIG_MIPS_MT_SMP
Ralf Baechlec78cbf42005-09-30 13:59:37 +010061 sanitize_tlb_entries();
62#endif
63}
64
Ralf Baechlef6e23732007-07-10 17:32:56 +010065void __init prom_init(void)
Ralf Baechlec78cbf42005-09-30 13:59:37 +010066{
67 set_io_port_base(0xbfd00000);
68
Ralf Baechle36a88532007-03-01 11:56:43 +000069 pr_info("\nLINUX started...\n");
Ralf Baechlec78cbf42005-09-30 13:59:37 +010070 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;
Ralf Baechlea74b4602007-07-12 17:41:14 +010087 s.uartclk = 1843200;
Russell King59a675b2006-02-05 10:52:29 +000088 s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
Russell King9b4a1612006-02-05 10:48:10 +000089 s.iotype = UPIO_PORT;
Ralf Baechlec78cbf42005-09-30 13:59:37 +010090 s.regshift = 0;
91 s.timeout = 4;
92
93 if (early_serial_setup(&s) != 0) {
Ralf Baechle36a88532007-03-01 11:56:43 +000094 printk(KERN_ERR "Serial setup failed!\n");
Ralf Baechlec78cbf42005-09-30 13:59:37 +010095 }
96
97#endif
98}