diff options
author | Johannes Weiner <jw@emlix.com> | 2009-03-04 10:21:33 -0500 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2009-04-03 02:44:31 -0400 |
commit | f82e939fb75ad01da8f0d3024fc678111ddb4ac7 (patch) | |
tree | 1edc0557251bdde18268dbe759b7e967c9555d3c /arch/xtensa/platforms/s6105/device.c | |
parent | 6770fa020fe3b63915ab082b4e5fd99d2d368c82 (diff) |
xtensa: platform: s6105
Support for the S6105 IP Camera Reference Design Kit.
Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Oskar Schirmer <os@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/platforms/s6105/device.c')
-rw-r--r-- | arch/xtensa/platforms/s6105/device.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/xtensa/platforms/s6105/device.c b/arch/xtensa/platforms/s6105/device.c new file mode 100644 index 000000000000..78b08be5a92d --- /dev/null +++ b/arch/xtensa/platforms/s6105/device.c | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * s6105 platform devices | ||
3 | * | ||
4 | * Copyright (c) 2009 emlix GmbH | ||
5 | */ | ||
6 | |||
7 | #include <linux/kernel.h> | ||
8 | #include <linux/init.h> | ||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/serial.h> | ||
11 | #include <linux/serial_8250.h> | ||
12 | |||
13 | #include <variant/hardware.h> | ||
14 | |||
15 | #define UART_INTNUM 4 | ||
16 | |||
17 | static const signed char uart_irq_mappings[] = { | ||
18 | S6_INTC_UART(0), | ||
19 | S6_INTC_UART(1), | ||
20 | -1, | ||
21 | }; | ||
22 | |||
23 | const signed char *platform_irq_mappings[NR_IRQS] = { | ||
24 | [UART_INTNUM] = uart_irq_mappings, | ||
25 | }; | ||
26 | |||
27 | static struct plat_serial8250_port serial_platform_data[] = { | ||
28 | { | ||
29 | .membase = (void *)S6_REG_UART + 0x0000, | ||
30 | .mapbase = S6_REG_UART + 0x0000, | ||
31 | .irq = UART_INTNUM, | ||
32 | .uartclk = S6_SCLK, | ||
33 | .regshift = 2, | ||
34 | .iotype = SERIAL_IO_MEM, | ||
35 | .flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST, | ||
36 | }, | ||
37 | { | ||
38 | .membase = (void *)S6_REG_UART + 0x1000, | ||
39 | .mapbase = S6_REG_UART + 0x1000, | ||
40 | .irq = UART_INTNUM, | ||
41 | .uartclk = S6_SCLK, | ||
42 | .regshift = 2, | ||
43 | .iotype = SERIAL_IO_MEM, | ||
44 | .flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST, | ||
45 | }, | ||
46 | { }, | ||
47 | }; | ||
48 | |||
49 | static struct platform_device platform_devices[] = { | ||
50 | { | ||
51 | .name = "serial8250", | ||
52 | .id = PLAT8250_DEV_PLATFORM, | ||
53 | .dev = { | ||
54 | .platform_data = serial_platform_data, | ||
55 | }, | ||
56 | }, | ||
57 | }; | ||
58 | |||
59 | static int __init device_init(void) | ||
60 | { | ||
61 | int i; | ||
62 | |||
63 | for (i = 0; i < ARRAY_SIZE(platform_devices); i++) | ||
64 | platform_device_register(&platform_devices[i]); | ||
65 | return 0; | ||
66 | } | ||
67 | arch_initcall_sync(device_init); | ||