diff options
author | Andrew Lunn <andrew@lunn.ch> | 2011-05-15 07:32:41 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-05-16 14:46:17 -0400 |
commit | 28a2b45054f2e3f3671e36a6e9efc82756afa31a (patch) | |
tree | b33726c3de55636902cc033124eb3dd6ba6fe1d1 /arch/arm/mach-loki | |
parent | 5c60255149eece2a36ec9f5c99817b85f96fe8ec (diff) |
ARM: orion: Consolidate the creation of the uart platform data.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-loki')
-rw-r--r-- | arch/arm/mach-loki/common.c | 78 |
1 files changed, 5 insertions, 73 deletions
diff --git a/arch/arm/mach-loki/common.c b/arch/arm/mach-loki/common.c index 4ff4c62c3c02..c07180492bf0 100644 --- a/arch/arm/mach-loki/common.c +++ b/arch/arm/mach-loki/common.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <mach/loki.h> | 23 | #include <mach/loki.h> |
24 | #include <plat/orion_nand.h> | 24 | #include <plat/orion_nand.h> |
25 | #include <plat/time.h> | 25 | #include <plat/time.h> |
26 | #include <plat/common.h> | ||
26 | #include "common.h" | 27 | #include "common.h" |
27 | 28 | ||
28 | /***************************************************************************** | 29 | /***************************************************************************** |
@@ -204,88 +205,19 @@ void __init loki_sas_init(void) | |||
204 | /***************************************************************************** | 205 | /***************************************************************************** |
205 | * UART0 | 206 | * UART0 |
206 | ****************************************************************************/ | 207 | ****************************************************************************/ |
207 | static struct plat_serial8250_port loki_uart0_data[] = { | ||
208 | { | ||
209 | .mapbase = UART0_PHYS_BASE, | ||
210 | .membase = (char *)UART0_VIRT_BASE, | ||
211 | .irq = IRQ_LOKI_UART0, | ||
212 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
213 | .iotype = UPIO_MEM, | ||
214 | .regshift = 2, | ||
215 | .uartclk = LOKI_TCLK, | ||
216 | }, { | ||
217 | }, | ||
218 | }; | ||
219 | |||
220 | static struct resource loki_uart0_resources[] = { | ||
221 | { | ||
222 | .start = UART0_PHYS_BASE, | ||
223 | .end = UART0_PHYS_BASE + 0xff, | ||
224 | .flags = IORESOURCE_MEM, | ||
225 | }, { | ||
226 | .start = IRQ_LOKI_UART0, | ||
227 | .end = IRQ_LOKI_UART0, | ||
228 | .flags = IORESOURCE_IRQ, | ||
229 | }, | ||
230 | }; | ||
231 | |||
232 | static struct platform_device loki_uart0 = { | ||
233 | .name = "serial8250", | ||
234 | .id = PLAT8250_DEV_PLATFORM, | ||
235 | .dev = { | ||
236 | .platform_data = loki_uart0_data, | ||
237 | }, | ||
238 | .resource = loki_uart0_resources, | ||
239 | .num_resources = ARRAY_SIZE(loki_uart0_resources), | ||
240 | }; | ||
241 | |||
242 | void __init loki_uart0_init(void) | 208 | void __init loki_uart0_init(void) |
243 | { | 209 | { |
244 | platform_device_register(&loki_uart0); | 210 | orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE, |
211 | IRQ_LOKI_UART0, LOKI_TCLK); | ||
245 | } | 212 | } |
246 | 213 | ||
247 | |||
248 | /***************************************************************************** | 214 | /***************************************************************************** |
249 | * UART1 | 215 | * UART1 |
250 | ****************************************************************************/ | 216 | ****************************************************************************/ |
251 | static struct plat_serial8250_port loki_uart1_data[] = { | ||
252 | { | ||
253 | .mapbase = UART1_PHYS_BASE, | ||
254 | .membase = (char *)UART1_VIRT_BASE, | ||
255 | .irq = IRQ_LOKI_UART1, | ||
256 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
257 | .iotype = UPIO_MEM, | ||
258 | .regshift = 2, | ||
259 | .uartclk = LOKI_TCLK, | ||
260 | }, { | ||
261 | }, | ||
262 | }; | ||
263 | |||
264 | static struct resource loki_uart1_resources[] = { | ||
265 | { | ||
266 | .start = UART1_PHYS_BASE, | ||
267 | .end = UART1_PHYS_BASE + 0xff, | ||
268 | .flags = IORESOURCE_MEM, | ||
269 | }, { | ||
270 | .start = IRQ_LOKI_UART1, | ||
271 | .end = IRQ_LOKI_UART1, | ||
272 | .flags = IORESOURCE_IRQ, | ||
273 | }, | ||
274 | }; | ||
275 | |||
276 | static struct platform_device loki_uart1 = { | ||
277 | .name = "serial8250", | ||
278 | .id = PLAT8250_DEV_PLATFORM1, | ||
279 | .dev = { | ||
280 | .platform_data = loki_uart1_data, | ||
281 | }, | ||
282 | .resource = loki_uart1_resources, | ||
283 | .num_resources = ARRAY_SIZE(loki_uart1_resources), | ||
284 | }; | ||
285 | |||
286 | void __init loki_uart1_init(void) | 217 | void __init loki_uart1_init(void) |
287 | { | 218 | { |
288 | platform_device_register(&loki_uart1); | 219 | orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE, |
220 | IRQ_LOKI_UART1, LOKI_TCLK); | ||
289 | } | 221 | } |
290 | 222 | ||
291 | 223 | ||