diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2009-09-09 06:46:19 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-03-09 00:30:45 -0500 |
commit | 6bd1fbea2e8bff9346a5afb44ca948b4e4ed74a5 (patch) | |
tree | 87019fd6c4fb46bc64d6f0ddaaac32179a6af7e6 /arch/blackfin/mach-bf518 | |
parent | 57d54889cd00db2752994b389ba714138652e60c (diff) |
Blackfin: move on-chip UART resources to boards files
Rather than keeping the pins in the actual driver and worrying about a
mess of Kconfig options, declare all the desired pin resources in the
boards file. This lets people easily select the specific pins/ports for
the normal UART as well as GPIOs for CTS/RTS.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf518')
-rw-r--r-- | arch/blackfin/mach-bf518/boards/ezbrd.c | 88 |
1 files changed, 78 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c index 01975c017116..0d1b021ffa69 100644 --- a/arch/blackfin/mach-bf518/boards/ezbrd.c +++ b/arch/blackfin/mach-bf518/boards/ezbrd.c | |||
@@ -382,30 +382,93 @@ static struct platform_device bfin_spi1_device = { | |||
382 | #endif /* spi master and devices */ | 382 | #endif /* spi master and devices */ |
383 | 383 | ||
384 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 384 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
385 | static struct resource bfin_uart_resources[] = { | ||
386 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 385 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
386 | static struct resource bfin_uart0_resources[] = { | ||
387 | { | 387 | { |
388 | .start = 0xFFC00400, | 388 | .start = UART0_THR, |
389 | .end = 0xFFC004FF, | 389 | .end = UART0_GCTL+2, |
390 | .flags = IORESOURCE_MEM, | 390 | .flags = IORESOURCE_MEM, |
391 | }, | 391 | }, |
392 | { | ||
393 | .start = IRQ_UART0_RX, | ||
394 | .end = IRQ_UART0_RX+1, | ||
395 | .flags = IORESOURCE_IRQ, | ||
396 | }, | ||
397 | { | ||
398 | .start = IRQ_UART0_ERROR, | ||
399 | .end = IRQ_UART0_ERROR, | ||
400 | .flags = IORESOURCE_IRQ, | ||
401 | }, | ||
402 | { | ||
403 | .start = CH_UART0_TX, | ||
404 | .end = CH_UART0_TX, | ||
405 | .flags = IORESOURCE_DMA, | ||
406 | }, | ||
407 | { | ||
408 | .start = CH_UART0_RX, | ||
409 | .end = CH_UART0_RX, | ||
410 | .flags = IORESOURCE_DMA, | ||
411 | }, | ||
412 | }; | ||
413 | |||
414 | unsigned short bfin_uart0_peripherals[] = { | ||
415 | P_UART0_TX, P_UART0_RX, 0 | ||
416 | }; | ||
417 | |||
418 | static struct platform_device bfin_uart0_device = { | ||
419 | .name = "bfin-uart", | ||
420 | .id = 0, | ||
421 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
422 | .resource = bfin_uart0_resources, | ||
423 | .dev = { | ||
424 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
425 | }, | ||
426 | }; | ||
392 | #endif | 427 | #endif |
393 | #ifdef CONFIG_SERIAL_BFIN_UART1 | 428 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
429 | static struct resource bfin_uart1_resources[] = { | ||
394 | { | 430 | { |
395 | .start = 0xFFC02000, | 431 | .start = UART1_THR, |
396 | .end = 0xFFC020FF, | 432 | .end = UART1_GCTL+2, |
397 | .flags = IORESOURCE_MEM, | 433 | .flags = IORESOURCE_MEM, |
398 | }, | 434 | }, |
399 | #endif | 435 | { |
436 | .start = IRQ_UART1_RX, | ||
437 | .end = IRQ_UART1_RX+1, | ||
438 | .flags = IORESOURCE_IRQ, | ||
439 | }, | ||
440 | { | ||
441 | .start = IRQ_UART1_ERROR, | ||
442 | .end = IRQ_UART1_ERROR, | ||
443 | .flags = IORESOURCE_IRQ, | ||
444 | }, | ||
445 | { | ||
446 | .start = CH_UART1_TX, | ||
447 | .end = CH_UART1_TX, | ||
448 | .flags = IORESOURCE_DMA, | ||
449 | }, | ||
450 | { | ||
451 | .start = CH_UART1_RX, | ||
452 | .end = CH_UART1_RX, | ||
453 | .flags = IORESOURCE_DMA, | ||
454 | }, | ||
400 | }; | 455 | }; |
401 | 456 | ||
402 | static struct platform_device bfin_uart_device = { | 457 | unsigned short bfin_uart1_peripherals[] = { |
458 | P_UART1_TX, P_UART1_RX, 0 | ||
459 | }; | ||
460 | |||
461 | static struct platform_device bfin_uart1_device = { | ||
403 | .name = "bfin-uart", | 462 | .name = "bfin-uart", |
404 | .id = 1, | 463 | .id = 1, |
405 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 464 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
406 | .resource = bfin_uart_resources, | 465 | .resource = bfin_uart1_resources, |
466 | .dev = { | ||
467 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
468 | }, | ||
407 | }; | 469 | }; |
408 | #endif | 470 | #endif |
471 | #endif | ||
409 | 472 | ||
410 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 473 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
411 | #ifdef CONFIG_BFIN_SIR0 | 474 | #ifdef CONFIG_BFIN_SIR0 |
@@ -593,7 +656,12 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
593 | #endif | 656 | #endif |
594 | 657 | ||
595 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 658 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
596 | &bfin_uart_device, | 659 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
660 | &bfin_uart0_device, | ||
661 | #endif | ||
662 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
663 | &bfin_uart1_device, | ||
664 | #endif | ||
597 | #endif | 665 | #endif |
598 | 666 | ||
599 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 667 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |