Root/
Source at commit b9dc8f843011152bb754d54c4a53800b22d64e6c created 13 years 23 days ago. By Peter Zotov, MIPS: Add basic JZ4750 support. | |
---|---|
1 | /* |
2 | * Copyright (C) 2011 Peter Zotov <whitequark@whitequark.org> |
3 | * JZ4750 platform devices |
4 | * |
5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License as published by the |
7 | * Free Software Foundation; either version 2 of the License, or (at your |
8 | * option) any later version. |
9 | * |
10 | * You should have received a copy of the GNU General Public License along |
11 | * with this program; if not, write to the Free Software Foundation, Inc., |
12 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
13 | * |
14 | */ |
15 | |
16 | #include <linux/device.h> |
17 | #include <linux/init.h> |
18 | #include <linux/kernel.h> |
19 | #include <linux/platform_device.h> |
20 | #include <linux/resource.h> |
21 | |
22 | #include <linux/dma-mapping.h> |
23 | |
24 | #include <jz4750/platform.h> |
25 | #include <jz4750/base.h> |
26 | #include <jz4750/irq.h> |
27 | |
28 | #include <linux/serial_core.h> |
29 | #include <linux/serial_8250.h> |
30 | |
31 | #include "../serial.h" |
32 | #include "../clock.h" |
33 | |
34 | /* Serial */ |
35 | #define JZ4750_UART_DATA(_id) \ |
36 | { \ |
37 | .flags = UPF_SKIP_TEST | UPF_IOREMAP | UPF_FIXED_TYPE, \ |
38 | .iotype = UPIO_MEM, \ |
39 | .regshift = 2, \ |
40 | .serial_out = jz4740_serial_out, \ |
41 | .type = PORT_16550, \ |
42 | .mapbase = JZ4750_UART ## _id ## _BASE_ADDR, \ |
43 | .irq = JZ4750_IRQ_UART ## _id, \ |
44 | } |
45 | |
46 | static struct plat_serial8250_port jz4750_uart_data[] = { |
47 | JZ4750_UART_DATA(0), |
48 | {}, |
49 | }; |
50 | |
51 | static struct platform_device jz4740_uart_device = { |
52 | .name = "serial8250", |
53 | .id = 0, |
54 | .dev = { |
55 | .platform_data = jz4750_uart_data, |
56 | }, |
57 | }; |
58 | |
59 | void jz4750_serial_device_register(void) |
60 | { |
61 | struct plat_serial8250_port *p; |
62 | |
63 | for (p = jz4750_uart_data; p->flags != 0; ++p) |
64 | p->uartclk = jz4740_clock_bdata.ext_rate; |
65 | |
66 | platform_device_register(&jz4740_uart_device); |
67 | } |
68 |
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