blob: 55f22a3afe6194bcea4f95f3ce510706a1725aa1 [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>
25#include <linux/tty.h>
26#include <linux/serial.h>
27#include <linux/serial_core.h>
Yinghai Lub187f182007-07-18 00:49:10 -070028#include <linux/serial_8250.h>
Ralf Baechlec78cbf42005-09-30 13:59:37 +010029
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
Ralf Baechlec78cbf42005-09-30 13:59:37 +010039static void __init serial_init(void);
Ralf Baechle982f6ff2009-09-17 02:25:07 +020040unsigned int _isbonito;
Ralf Baechlec78cbf42005-09-30 13:59:37 +010041
Ralf Baechlec78cbf42005-09-30 13:59:37 +010042const char *get_system_type(void)
43{
44 return "MIPSsim";
45}
46
Ralf Baechle2925aba2006-06-18 01:32:22 +010047void __init plat_mem_setup(void)
Ralf Baechlec78cbf42005-09-30 13:59:37 +010048{
49 set_io_port_base(0xbfd00000);
50
51 serial_init();
Ralf Baechlec78cbf42005-09-30 13:59:37 +010052}
53
Ralf Baechle87353d82007-11-19 12:23:51 +000054extern struct plat_smp_ops ssmtc_smp_ops;
55
Ralf Baechlef6e23732007-07-10 17:32:56 +010056void __init prom_init(void)
Ralf Baechlec78cbf42005-09-30 13:59:37 +010057{
58 set_io_port_base(0xbfd00000);
59
Ralf Baechlec78cbf42005-09-30 13:59:37 +010060 prom_meminit();
Ralf Baechlec78cbf42005-09-30 13:59:37 +010061
Ralf Baechle87353d82007-11-19 12:23:51 +000062#ifdef CONFIG_MIPS_MT_SMP
63 if (cpu_has_mipsmt)
64 register_smp_ops(&vsmp_smp_ops);
65 else
66 register_smp_ops(&up_smp_ops);
67#endif
68#ifdef CONFIG_MIPS_MT_SMTC
69 if (cpu_has_mipsmt)
70 register_smp_ops(&ssmtc_smp_ops);
71 else
72 register_smp_ops(&up_smp_ops);
73#endif
74}
Ralf Baechlec78cbf42005-09-30 13:59:37 +010075
76static void __init serial_init(void)
77{
78#ifdef CONFIG_SERIAL_8250
79 struct uart_port s;
80
81 memset(&s, 0, sizeof(s));
82
83 s.iobase = 0x3f8;
84
85 /* hardware int 4 - the serial int, is CPU int 6
86 but poll for now */
87 s.irq = 0;
Ralf Baechlea74b4602007-07-12 17:41:14 +010088 s.uartclk = 1843200;
Russell King59a675b2006-02-05 10:52:29 +000089 s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
Russell King9b4a1612006-02-05 10:48:10 +000090 s.iotype = UPIO_PORT;
Ralf Baechlec78cbf42005-09-30 13:59:37 +010091 s.regshift = 0;
92 s.timeout = 4;
93
94 if (early_serial_setup(&s) != 0) {
Ralf Baechle36a88532007-03-01 11:56:43 +000095 printk(KERN_ERR "Serial setup failed!\n");
Ralf Baechlec78cbf42005-09-30 13:59:37 +010096 }
97
98#endif
99}