aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf527/boards/cm_bf527.c
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2009-09-09 06:46:19 -0400
committerMike Frysinger <vapier@gentoo.org>2010-03-09 00:30:45 -0500
commit6bd1fbea2e8bff9346a5afb44ca948b4e4ed74a5 (patch)
tree87019fd6c4fb46bc64d6f0ddaaac32179a6af7e6 /arch/blackfin/mach-bf527/boards/cm_bf527.c
parent57d54889cd00db2752994b389ba714138652e60c (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-bf527/boards/cm_bf527.c')
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c98
1 files changed, 89 insertions, 9 deletions
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index 7ab0800e2914..2d93c1f520a2 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -603,30 +603,105 @@ static struct platform_device cm_flash_device = {
603#endif 603#endif
604 604
605#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 605#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
606static struct resource bfin_uart_resources[] = {
607#ifdef CONFIG_SERIAL_BFIN_UART0 606#ifdef CONFIG_SERIAL_BFIN_UART0
607static struct resource bfin_uart0_resources[] = {
608 { 608 {
609 .start = 0xFFC00400, 609 .start = UART0_THR,
610 .end = 0xFFC004FF, 610 .end = UART0_GCTL+2,
611 .flags = IORESOURCE_MEM, 611 .flags = IORESOURCE_MEM,
612 }, 612 },
613 {
614 .start = IRQ_UART0_RX,
615 .end = IRQ_UART0_RX+1,
616 .flags = IORESOURCE_IRQ,
617 },
618 {
619 .start = IRQ_UART0_ERROR,
620 .end = IRQ_UART0_ERROR,
621 .flags = IORESOURCE_IRQ,
622 },
623 {
624 .start = CH_UART0_TX,
625 .end = CH_UART0_TX,
626 .flags = IORESOURCE_DMA,
627 },
628 {
629 .start = CH_UART0_RX,
630 .end = CH_UART0_RX,
631 .flags = IORESOURCE_DMA,
632 },
633};
634
635unsigned short bfin_uart0_peripherals[] = {
636 P_UART0_TX, P_UART0_RX, 0
637};
638
639static struct platform_device bfin_uart0_device = {
640 .name = "bfin-uart",
641 .id = 0,
642 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
643 .resource = bfin_uart0_resources,
644 .dev = {
645 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
646 },
647};
613#endif 648#endif
614#ifdef CONFIG_SERIAL_BFIN_UART1 649#ifdef CONFIG_SERIAL_BFIN_UART1
650static struct resource bfin_uart1_resources[] = {
615 { 651 {
616 .start = 0xFFC02000, 652 .start = UART1_THR,
617 .end = 0xFFC020FF, 653 .end = UART1_GCTL+2,
618 .flags = IORESOURCE_MEM, 654 .flags = IORESOURCE_MEM,
619 }, 655 },
656 {
657 .start = IRQ_UART1_RX,
658 .end = IRQ_UART1_RX+1,
659 .flags = IORESOURCE_IRQ,
660 },
661 {
662 .start = IRQ_UART1_ERROR,
663 .end = IRQ_UART1_ERROR,
664 .flags = IORESOURCE_IRQ,
665 },
666 {
667 .start = CH_UART1_TX,
668 .end = CH_UART1_TX,
669 .flags = IORESOURCE_DMA,
670 },
671 {
672 .start = CH_UART1_RX,
673 .end = CH_UART1_RX,
674 .flags = IORESOURCE_DMA,
675 },
676#ifdef CONFIG_BFIN_UART1_CTSRTS
677 { /* CTS pin */
678 .start = GPIO_PF9,
679 .end = GPIO_PF9,
680 .flags = IORESOURCE_IO,
681 },
682 { /* RTS pin */
683 .start = GPIO_PF10,
684 .end = GPIO_PF10,
685 .flags = IORESOURCE_IO,
686 },
620#endif 687#endif
621}; 688};
622 689
623static struct platform_device bfin_uart_device = { 690unsigned short bfin_uart1_peripherals[] = {
691 P_UART1_TX, P_UART1_RX, 0
692};
693
694static struct platform_device bfin_uart1_device = {
624 .name = "bfin-uart", 695 .name = "bfin-uart",
625 .id = 1, 696 .id = 1,
626 .num_resources = ARRAY_SIZE(bfin_uart_resources), 697 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
627 .resource = bfin_uart_resources, 698 .resource = bfin_uart1_resources,
699 .dev = {
700 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
701 },
628}; 702};
629#endif 703#endif
704#endif
630 705
631#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 706#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
632#ifdef CONFIG_BFIN_SIR0 707#ifdef CONFIG_BFIN_SIR0
@@ -829,7 +904,12 @@ static struct platform_device *cmbf527_devices[] __initdata = {
829#endif 904#endif
830 905
831#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 906#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
832 &bfin_uart_device, 907#ifdef CONFIG_SERIAL_BFIN_UART0
908 &bfin_uart0_device,
909#endif
910#ifdef CONFIG_SERIAL_BFIN_UART1
911 &bfin_uart1_device,
912#endif
833#endif 913#endif
834 914
835#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 915#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)