diff options
author | Byungho Min <bhminjames@gmail.com> | 2009-06-23 08:40:09 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-08-16 18:24:37 -0400 |
commit | 433a915fc6456ee3a4b740fe4d92caa78164fdce (patch) | |
tree | 5a72dbb60aab2bedbd2b9772a1c67d580057f496 | |
parent | ff54b4578448d616eb177e216acd599ecf5ee5b1 (diff) |
ARM: S5PC100: UART and Serial
Serial driver of S5PC100 is the same as S3C6400, so S5PC100 shares the serial
driver with S3C6400. Uart driver is copied from plat-s3c64xx to plat-s5pc1xx,
as I do not use plat-s3c64xx directory.
Signed-off-by: Byungho Min <bhmin@samsung.com>
[ben-linux@fluff.org: title fixup]
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r-- | arch/arm/plat-s5pc1xx/dev-uart.c | 174 | ||||
-rw-r--r-- | drivers/serial/Kconfig | 9 | ||||
-rw-r--r-- | drivers/serial/Makefile | 1 |
3 files changed, 183 insertions, 1 deletions
diff --git a/arch/arm/plat-s5pc1xx/dev-uart.c b/arch/arm/plat-s5pc1xx/dev-uart.c new file mode 100644 index 000000000000..f749bc5407b5 --- /dev/null +++ b/arch/arm/plat-s5pc1xx/dev-uart.c | |||
@@ -0,0 +1,174 @@ | |||
1 | /* linux/arch/arm/plat-s5pc1xx/dev-uart.c | ||
2 | * | ||
3 | * Copyright 2009 Samsung Electronics Co. | ||
4 | * Byungho Min <bhmin@samsung.com> | ||
5 | * | ||
6 | * Based on plat-s3c64xx/dev-uart.c | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <asm/mach/arch.h> | ||
21 | #include <asm/mach/irq.h> | ||
22 | #include <mach/hardware.h> | ||
23 | #include <mach/map.h> | ||
24 | |||
25 | #include <plat/devs.h> | ||
26 | |||
27 | /* Serial port registrations */ | ||
28 | |||
29 | /* 64xx uarts are closer together */ | ||
30 | |||
31 | static struct resource s5pc1xx_uart0_resource[] = { | ||
32 | [0] = { | ||
33 | .start = S3C_PA_UART0, | ||
34 | .end = S3C_PA_UART0 + 0x100, | ||
35 | .flags = IORESOURCE_MEM, | ||
36 | }, | ||
37 | [1] = { | ||
38 | .start = IRQ_S3CUART_RX0, | ||
39 | .end = IRQ_S3CUART_RX0, | ||
40 | .flags = IORESOURCE_IRQ, | ||
41 | }, | ||
42 | [2] = { | ||
43 | .start = IRQ_S3CUART_TX0, | ||
44 | .end = IRQ_S3CUART_TX0, | ||
45 | .flags = IORESOURCE_IRQ, | ||
46 | |||
47 | }, | ||
48 | [3] = { | ||
49 | .start = IRQ_S3CUART_ERR0, | ||
50 | .end = IRQ_S3CUART_ERR0, | ||
51 | .flags = IORESOURCE_IRQ, | ||
52 | } | ||
53 | }; | ||
54 | |||
55 | static struct resource s5pc1xx_uart1_resource[] = { | ||
56 | [0] = { | ||
57 | .start = S3C_PA_UART1, | ||
58 | .end = S3C_PA_UART1 + 0x100, | ||
59 | .flags = IORESOURCE_MEM, | ||
60 | }, | ||
61 | [1] = { | ||
62 | .start = IRQ_S3CUART_RX1, | ||
63 | .end = IRQ_S3CUART_RX1, | ||
64 | .flags = IORESOURCE_IRQ, | ||
65 | }, | ||
66 | [2] = { | ||
67 | .start = IRQ_S3CUART_TX1, | ||
68 | .end = IRQ_S3CUART_TX1, | ||
69 | .flags = IORESOURCE_IRQ, | ||
70 | |||
71 | }, | ||
72 | [3] = { | ||
73 | .start = IRQ_S3CUART_ERR1, | ||
74 | .end = IRQ_S3CUART_ERR1, | ||
75 | .flags = IORESOURCE_IRQ, | ||
76 | }, | ||
77 | }; | ||
78 | |||
79 | static struct resource s5pc1xx_uart2_resource[] = { | ||
80 | [0] = { | ||
81 | .start = S3C_PA_UART2, | ||
82 | .end = S3C_PA_UART2 + 0x100, | ||
83 | .flags = IORESOURCE_MEM, | ||
84 | }, | ||
85 | [1] = { | ||
86 | .start = IRQ_S3CUART_RX2, | ||
87 | .end = IRQ_S3CUART_RX2, | ||
88 | .flags = IORESOURCE_IRQ, | ||
89 | }, | ||
90 | [2] = { | ||
91 | .start = IRQ_S3CUART_TX2, | ||
92 | .end = IRQ_S3CUART_TX2, | ||
93 | .flags = IORESOURCE_IRQ, | ||
94 | |||
95 | }, | ||
96 | [3] = { | ||
97 | .start = IRQ_S3CUART_ERR2, | ||
98 | .end = IRQ_S3CUART_ERR2, | ||
99 | .flags = IORESOURCE_IRQ, | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | static struct resource s5pc1xx_uart3_resource[] = { | ||
104 | [0] = { | ||
105 | .start = S3C_PA_UART3, | ||
106 | .end = S3C_PA_UART3 + 0x100, | ||
107 | .flags = IORESOURCE_MEM, | ||
108 | }, | ||
109 | [1] = { | ||
110 | .start = IRQ_S3CUART_RX3, | ||
111 | .end = IRQ_S3CUART_RX3, | ||
112 | .flags = IORESOURCE_IRQ, | ||
113 | }, | ||
114 | [2] = { | ||
115 | .start = IRQ_S3CUART_TX3, | ||
116 | .end = IRQ_S3CUART_TX3, | ||
117 | .flags = IORESOURCE_IRQ, | ||
118 | |||
119 | }, | ||
120 | [3] = { | ||
121 | .start = IRQ_S3CUART_ERR3, | ||
122 | .end = IRQ_S3CUART_ERR3, | ||
123 | .flags = IORESOURCE_IRQ, | ||
124 | }, | ||
125 | }; | ||
126 | |||
127 | |||
128 | struct s3c24xx_uart_resources s5pc1xx_uart_resources[] __initdata = { | ||
129 | [0] = { | ||
130 | .resources = s5pc1xx_uart0_resource, | ||
131 | .nr_resources = ARRAY_SIZE(s5pc1xx_uart0_resource), | ||
132 | }, | ||
133 | [1] = { | ||
134 | .resources = s5pc1xx_uart1_resource, | ||
135 | .nr_resources = ARRAY_SIZE(s5pc1xx_uart1_resource), | ||
136 | }, | ||
137 | [2] = { | ||
138 | .resources = s5pc1xx_uart2_resource, | ||
139 | .nr_resources = ARRAY_SIZE(s5pc1xx_uart2_resource), | ||
140 | }, | ||
141 | [3] = { | ||
142 | .resources = s5pc1xx_uart3_resource, | ||
143 | .nr_resources = ARRAY_SIZE(s5pc1xx_uart3_resource), | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | /* uart devices */ | ||
148 | |||
149 | static struct platform_device s3c24xx_uart_device0 = { | ||
150 | .id = 0, | ||
151 | }; | ||
152 | |||
153 | static struct platform_device s3c24xx_uart_device1 = { | ||
154 | .id = 1, | ||
155 | }; | ||
156 | |||
157 | static struct platform_device s3c24xx_uart_device2 = { | ||
158 | .id = 2, | ||
159 | }; | ||
160 | |||
161 | static struct platform_device s3c24xx_uart_device3 = { | ||
162 | .id = 3, | ||
163 | }; | ||
164 | |||
165 | struct platform_device *s3c24xx_uart_src[4] = { | ||
166 | &s3c24xx_uart_device0, | ||
167 | &s3c24xx_uart_device1, | ||
168 | &s3c24xx_uart_device2, | ||
169 | &s3c24xx_uart_device3, | ||
170 | }; | ||
171 | |||
172 | struct platform_device *s3c24xx_uart_devs[4] = { | ||
173 | }; | ||
174 | |||
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 037c1e0b7c4c..cdd552d33a78 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig | |||
@@ -459,7 +459,7 @@ config SERIAL_SAMSUNG_UARTS | |||
459 | int | 459 | int |
460 | depends on ARM && PLAT_S3C | 460 | depends on ARM && PLAT_S3C |
461 | default 2 if ARCH_S3C2400 | 461 | default 2 if ARCH_S3C2400 |
462 | default 4 if ARCH_S3C64XX || CPU_S3C2443 | 462 | default 4 if ARCH_S5PC1XX || ARCH_S3C64XX || CPU_S3C2443 |
463 | default 3 | 463 | default 3 |
464 | help | 464 | help |
465 | Select the number of available UART ports for the Samsung S3C | 465 | Select the number of available UART ports for the Samsung S3C |
@@ -533,6 +533,13 @@ config SERIAL_S3C6400 | |||
533 | Serial port support for the Samsung S3C6400 and S3C6410 | 533 | Serial port support for the Samsung S3C6400 and S3C6410 |
534 | SoCs | 534 | SoCs |
535 | 535 | ||
536 | config SERIAL_S5PC100 | ||
537 | tristate "Samsung S5PC100 Serial port support" | ||
538 | depends on SERIAL_SAMSUNG && CPU_S5PC100 | ||
539 | default y | ||
540 | help | ||
541 | Serial port support for the Samsung S5PC100 SoCs | ||
542 | |||
536 | config SERIAL_MAX3100 | 543 | config SERIAL_MAX3100 |
537 | tristate "MAX3100 support" | 544 | tristate "MAX3100 support" |
538 | depends on SPI | 545 | depends on SPI |
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index d5a29981c6c4..97f6fcc8b432 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile | |||
@@ -43,6 +43,7 @@ obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o | |||
43 | obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o | 43 | obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o |
44 | obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o | 44 | obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o |
45 | obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o | 45 | obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o |
46 | obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o | ||
46 | obj-$(CONFIG_SERIAL_MAX3100) += max3100.o | 47 | obj-$(CONFIG_SERIAL_MAX3100) += max3100.o |
47 | obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o | 48 | obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o |
48 | obj-$(CONFIG_SERIAL_MUX) += mux.o | 49 | obj-$(CONFIG_SERIAL_MUX) += mux.o |