diff options
| -rw-r--r-- | arch/arm/mach-dove/common.c | 159 | ||||
| -rw-r--r-- | arch/arm/mach-kirkwood/common.c | 79 | ||||
| -rw-r--r-- | arch/arm/mach-loki/common.c | 78 | ||||
| -rw-r--r-- | arch/arm/mach-mv78xx0/common.c | 160 | ||||
| -rw-r--r-- | arch/arm/mach-orion5x/common.c | 81 | ||||
| -rw-r--r-- | arch/arm/plat-orion/Makefile | 2 | ||||
| -rw-r--r-- | arch/arm/plat-orion/common.c | 171 | ||||
| -rw-r--r-- | arch/arm/plat-orion/include/plat/common.h | 33 |
8 files changed, 241 insertions, 522 deletions
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 30c951879787..fffa92e92d6c 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
| @@ -36,8 +36,11 @@ | |||
| 36 | #include <plat/mv_xor.h> | 36 | #include <plat/mv_xor.h> |
| 37 | #include <plat/ehci-orion.h> | 37 | #include <plat/ehci-orion.h> |
| 38 | #include <plat/time.h> | 38 | #include <plat/time.h> |
| 39 | #include <plat/common.h> | ||
| 39 | #include "common.h" | 40 | #include "common.h" |
| 40 | 41 | ||
| 42 | static int get_tclk(void); | ||
| 43 | |||
| 41 | /***************************************************************************** | 44 | /***************************************************************************** |
| 42 | * I/O Address Mapping | 45 | * I/O Address Mapping |
| 43 | ****************************************************************************/ | 46 | ****************************************************************************/ |
| @@ -255,173 +258,37 @@ void __init dove_sata_init(struct mv_sata_platform_data *sata_data) | |||
| 255 | /***************************************************************************** | 258 | /***************************************************************************** |
| 256 | * UART0 | 259 | * UART0 |
| 257 | ****************************************************************************/ | 260 | ****************************************************************************/ |
| 258 | static struct plat_serial8250_port dove_uart0_data[] = { | ||
| 259 | { | ||
| 260 | .mapbase = DOVE_UART0_PHYS_BASE, | ||
| 261 | .membase = (char *)DOVE_UART0_VIRT_BASE, | ||
| 262 | .irq = IRQ_DOVE_UART_0, | ||
| 263 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
| 264 | .iotype = UPIO_MEM, | ||
| 265 | .regshift = 2, | ||
| 266 | .uartclk = 0, | ||
| 267 | }, { | ||
| 268 | }, | ||
| 269 | }; | ||
| 270 | |||
| 271 | static struct resource dove_uart0_resources[] = { | ||
| 272 | { | ||
| 273 | .start = DOVE_UART0_PHYS_BASE, | ||
| 274 | .end = DOVE_UART0_PHYS_BASE + SZ_256 - 1, | ||
| 275 | .flags = IORESOURCE_MEM, | ||
| 276 | }, { | ||
| 277 | .start = IRQ_DOVE_UART_0, | ||
| 278 | .end = IRQ_DOVE_UART_0, | ||
| 279 | .flags = IORESOURCE_IRQ, | ||
| 280 | }, | ||
| 281 | }; | ||
| 282 | |||
| 283 | static struct platform_device dove_uart0 = { | ||
| 284 | .name = "serial8250", | ||
| 285 | .id = PLAT8250_DEV_PLATFORM, | ||
| 286 | .dev = { | ||
| 287 | .platform_data = dove_uart0_data, | ||
| 288 | }, | ||
| 289 | .resource = dove_uart0_resources, | ||
| 290 | .num_resources = ARRAY_SIZE(dove_uart0_resources), | ||
| 291 | }; | ||
| 292 | |||
| 293 | void __init dove_uart0_init(void) | 261 | void __init dove_uart0_init(void) |
| 294 | { | 262 | { |
| 295 | platform_device_register(&dove_uart0); | 263 | orion_uart0_init(DOVE_UART0_VIRT_BASE, DOVE_UART0_PHYS_BASE, |
| 264 | IRQ_DOVE_UART_0, get_tclk()); | ||
| 296 | } | 265 | } |
| 297 | 266 | ||
| 298 | /***************************************************************************** | 267 | /***************************************************************************** |
| 299 | * UART1 | 268 | * UART1 |
| 300 | ****************************************************************************/ | 269 | ****************************************************************************/ |
| 301 | static struct plat_serial8250_port dove_uart1_data[] = { | ||
| 302 | { | ||
| 303 | .mapbase = DOVE_UART1_PHYS_BASE, | ||
| 304 | .membase = (char *)DOVE_UART1_VIRT_BASE, | ||
| 305 | .irq = IRQ_DOVE_UART_1, | ||
| 306 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
| 307 | .iotype = UPIO_MEM, | ||
| 308 | .regshift = 2, | ||
| 309 | .uartclk = 0, | ||
| 310 | }, { | ||
| 311 | }, | ||
| 312 | }; | ||
| 313 | |||
| 314 | static struct resource dove_uart1_resources[] = { | ||
| 315 | { | ||
| 316 | .start = DOVE_UART1_PHYS_BASE, | ||
| 317 | .end = DOVE_UART1_PHYS_BASE + SZ_256 - 1, | ||
| 318 | .flags = IORESOURCE_MEM, | ||
| 319 | }, { | ||
| 320 | .start = IRQ_DOVE_UART_1, | ||
| 321 | .end = IRQ_DOVE_UART_1, | ||
| 322 | .flags = IORESOURCE_IRQ, | ||
| 323 | }, | ||
| 324 | }; | ||
| 325 | |||
| 326 | static struct platform_device dove_uart1 = { | ||
| 327 | .name = "serial8250", | ||
| 328 | .id = PLAT8250_DEV_PLATFORM1, | ||
| 329 | .dev = { | ||
| 330 | .platform_data = dove_uart1_data, | ||
| 331 | }, | ||
| 332 | .resource = dove_uart1_resources, | ||
| 333 | .num_resources = ARRAY_SIZE(dove_uart1_resources), | ||
| 334 | }; | ||
| 335 | |||
| 336 | void __init dove_uart1_init(void) | 270 | void __init dove_uart1_init(void) |
| 337 | { | 271 | { |
| 338 | platform_device_register(&dove_uart1); | 272 | orion_uart1_init(DOVE_UART1_VIRT_BASE, DOVE_UART1_PHYS_BASE, |
| 273 | IRQ_DOVE_UART_1, get_tclk()); | ||
| 339 | } | 274 | } |
| 340 | 275 | ||
| 341 | /***************************************************************************** | 276 | /***************************************************************************** |
| 342 | * UART2 | 277 | * UART2 |
| 343 | ****************************************************************************/ | 278 | ****************************************************************************/ |
| 344 | static struct plat_serial8250_port dove_uart2_data[] = { | ||
| 345 | { | ||
| 346 | .mapbase = DOVE_UART2_PHYS_BASE, | ||
| 347 | .membase = (char *)DOVE_UART2_VIRT_BASE, | ||
| 348 | .irq = IRQ_DOVE_UART_2, | ||
| 349 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
| 350 | .iotype = UPIO_MEM, | ||
| 351 | .regshift = 2, | ||
| 352 | .uartclk = 0, | ||
| 353 | }, { | ||
| 354 | }, | ||
| 355 | }; | ||
| 356 | |||
| 357 | static struct resource dove_uart2_resources[] = { | ||
| 358 | { | ||
| 359 | .start = DOVE_UART2_PHYS_BASE, | ||
| 360 | .end = DOVE_UART2_PHYS_BASE + SZ_256 - 1, | ||
| 361 | .flags = IORESOURCE_MEM, | ||
| 362 | }, { | ||
| 363 | .start = IRQ_DOVE_UART_2, | ||
| 364 | .end = IRQ_DOVE_UART_2, | ||
| 365 | .flags = IORESOURCE_IRQ, | ||
| 366 | }, | ||
| 367 | }; | ||
| 368 | |||
| 369 | static struct platform_device dove_uart2 = { | ||
| 370 | .name = "serial8250", | ||
| 371 | .id = PLAT8250_DEV_PLATFORM2, | ||
| 372 | .dev = { | ||
| 373 | .platform_data = dove_uart2_data, | ||
| 374 | }, | ||
| 375 | .resource = dove_uart2_resources, | ||
| 376 | .num_resources = ARRAY_SIZE(dove_uart2_resources), | ||
| 377 | }; | ||
| 378 | |||
| 379 | void __init dove_uart2_init(void) | 279 | void __init dove_uart2_init(void) |
| 380 | { | 280 | { |
| 381 | platform_device_register(&dove_uart2); | 281 | orion_uart2_init(DOVE_UART2_VIRT_BASE, DOVE_UART2_PHYS_BASE, |
| 282 | IRQ_DOVE_UART_2, get_tclk()); | ||
| 382 | } | 283 | } |
| 383 | 284 | ||
| 384 | /***************************************************************************** | 285 | /***************************************************************************** |
| 385 | * UART3 | 286 | * UART3 |
| 386 | ****************************************************************************/ | 287 | ****************************************************************************/ |
| 387 | static struct plat_serial8250_port dove_uart3_data[] = { | ||
| 388 | { | ||
| 389 | .mapbase = DOVE_UART3_PHYS_BASE, | ||
| 390 | .membase = (char *)DOVE_UART3_VIRT_BASE, | ||
| 391 | .irq = IRQ_DOVE_UART_3, | ||
| 392 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | ||
| 393 | .iotype = UPIO_MEM, | ||
| 394 | .regshift = 2, | ||
| 395 | .uartclk = 0, | ||
| 396 | }, { | ||
| 397 | }, | ||
| 398 | }; | ||
| 399 | |||
| 400 | static struct resource dove_uart3_resources[] = { | ||
| 401 | { | ||
| 402 | .start = DOVE_UART3_PHYS_BASE, | ||
| 403 | .end = DOVE_UART3_PHYS_BASE + SZ_256 - 1, | ||
| 404 | .flags = IORESOURCE_MEM, | ||
| 405 | }, { | ||
| 406 | .start = IRQ_DOVE_UART_3, | ||
| 407 | .end = IRQ_DOVE_UART_3, | ||
| 408 | .flags = IORESOURCE_IRQ, | ||
