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-bf527 | |
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-bf527')
-rw-r--r-- | arch/blackfin/mach-bf527/boards/cm_bf527.c | 98 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezbrd.c | 98 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezkit.c | 98 |
3 files changed, 267 insertions, 27 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) |
606 | static struct resource bfin_uart_resources[] = { | ||
607 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 606 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
607 | static 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 | |||
635 | unsigned short bfin_uart0_peripherals[] = { | ||
636 | P_UART0_TX, P_UART0_RX, 0 | ||
637 | }; | ||
638 | |||
639 | static 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 |
650 | static 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 | ||
623 | static struct platform_device bfin_uart_device = { | 690 | unsigned short bfin_uart1_peripherals[] = { |
691 | P_UART1_TX, P_UART1_RX, 0 | ||
692 | }; | ||
693 | |||
694 | static 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) |
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c index cad23b15d83c..3a981e855668 100644 --- a/arch/blackfin/mach-bf527/boards/ezbrd.c +++ b/arch/blackfin/mach-bf527/boards/ezbrd.c | |||
@@ -439,30 +439,105 @@ static struct platform_device bfin_spi0_device = { | |||
439 | #endif /* spi master and devices */ | 439 | #endif /* spi master and devices */ |
440 | 440 | ||
441 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 441 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
442 | static struct resource bfin_uart_resources[] = { | ||
443 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 442 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
443 | static struct resource bfin_uart0_resources[] = { | ||
444 | { | 444 | { |
445 | .start = 0xFFC00400, | 445 | .start = UART0_THR, |
446 | .end = 0xFFC004FF, | 446 | .end = UART0_GCTL+2, |
447 | .flags = IORESOURCE_MEM, | 447 | .flags = IORESOURCE_MEM, |
448 | }, | 448 | }, |
449 | { | ||
450 | .start = IRQ_UART0_RX, | ||
451 | .end = IRQ_UART0_RX+1, | ||
452 | .flags = IORESOURCE_IRQ, | ||
453 | }, | ||
454 | { | ||
455 | .start = IRQ_UART0_ERROR, | ||
456 | .end = IRQ_UART0_ERROR, | ||
457 | .flags = IORESOURCE_IRQ, | ||
458 | }, | ||
459 | { | ||
460 | .start = CH_UART0_TX, | ||
461 | .end = CH_UART0_TX, | ||
462 | .flags = IORESOURCE_DMA, | ||
463 | }, | ||
464 | { | ||
465 | .start = CH_UART0_RX, | ||
466 | .end = CH_UART0_RX, | ||
467 | .flags = IORESOURCE_DMA, | ||
468 | }, | ||
469 | }; | ||
470 | |||
471 | unsigned short bfin_uart0_peripherals[] = { | ||
472 | P_UART0_TX, P_UART0_RX, 0 | ||
473 | }; | ||
474 | |||
475 | static struct platform_device bfin_uart0_device = { | ||
476 | .name = "bfin-uart", | ||
477 | .id = 0, | ||
478 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
479 | .resource = bfin_uart0_resources, | ||
480 | .dev = { | ||
481 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
482 | }, | ||
483 | }; | ||
449 | #endif | 484 | #endif |
450 | #ifdef CONFIG_SERIAL_BFIN_UART1 | 485 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
486 | static struct resource bfin_uart1_resources[] = { | ||
451 | { | 487 | { |
452 | .start = 0xFFC02000, | 488 | .start = UART1_THR, |
453 | .end = 0xFFC020FF, | 489 | .end = UART1_GCTL+2, |
454 | .flags = IORESOURCE_MEM, | 490 | .flags = IORESOURCE_MEM, |
455 | }, | 491 | }, |
492 | { | ||
493 | .start = IRQ_UART1_RX, | ||
494 | .end = IRQ_UART1_RX+1, | ||
495 | .flags = IORESOURCE_IRQ, | ||
496 | }, | ||
497 | { | ||
498 | .start = IRQ_UART1_ERROR, | ||
499 | .end = IRQ_UART1_ERROR, | ||
500 | .flags = IORESOURCE_IRQ, | ||
501 | }, | ||
502 | { | ||
503 | .start = CH_UART1_TX, | ||
504 | .end = CH_UART1_TX, | ||
505 | .flags = IORESOURCE_DMA, | ||
506 | }, | ||
507 | { | ||
508 | .start = CH_UART1_RX, | ||
509 | .end = CH_UART1_RX, | ||
510 | .flags = IORESOURCE_DMA, | ||
511 | }, | ||
512 | #ifdef CONFIG_BFIN_UART1_CTSRTS | ||
513 | { /* CTS pin */ | ||
514 | .start = GPIO_PG0, | ||
515 | .end = GPIO_PG0, | ||
516 | .flags = IORESOURCE_IO, | ||
517 | }, | ||
518 | { /* RTS pin */ | ||
519 | .start = GPIO_PF10, | ||
520 | .end = GPIO_PF10, | ||
521 | .flags = IORESOURCE_IO, | ||
522 | }, | ||
456 | #endif | 523 | #endif |
457 | }; | 524 | }; |
458 | 525 | ||
459 | static struct platform_device bfin_uart_device = { | 526 | unsigned short bfin_uart1_peripherals[] = { |
527 | P_UART1_TX, P_UART1_RX, 0 | ||
528 | }; | ||
529 | |||
530 | static struct platform_device bfin_uart1_device = { | ||
460 | .name = "bfin-uart", | 531 | .name = "bfin-uart", |
461 | .id = 1, | 532 | .id = 1, |
462 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 533 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
463 | .resource = bfin_uart_resources, | 534 | .resource = bfin_uart1_resources, |
535 | .dev = { | ||
536 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
537 | }, | ||
464 | }; | 538 | }; |
465 | #endif | 539 | #endif |
540 | #endif | ||
466 | 541 | ||
467 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 542 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
468 | #ifdef CONFIG_BFIN_SIR0 | 543 | #ifdef CONFIG_BFIN_SIR0 |
@@ -665,7 +740,12 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
665 | #endif | 740 | #endif |
666 | 741 | ||
667 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 742 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
668 | &bfin_uart_device, | 743 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
744 | &bfin_uart0_device, | ||
745 | #endif | ||
746 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
747 | &bfin_uart1_device, | ||
748 | #endif | ||
669 | #endif | 749 | #endif |
670 | 750 | ||
671 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) | 751 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c index 5294fdd20732..0750e655fb22 100644 --- a/arch/blackfin/mach-bf527/boards/ezkit.c +++ b/arch/blackfin/mach-bf527/boards/ezkit.c | |||
@@ -647,30 +647,105 @@ static struct platform_device bfin_spi0_device = { | |||
647 | #endif /* spi master and devices */ | 647 | #endif /* spi master and devices */ |
648 | 648 | ||
649 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 649 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
650 | static struct resource bfin_uart_resources[] = { | ||
651 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 650 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
651 | static struct resource bfin_uart0_resources[] = { | ||
652 | { | 652 | { |
653 | .start = 0xFFC00400, | 653 | .start = UART0_THR, |
654 | .end = 0xFFC004FF, | 654 | .end = UART0_GCTL+2, |
655 | .flags = IORESOURCE_MEM, | 655 | .flags = IORESOURCE_MEM, |
656 | }, | 656 | }, |
657 | { | ||
658 | .start = IRQ_UART0_RX, | ||
659 | .end = IRQ_UART0_RX+1, | ||
660 | .flags = IORESOURCE_IRQ, | ||
661 | }, | ||
662 | { | ||
663 | .start = IRQ_UART0_ERROR, | ||
664 | .end = IRQ_UART0_ERROR, | ||
665 | .flags = IORESOURCE_IRQ, | ||
666 | }, | ||
667 | { | ||
668 | .start = CH_UART0_TX, | ||
669 | .end = CH_UART0_TX, | ||
670 | .flags = IORESOURCE_DMA, | ||
671 | }, | ||
672 | { | ||
673 | .start = CH_UART0_RX, | ||
674 | .end = CH_UART0_RX, | ||
675 | .flags = IORESOURCE_DMA, | ||
676 | }, | ||
677 | }; | ||
678 | |||
679 | unsigned short bfin_uart0_peripherals[] = { | ||
680 | P_UART0_TX, P_UART0_RX, 0 | ||
681 | }; | ||
682 | |||
683 | static struct platform_device bfin_uart0_device = { | ||
684 | .name = "bfin-uart", | ||
685 | .id = 0, | ||
686 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
687 | .resource = bfin_uart0_resources, | ||
688 | .dev = { | ||
689 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
690 | }, | ||
691 | }; | ||
657 | #endif | 692 | #endif |
658 | #ifdef CONFIG_SERIAL_BFIN_UART1 | 693 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
694 | static struct resource bfin_uart1_resources[] = { | ||
659 | { | 695 | { |
660 | .start = 0xFFC02000, | 696 | .start = UART1_THR, |
661 | .end = 0xFFC020FF, | 697 | .end = UART1_GCTL+2, |
662 | .flags = IORESOURCE_MEM, | 698 | .flags = IORESOURCE_MEM, |
663 | }, | 699 | }, |
700 | { | ||
701 | .start = IRQ_UART1_RX, | ||
702 | .end = IRQ_UART1_RX+1, | ||
703 | .flags = IORESOURCE_IRQ, | ||
704 | }, | ||
705 | { | ||
706 | .start = IRQ_UART1_ERROR, | ||
707 | .end = IRQ_UART1_ERROR, | ||
708 | .flags = IORESOURCE_IRQ, | ||
709 | }, | ||
710 | { | ||
711 | .start = CH_UART1_TX, | ||
712 | .end = CH_UART1_TX, | ||
713 | .flags = IORESOURCE_DMA, | ||
714 | }, | ||
715 | { | ||
716 | .start = CH_UART1_RX, | ||
717 | .end = CH_UART1_RX, | ||
718 | .flags = IORESOURCE_DMA, | ||
719 | }, | ||
720 | #ifdef CONFIG_BFIN_UART1_CTSRTS | ||
721 | { /* CTS pin */ | ||
722 | .start = GPIO_PF9, | ||
723 | .end = GPIO_PF9, | ||
724 | .flags = IORESOURCE_IO, | ||
725 | }, | ||
726 | { /* RTS pin */ | ||
727 | .start = GPIO_PF10, | ||
728 | .end = GPIO_PF10, | ||
729 | .flags = IORESOURCE_IO, | ||
730 | }, | ||
664 | #endif | 731 | #endif |
665 | }; | 732 | }; |
666 | 733 | ||
667 | static struct platform_device bfin_uart_device = { | 734 | unsigned short bfin_uart1_peripherals[] = { |
735 | P_UART1_TX, P_UART1_RX, 0 | ||
736 | }; | ||
737 | |||
738 | static struct platform_device bfin_uart1_device = { | ||
668 | .name = "bfin-uart", | 739 | .name = "bfin-uart", |
669 | .id = 1, | 740 | .id = 1, |
670 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 741 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
671 | .resource = bfin_uart_resources, | 742 | .resource = bfin_uart1_resources, |
743 | .dev = { | ||
744 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
745 | }, | ||
672 | }; | 746 | }; |
673 | #endif | 747 | #endif |
748 | #endif | ||
674 | 749 | ||
675 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 750 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
676 | #ifdef CONFIG_BFIN_SIR0 | 751 | #ifdef CONFIG_BFIN_SIR0 |
@@ -910,7 +985,12 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
910 | #endif | 985 | #endif |
911 | 986 | ||
912 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 987 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
913 | &bfin_uart_device, | 988 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
989 | &bfin_uart0_device, | ||
990 | #endif | ||
991 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
992 | &bfin_uart1_device, | ||
993 | #endif | ||
914 | #endif | 994 | #endif |
915 | 995 | ||
916 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 996 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |