Root/
1 | /* |
2 | * arch/arm/mach-ns9xxx/plat-serial8250.c |
3 | * |
4 | * Copyright (C) 2008 by Digi International Inc. |
5 | * All rights reserved. |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify it |
8 | * under the terms of the GNU General Public License version 2 as published by |
9 | * the Free Software Foundation. |
10 | */ |
11 | #include <linux/platform_device.h> |
12 | #include <linux/serial_8250.h> |
13 | #include <linux/slab.h> |
14 | |
15 | #include <mach/regs-board-a9m9750dev.h> |
16 | #include <mach/board.h> |
17 | |
18 | #define DRIVER_NAME "serial8250" |
19 | |
20 | static int __init ns9xxx_plat_serial8250_init(void) |
21 | { |
22 | struct plat_serial8250_port *pdata; |
23 | struct platform_device *pdev; |
24 | int ret = -ENOMEM; |
25 | int i; |
26 | |
27 | if (!board_is_a9m9750dev()) |
28 | return -ENODEV; |
29 | |
30 | pdev = platform_device_alloc(DRIVER_NAME, 0); |
31 | if (!pdev) |
32 | goto err; |
33 | |
34 | pdata = kzalloc(5 * sizeof(*pdata), GFP_KERNEL); |
35 | if (!pdata) |
36 | goto err; |
37 | |
38 | pdev->dev.platform_data = pdata; |
39 | |
40 | pdata[0].iobase = FPGA_UARTA_BASE; |
41 | pdata[1].iobase = FPGA_UARTB_BASE; |
42 | pdata[2].iobase = FPGA_UARTC_BASE; |
43 | pdata[3].iobase = FPGA_UARTD_BASE; |
44 | |
45 | for (i = 0; i < 4; ++i) { |
46 | pdata[i].membase = (void __iomem *)pdata[i].iobase; |
47 | pdata[i].mapbase = pdata[i].iobase; |
48 | pdata[i].iotype = UPIO_MEM; |
49 | pdata[i].uartclk = 18432000; |
50 | pdata[i].flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ; |
51 | } |
52 | |
53 | pdata[0].irq = IRQ_FPGA_UARTA; |
54 | pdata[1].irq = IRQ_FPGA_UARTB; |
55 | pdata[2].irq = IRQ_FPGA_UARTC; |
56 | pdata[3].irq = IRQ_FPGA_UARTD; |
57 | |
58 | ret = platform_device_add(pdev); |
59 | if (ret) { |
60 | err: |
61 | platform_device_put(pdev); |
62 | |
63 | printk(KERN_WARNING "Could not add %s (errno=%d)\n", |
64 | DRIVER_NAME, ret); |
65 | } |
66 | |
67 | return 0; |
68 | } |
69 | |
70 | arch_initcall(ns9xxx_plat_serial8250_init); |
71 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9