Linux-2.6.12-rc2
[linux-flexiantxendom0-natty.git] / arch / mips / vr4181 / common / serial.c
1 /*
2  * Copyright 2001 MontaVista Software Inc.
3  * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4  *
5  * arch/mips/vr4181/common/serial.c
6  *     initialize serial port on vr4181.
7  *
8  * This program is free software; you can redistribute  it and/or modify it
9  * under  the terms of  the GNU General  Public License as published by the
10  * Free Software Foundation;  either version 2 of the  License, or (at your
11  * option) any later version.
12  *
13  */
14
15 /*
16  * [jsun, 010925]
17  * You need to make sure rs_table has at least one element in
18  * drivers/char/serial.c file.  There is no good way to do it right
19  * now.  A workaround is to include CONFIG_SERIAL_MANY_PORTS in your
20  * configure file, which would gives you 64 ports and wastes 11K ram.
21  */
22
23 #include <linux/types.h>
24 #include <linux/kernel.h>
25 #include <linux/init.h>
26 #include <linux/serial.h>
27
28 #include <asm/vr4181/vr4181.h>
29
30 void __init vr4181_init_serial(void)
31 {
32         struct serial_struct s;
33
34         /* turn on UART clock */
35         *VR4181_CMUCLKMSK |= VR4181_CMUCLKMSK_MSKSIU;
36
37         /* clear memory */
38         memset(&s, 0, sizeof(s));
39
40         s.line = 0;                     /* we set the first one */
41         s.baud_base = 1152000;
42         s.irq = VR4181_IRQ_SIU;
43         s.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; /* STD_COM_FLAGS */
44         s.iomem_base = (u8*)VR4181_SIURB;
45         s.iomem_reg_shift = 0;
46         s.io_type = SERIAL_IO_MEM;
47         if (early_serial_setup(&s) != 0) {
48                 panic("vr4181_init_serial() failed!");
49         }
50 }
51