aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2008-04-03 16:02:53 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-04-28 12:14:28 -0400
commit6e766458f78ca15198cf046bc098b36e40c8b471 (patch)
tree7cc0909addd8f44a8d550acff79f65ddceecf2f2 /arch
parentce28f94ca5a9ba3cd6bdcc47b52ea1b7a3bd933b (diff)
[MIPS] Alchemy: move UART platform code to its proper place
Move the code registering the Alchemy UART platform devices from drivers/serial/ to its proper place, into the Alchemy platform code. Fix the related Kconfig entry, while at it... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/au1000/common/platform.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/platform.c
index c1c860c6a6e1..7167972b1277 100644
--- a/arch/mips/au1000/common/platform.c
+++ b/arch/mips/au1000/common/platform.c
@@ -3,16 +3,65 @@
3 * 3 *
4 * Copyright 2004, Matt Porter <mporter@kernel.crashing.org> 4 * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
5 * 5 *
6 * (C) Copyright Embedded Alley Solutions, Inc 2005
7 * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
8 *
6 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
9 */ 12 */
10 13
11#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/serial_8250.h>
12#include <linux/init.h> 16#include <linux/init.h>
13 17
14#include <asm/mach-au1x00/au1xxx.h> 18#include <asm/mach-au1x00/au1xxx.h>
15 19
20#define PORT(_base, _irq) \
21 { \
22 .iobase = _base, \
23 .membase = (void __iomem *)_base,\
24 .mapbase = CPHYSADDR(_base), \
25 .irq = _irq, \
26 .regshift = 2, \
27 .iotype = UPIO_AU, \
28 .flags = UPF_SKIP_TEST \
29 }
30
31static struct plat_serial8250_port au1x00_uart_data[] = {
32#if defined(CONFIG_SERIAL_8250_AU1X00)
33#if defined(CONFIG_SOC_AU1000)
34 PORT(UART0_ADDR, AU1000_UART0_INT),
35 PORT(UART1_ADDR, AU1000_UART1_INT),
36 PORT(UART2_ADDR, AU1000_UART2_INT),
37 PORT(UART3_ADDR, AU1000_UART3_INT),
38#elif defined(CONFIG_SOC_AU1500)
39 PORT(UART0_ADDR, AU1500_UART0_INT),
40 PORT(UART3_ADDR, AU1500_UART3_INT),
41#elif defined(CONFIG_SOC_AU1100)
42 PORT(UART0_ADDR, AU1100_UART0_INT),
43 PORT(UART1_ADDR, AU1100_UART1_INT),
44 PORT(UART3_ADDR, AU1100_UART3_INT),
45#elif defined(CONFIG_SOC_AU1550)
46 PORT(UART0_ADDR, AU1550_UART0_INT),
47 PORT(UART1_ADDR, AU1550_UART1_INT),
48 PORT(UART3_ADDR, AU1550_UART3_INT),
49#elif defined(CONFIG_SOC_AU1200)
50 PORT(UART0_ADDR, AU1200_UART0_INT),
51 PORT(UART1_ADDR, AU1200_UART1_INT),
52#endif
53#endif /* CONFIG_SERIAL_8250_AU1X00 */
54 { },
55};
56
57static struct platform_device au1xx0_uart_device = {
58 .name = "serial8250",
59 .id = PLAT8250_DEV_AU1X00,
60 .dev = {
61 .platform_data = au1x00_uart_data,
62 },
63};
64
16/* OHCI (USB full speed host controller) */ 65/* OHCI (USB full speed host controller) */
17static struct resource au1xxx_usb_ohci_resources[] = { 66static struct resource au1xxx_usb_ohci_resources[] = {
18 [0] = { 67 [0] = {
@@ -287,6 +336,7 @@ static struct platform_device pbdb_smbus_device = {
287#endif 336#endif
288 337
289static struct platform_device *au1xxx_platform_devices[] __initdata = { 338static struct platform_device *au1xxx_platform_devices[] __initdata = {
339 &au1xx0_uart_device,
290 &au1xxx_usb_ohci_device, 340 &au1xxx_usb_ohci_device,
291 &au1x00_pcmcia_device, 341 &au1x00_pcmcia_device,
292#ifdef CONFIG_FB_AU1100 342#ifdef CONFIG_FB_AU1100
@@ -310,6 +360,13 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
310 360
311int __init au1xxx_platform_init(void) 361int __init au1xxx_platform_init(void)
312{ 362{
363 unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
364 int i;
365
366 /* Fill up uartclk. */
367 for (i = 0; au1x00_uart_data[i].flags ; i++)
368 au1x00_uart_data[i].uartclk = uartclk;
369
313 return platform_add_devices(au1xxx_platform_devices, ARRAY_SIZE(au1xxx_platform_devices)); 370 return platform_add_devices(au1xxx_platform_devices, ARRAY_SIZE(au1xxx_platform_devices));
314} 371}
315 372