diff options
author | Stepan Moskovchenko <stepanm@codeaurora.org> | 2011-01-27 15:12:07 -0500 |
---|---|---|
committer | David Brown <davidb@codeaurora.org> | 2011-01-28 15:27:21 -0500 |
commit | d056fca32354dd990ffbd90fd1da10eaec72aa87 (patch) | |
tree | e9ce24973cfcfdaa4ad752a277f1d665b35e6b94 | |
parent | 07a3cc4814f790354d4c7be2c9dc6143a714a07a (diff) |
msm: serial: Add MSM8960 serial support
Add the device definitions and platform data to support
the console serial port on MSM8960 Simulator and RUMI3
targets.
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
-rw-r--r-- | arch/arm/mach-msm/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-msm/board-msm8960.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices-msm8960.c | 85 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices.h | 3 |
4 files changed, 111 insertions, 1 deletions
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile index c7964417daed..ea8c74f56eaf 100644 --- a/arch/arm/mach-msm/Makefile +++ b/arch/arm/mach-msm/Makefile | |||
@@ -27,7 +27,7 @@ obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o | |||
27 | obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o | 27 | obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o |
28 | obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o | 28 | obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o |
29 | obj-$(CONFIG_ARCH_MSM8X60) += board-msm8x60.o | 29 | obj-$(CONFIG_ARCH_MSM8X60) += board-msm8x60.o |
30 | obj-$(CONFIG_ARCH_MSM8960) += board-msm8960.o | 30 | obj-$(CONFIG_ARCH_MSM8960) += board-msm8960.o devices-msm8960.o |
31 | 31 | ||
32 | obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o | 32 | obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o |
33 | obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o | 33 | obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o |
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c index 2b095735f142..ef80f46d6cb3 100644 --- a/arch/arm/mach-msm/board-msm8960.c +++ b/arch/arm/mach-msm/board-msm8960.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <mach/board.h> | 27 | #include <mach/board.h> |
28 | #include <mach/msm_iomap.h> | 28 | #include <mach/msm_iomap.h> |
29 | 29 | ||
30 | #include "devices.h" | ||
31 | |||
30 | static void __init msm8960_map_io(void) | 32 | static void __init msm8960_map_io(void) |
31 | { | 33 | { |
32 | msm_map_msm8960_io(); | 34 | msm_map_msm8960_io(); |
@@ -54,15 +56,35 @@ static void __init msm8960_init_irq(void) | |||
54 | } | 56 | } |
55 | } | 57 | } |
56 | 58 | ||
59 | static struct platform_device *sim_devices[] __initdata = { | ||
60 | &msm8960_device_uart_gsbi2, | ||
61 | }; | ||
62 | |||
63 | static struct platform_device *rumi3_devices[] __initdata = { | ||
64 | &msm8960_device_uart_gsbi5, | ||
65 | }; | ||
66 | |||
67 | static void __init msm8960_sim_init(void) | ||
68 | { | ||
69 | platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices)); | ||
70 | } | ||
71 | |||
72 | static void __init msm8960_rumi3_init(void) | ||
73 | { | ||
74 | platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices)); | ||
75 | } | ||
76 | |||
57 | MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR") | 77 | MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR") |
58 | .map_io = msm8960_map_io, | 78 | .map_io = msm8960_map_io, |
59 | .init_irq = msm8960_init_irq, | 79 | .init_irq = msm8960_init_irq, |
60 | .timer = &msm_timer, | 80 | .timer = &msm_timer, |
81 | .init_machine = msm8960_sim_init, | ||
61 | MACHINE_END | 82 | MACHINE_END |
62 | 83 | ||
63 | MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3") | 84 | MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3") |
64 | .map_io = msm8960_map_io, | 85 | .map_io = msm8960_map_io, |
65 | .init_irq = msm8960_init_irq, | 86 | .init_irq = msm8960_init_irq, |
66 | .timer = &msm_timer, | 87 | .timer = &msm_timer, |
88 | .init_machine = msm8960_rumi3_init, | ||
67 | MACHINE_END | 89 | MACHINE_END |
68 | 90 | ||
diff --git a/arch/arm/mach-msm/devices-msm8960.c b/arch/arm/mach-msm/devices-msm8960.c new file mode 100644 index 000000000000..d9e1f26475de --- /dev/null +++ b/arch/arm/mach-msm/devices-msm8960.c | |||
@@ -0,0 +1,85 @@ | |||
1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 and | ||
5 | * only version 2 as published by the Free Software Foundation. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
15 | * 02110-1301, USA. | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | |||
21 | #include <linux/dma-mapping.h> | ||
22 | #include <mach/irqs-8960.h> | ||
23 | #include <mach/board.h> | ||
24 | |||
25 | #include "devices.h" | ||
26 | |||
27 | #define MSM_GSBI2_PHYS 0x16100000 | ||
28 | #define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000) | ||
29 | |||
30 | #define MSM_GSBI5_PHYS 0x16400000 | ||
31 | #define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000) | ||
32 | |||
33 | static struct resource resources_uart_gsbi2[] = { | ||
34 | { | ||
35 | .start = GSBI2_UARTDM_IRQ, | ||
36 | .end = GSBI2_UARTDM_IRQ, | ||
37 | .flags = IORESOURCE_IRQ, | ||
38 | }, | ||
39 | { | ||
40 | .start = MSM_UART2DM_PHYS, | ||
41 | .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1, | ||
42 | .name = "uart_resource", | ||
43 | .flags = IORESOURCE_MEM, | ||
44 | }, | ||
45 | { | ||
46 | .start = MSM_GSBI2_PHYS, | ||
47 | .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1, | ||
48 | .name = "gsbi_resource", | ||
49 | .flags = IORESOURCE_MEM, | ||
50 | }, | ||
51 | }; | ||
52 | |||
53 | struct platform_device msm8960_device_uart_gsbi2 = { | ||
54 | .name = "msm_serial", | ||
55 | .id = 0, | ||
56 | .num_resources = ARRAY_SIZE(resources_uart_gsbi2), | ||
57 | .resource = resources_uart_gsbi2, | ||
58 | }; | ||
59 | |||
60 | static struct resource resources_uart_gsbi5[] = { | ||
61 | { | ||
62 | .start = GSBI5_UARTDM_IRQ, | ||
63 | .end = GSBI5_UARTDM_IRQ, | ||
64 | .flags = IORESOURCE_IRQ, | ||
65 | }, | ||
66 | { | ||
67 | .start = MSM_UART5DM_PHYS, | ||
68 | .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1, | ||
69 | .name = "uart_resource", | ||
70 | .flags = IORESOURCE_MEM, | ||
71 | }, | ||
72 | { | ||
73 | .start = MSM_GSBI5_PHYS, | ||
74 | .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1, | ||
75 | .name = "gsbi_resource", | ||
76 | .flags = IORESOURCE_MEM, | ||
77 | }, | ||
78 | }; | ||
79 | |||
80 | struct platform_device msm8960_device_uart_gsbi5 = { | ||
81 | .name = "msm_serial", | ||
82 | .id = 0, | ||
83 | .num_resources = ARRAY_SIZE(resources_uart_gsbi5), | ||
84 | .resource = resources_uart_gsbi5, | ||
85 | }; | ||
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h index 87c70bfce2bd..e2643b340b2a 100644 --- a/arch/arm/mach-msm/devices.h +++ b/arch/arm/mach-msm/devices.h | |||
@@ -22,6 +22,9 @@ extern struct platform_device msm_device_uart1; | |||
22 | extern struct platform_device msm_device_uart2; | 22 | extern struct platform_device msm_device_uart2; |
23 | extern struct platform_device msm_device_uart3; | 23 | extern struct platform_device msm_device_uart3; |
24 | 24 | ||
25 | extern struct platform_device msm8960_device_uart_gsbi2; | ||
26 | extern struct platform_device msm8960_device_uart_gsbi5; | ||
27 | |||
25 | extern struct platform_device msm_device_sdc1; | 28 | extern struct platform_device msm_device_sdc1; |
26 | extern struct platform_device msm_device_sdc2; | 29 | extern struct platform_device msm_device_sdc2; |
27 | extern struct platform_device msm_device_sdc3; | 30 | extern struct platform_device msm_device_sdc3; |