2 * linux/arch/mips/jz4740/common/setup.c
4 * JZ4740 common setup routines.
6 * Copyright (C) 2006 Ingenic Semiconductor Inc.
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 #include <linux/init.h>
23 #include <linux/string.h>
24 #include <linux/kernel.h>
26 #include <linux/ioport.h>
27 #include <linux/tty.h>
28 #include <linux/serial.h>
29 #include <linux/serial_core.h>
30 #include <linux/serial_8250.h>
33 #include <asm/bootinfo.h>
35 #include <asm/mipsregs.h>
36 #include <asm/reboot.h>
37 #include <asm/pgtable.h>
39 #include <asm/mach-jz4740/jz4740.h>
40 #include <asm/mach-jz4740/regs.h>
41 #include <asm/mach-jz4740/clock.h>
42 #include <asm/mach-jz4740/serial.h>
44 extern char *__init
prom_getcmdline(void);
45 extern void __init
jz_board_setup(void);
46 extern void jz_restart(char *);
47 extern void jz_halt(void);
48 extern void jz_power_off(void);
49 extern void jz_time_init(void);
51 static void __init
jz_serial_setup(void)
53 #ifdef CONFIG_SERIAL_8250
55 REG8(UART0_FCR
) |= UARTFCR_UUE
; /* enable UART module */
56 memset(&s
, 0, sizeof(s
));
57 s
.flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
;
58 s
.iotype
= SERIAL_IO_MEM
;
63 s
.membase
= (u8
*)UART0_BASE
;
65 if (early_serial_setup(&s
) != 0) {
66 printk(KERN_ERR
"Serial ttyS0 setup failed!\n");
70 s
.membase
= (u8
*)UART1_BASE
;
72 if (early_serial_setup(&s
) != 0) {
73 printk(KERN_ERR
"Serial ttyS1 setup failed!\n");
78 void __init
plat_mem_setup(void)
82 argptr
= prom_getcmdline();
84 /* IO/MEM resources. Which will be the addtion value in `inX' and
85 * `outX' macros defined in asm/io.h */
87 ioport_resource
.start
= 0x00000000;
88 ioport_resource
.end
= 0xffffffff;
89 iomem_resource
.start
= 0x00000000;
90 iomem_resource
.end
= 0xffffffff;
92 _machine_restart
= jz_restart
;
93 _machine_halt
= jz_halt
;
94 pm_power_off
= jz_power_off
;
This page took 0.044635 seconds and 5 git commands to generate.