aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c88
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c98
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c98
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c98
-rw-r--r--arch/blackfin/mach-bf533/boards/H8606.c47
-rw-r--r--arch/blackfin/mach-bf533/boards/blackstamp.c47
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c47
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c47
-rw-r--r--arch/blackfin/mach-bf533/boards/ip0x.c48
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c47
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537e.c22
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537u.c93
-rw-r--r--arch/blackfin/mach-bf537/boards/minotaur.c93
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c93
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c100
-rw-r--r--arch/blackfin/mach-bf537/boards/tcm_bf537.c93
-rw-r--r--arch/blackfin/mach-bf538/boards/ezkit.c145
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c206
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c206
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c47
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c47
-rw-r--r--arch/blackfin/mach-bf561/boards/tepla.c53
22 files changed, 1667 insertions, 196 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)
385static struct resource bfin_uart_resources[] = {
386#ifdef CONFIG_SERIAL_BFIN_UART0 385#ifdef CONFIG_SERIAL_BFIN_UART0
386static 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
414unsigned short bfin_uart0_peripherals[] = {
415 P_UART0_TX, P_UART0_RX, 0
416};
417
418static 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
429static 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
402static struct platform_device bfin_uart_device = { 457unsigned short bfin_uart1_peripherals[] = {
458 P_UART1_TX, P_UART1_RX, 0
459};
460
461static 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)
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)
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)
442static struct resource bfin_uart_resources[] = {
443#ifdef CONFIG_SERIAL_BFIN_UART0 442#ifdef CONFIG_SERIAL_BFIN_UART0
443static 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
471unsigned short bfin_uart0_peripherals[] = {
472 P_UART0_TX, P_UART0_RX, 0
473};
474
475static 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
486static 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
459static struct platform_device bfin_uart_device = { 526unsigned short bfin_uart1_peripherals[] = {
527 P_UART1_TX, P_UART1_RX, 0
528};
529
530static 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)
650static struct resource bfin_uart_resources[] = {
651#ifdef CONFIG_SERIAL_BFIN_UART0 650#ifdef CONFIG_SERIAL_BFIN_UART0
651static 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
679unsigned short bfin_uart0_peripherals[] = {
680 P_UART0_TX, P_UART0_RX, 0
681};
682
683static 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
694static 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
667static struct platform_device bfin_uart_device = { 734unsigned short bfin_uart1_peripherals[] = {
735 P_UART1_TX, P_UART1_RX, 0
736};
737
738static 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)
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c
index 4adceb0bdb6d..cb3b74f32346 100644
--- a/arch/blackfin/mach-bf533/boards/H8606.c
+++ b/arch/blackfin/mach-bf533/boards/H8606.c
@@ -257,21 +257,50 @@ static struct platform_device bfin_spi0_device = {
257#endif /* spi master and devices */ 257#endif /* spi master and devices */
258 258
259#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 259#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
260static struct resource bfin_uart_resources[] = { 260#ifdef CONFIG_SERIAL_BFIN_UART0
261static struct resource bfin_uart0_resources[] = {
261 { 262 {
262 .start = 0xFFC00400, 263 .start = BFIN_UART_THR,
263 .end = 0xFFC004FF, 264 .end = BFIN_UART_GCTL+2,
264 .flags = IORESOURCE_MEM, 265 .flags = IORESOURCE_MEM,
265 }, 266 },
267 {
268 .start = IRQ_UART0_RX,
269 .end = IRQ_UART0_RX + 1,
270 .flags = IORESOURCE_IRQ,
271 },
272 {
273 .start = IRQ_UART0_ERROR,
274 .end = IRQ_UART0_ERROR,
275 .flags = IORESOURCE_IRQ,
276 },
277 {
278 .start = CH_UART0_TX,
279 .end = CH_UART0_TX,
280 .flags = IORESOURCE_DMA,
281 },
282 {
283 .start = CH_UART0_RX,
284 .end = CH_UART0_RX,
285 .flags = IORESOURCE_DMA,
286 },
287};
288
289unsigned short bfin_uart0_peripherals[] = {
290 P_UART0_TX, P_UART0_RX, 0
266}; 291};
267 292
268static struct platform_device bfin_uart_device = { 293static struct platform_device bfin_uart0_device = {
269 .name = "bfin-uart", 294 .name = "bfin-uart",
270 .id = 1, 295 .id = 0,
271 .num_resources = ARRAY_SIZE(bfin_uart_resources), 296 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
272 .resource = bfin_uart_resources, 297 .resource = bfin_uart0_resources,
298 .dev = {
299 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
300 },
273}; 301};
274#endif 302#endif
303#endif
275 304
276#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 305#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
277#ifdef CONFIG_BFIN_SIR0 306#ifdef CONFIG_BFIN_SIR0
@@ -394,7 +423,9 @@ static struct platform_device *h8606_devices[] __initdata = {
394#endif 423#endif
395 424
396#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 425#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
397 &bfin_uart_device, 426#ifdef CONFIG_SERIAL_BFIN_UART0
427 &bfin_uart0_device,
428#endif
398#endif 429#endif
399 430
400#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 431#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c
index b580884848d4..50ce3ecfdcb2 100644
--- a/arch/blackfin/mach-bf533/boards/blackstamp.c
+++ b/arch/blackfin/mach-bf533/boards/blackstamp.c
@@ -195,21 +195,50 @@ static struct platform_device bfin_spi0_device = {
195#endif /* spi master and devices */ 195#endif /* spi master and devices */
196 196
197#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 197#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
198static struct resource bfin_uart_resources[] = { 198#ifdef CONFIG_SERIAL_BFIN_UART0
199static struct resource bfin_uart0_resources[] = {
199 { 200 {
200 .start = 0xFFC00400, 201 .start = BFIN_UART_THR,
201 .end = 0xFFC004FF, 202 .end = BFIN_UART_GCTL+2,
202 .flags = IORESOURCE_MEM, 203 .flags = IORESOURCE_MEM,
203 }, 204 },
205 {
206 .start = IRQ_UART0_RX,
207 .end = IRQ_UART0_RX + 1,
208 .flags = IORESOURCE_IRQ,
209 },
210 {
211 .start = IRQ_UART0_ERROR,
212 .end = IRQ_UART0_ERROR,
213 .flags = IORESOURCE_IRQ,
214 },
215 {
216 .start = CH_UART0_TX,
217 .end = CH_UART0_TX,
218 .flags = IORESOURCE_DMA,
219 },
220 {
221 .start = CH_UART0_RX,
222 .end = CH_UART0_RX,
223 .flags = IORESOURCE_DMA,
224 },
225};
226
227unsigned short bfin_uart0_peripherals[] = {
228 P_UART0_TX, P_UART0_RX, 0
204}; 229};
205 230
206static struct platform_device bfin_uart_device = { 231static struct platform_device bfin_uart0_device = {
207 .name = "bfin-uart", 232 .name = "bfin-uart",
208 .id = 1, 233 .id = 0,
209 .num_resources = ARRAY_SIZE(bfin_uart_resources), 234 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
210 .resource = bfin_uart_resources, 235 .resource = bfin_uart0_resources,
236 .dev = {
237 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
238 },
211}; 239};
212#endif 240#endif
241#endif
213 242
214#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 243#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
215#ifdef CONFIG_BFIN_SIR0 244#ifdef CONFIG_BFIN_SIR0
@@ -344,7 +373,9 @@ static struct platform_device *stamp_devices[] __initdata = {
344#endif 373#endif
345 374
346#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 375#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
347 &bfin_uart_device, 376#ifdef CONFIG_SERIAL_BFIN_UART0
377 &bfin_uart0_device,
378#endif
348#endif 379#endif
349 380
350#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 381#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index 7fc3b860d4ae..f707faf8a864 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -242,21 +242,50 @@ static struct platform_device smsc911x_device = {
242#endif 242#endif
243 243
244#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 244#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
245static struct resource bfin_uart_resources[] = { 245#ifdef CONFIG_SERIAL_BFIN_UART0
246static struct resource bfin_uart0_resources[] = {
246 { 247 {
247 .start = 0xFFC00400, 248 .start = BFIN_UART_THR,
248 .end = 0xFFC004FF, 249 .end = BFIN_UART_GCTL+2,
249 .flags = IORESOURCE_MEM, 250 .flags = IORESOURCE_MEM,
250 }, 251 },
252 {
253 .start = IRQ_UART0_RX,
254 .end = IRQ_UART0_RX + 1,
255 .flags = IORESOURCE_IRQ,
256 },
257 {
258 .start = IRQ_UART0_ERROR,
259 .end = IRQ_UART0_ERROR,
260 .flags = IORESOURCE_IRQ,
261 },
262 {
263 .start = CH_UART0_TX,
264 .end = CH_UART0_TX,
265 .flags = IORESOURCE_DMA,
266 },
267 {
268 .start = CH_UART0_RX,
269 .end = CH_UART0_RX,
270 .flags = IORESOURCE_DMA,
271 },
272};
273
274unsigned short bfin_uart0_peripherals[] = {
275 P_UART0_TX, P_UART0_RX, 0
251}; 276};
252 277
253static struct platform_device bfin_uart_device = { 278static struct platform_device bfin_uart0_device = {
254 .name = "bfin-uart", 279 .name = "bfin-uart",
255 .id = 1, 280 .id = 0,
256 .num_resources = ARRAY_SIZE(bfin_uart_resources), 281 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
257 .resource = bfin_uart_resources, 282 .resource = bfin_uart0_resources,
283 .dev = {
284 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
285 },
258}; 286};
259#endif 287#endif
288#endif
260 289
261#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 290#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
262#ifdef CONFIG_BFIN_SIR0 291#ifdef CONFIG_BFIN_SIR0
@@ -432,7 +461,9 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
432 &bfin_dpmc, 461 &bfin_dpmc,
433 462
434#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 463#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
435 &bfin_uart_device, 464#ifdef CONFIG_SERIAL_BFIN_UART0
465 &bfin_uart0_device,
466#endif
436#endif 467#endif
437 468
438#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 469#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index d4689dcc198e..50392476722a 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -320,21 +320,50 @@ static struct platform_device bfin_spi0_device = {
320#endif /* spi master and devices */ 320#endif /* spi master and devices */
321 321
322#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 322#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
323static struct resource bfin_uart_resources[] = { 323#ifdef CONFIG_SERIAL_BFIN_UART0
324static struct resource bfin_uart0_resources[] = {
324 { 325 {
325 .start = 0xFFC00400, 326 .start = BFIN_UART_THR,
326 .end = 0xFFC004FF, 327 .end = BFIN_UART_GCTL+2,
327 .flags = IORESOURCE_MEM, 328 .flags = IORESOURCE_MEM,
328 }, 329 },
330 {
331 .start = IRQ_UART0_RX,
332 .end = IRQ_UART0_RX + 1,
333 .flags = IORESOURCE_IRQ,
334 },
335 {
336 .start = IRQ_UART0_ERROR,
337 .end = IRQ_UART0_ERROR,
338 .flags = IORESOURCE_IRQ,
339 },
340 {
341 .start = CH_UART0_TX,
342 .end = CH_UART0_TX,
343 .flags = IORESOURCE_DMA,
344 },
345 {
346 .start = CH_UART0_RX,
347 .end = CH_UART0_RX,
348 .flags = IORESOURCE_DMA,
349 },
350};
351
352unsigned short bfin_uart0_peripherals[] = {
353 P_UART0_TX, P_UART0_RX, 0
329}; 354};
330 355
331static struct platform_device bfin_uart_device = { 356static struct platform_device bfin_uart0_device = {
332 .name = "bfin-uart", 357 .name = "bfin-uart",
333 .id = 1, 358 .id = 0,
334 .num_resources = ARRAY_SIZE(bfin_uart_resources), 359 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
335 .resource = bfin_uart_resources, 360 .resource = bfin_uart0_resources,
361 .dev = {
362 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
363 },
336}; 364};
337#endif 365#endif
366#endif
338 367
339#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 368#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
340#ifdef CONFIG_BFIN_SIR0 369#ifdef CONFIG_BFIN_SIR0
@@ -471,7 +500,9 @@ static struct platform_device *ezkit_devices[] __initdata = {
471#endif 500#endif
472 501
473#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 502#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
474 &bfin_uart_device, 503#ifdef CONFIG_SERIAL_BFIN_UART0
504 &bfin_uart0_device,
505#endif
475#endif 506#endif
476 507
477#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 508#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/ip0x.c b/arch/blackfin/mach-bf533/boards/ip0x.c
index 8ec42ba35b9e..a60d0369ceb7 100644
--- a/arch/blackfin/mach-bf533/boards/ip0x.c
+++ b/arch/blackfin/mach-bf533/boards/ip0x.c
@@ -19,6 +19,7 @@
19#include <linux/usb/isp1362.h> 19#include <linux/usb/isp1362.h>
20#endif 20#endif
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/dma.h>
22#include <asm/bfin5xx_spi.h> 23#include <asm/bfin5xx_spi.h>
23#include <asm/portmux.h> 24#include <asm/portmux.h>
24 25
@@ -143,21 +144,50 @@ static struct platform_device spi_bfin_master_device = {
143#endif /* spi master and devices */ 144#endif /* spi master and devices */
144 145
145#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 146#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
146static struct resource bfin_uart_resources[] = { 147#ifdef CONFIG_SERIAL_BFIN_UART0
148static struct resource bfin_uart0_resources[] = {
147 { 149 {
148 .start = 0xFFC00400, 150 .start = BFIN_UART_THR,
149 .end = 0xFFC004FF, 151 .end = BFIN_UART_GCTL+2,
150 .flags = IORESOURCE_MEM, 152 .flags = IORESOURCE_MEM,
151 }, 153 },
154 {
155 .start = IRQ_UART0_RX,
156 .end = IRQ_UART0_RX + 1,
157 .flags = IORESOURCE_IRQ,
158 },
159 {
160 .start = IRQ_UART0_ERROR,
161 .end = IRQ_UART0_ERROR,
162 .flags = IORESOURCE_IRQ,
163 },
164 {
165 .start = CH_UART0_TX,
166 .end = CH_UART0_TX,
167 .flags = IORESOURCE_DMA,
168 },
169 {
170 .start = CH_UART0_RX,
171 .end = CH_UART0_RX,
172 .flags = IORESOURCE_DMA,
173 },
174};
175
176unsigned short bfin_uart0_peripherals[] = {
177 P_UART0_TX, P_UART0_RX, 0
152}; 178};
153 179
154static struct platform_device bfin_uart_device = { 180static struct platform_device bfin_uart0_device = {
155 .name = "bfin-uart", 181 .name = "bfin-uart",
156 .id = 1, 182 .id = 0,
157 .num_resources = ARRAY_SIZE(bfin_uart_resources), 183 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
158 .resource = bfin_uart_resources, 184 .resource = bfin_uart0_resources,
185 .dev = {
186 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
187 },
159}; 188};
160#endif 189#endif
190#endif
161 191
162#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 192#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
163#ifdef CONFIG_BFIN_SIR0 193#ifdef CONFIG_BFIN_SIR0
@@ -241,7 +271,9 @@ static struct platform_device *ip0x_devices[] __initdata = {
241#endif 271#endif
242 272
243#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 273#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
244 &bfin_uart_device, 274#ifdef CONFIG_SERIAL_BFIN_UART0
275 &bfin_uart0_device,
276#endif
245#endif 277#endif
246 278
247#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 279#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 6d68dcfa2da2..2683e5f2294f 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -322,21 +322,50 @@ static struct platform_device bfin_spi0_device = {
322#endif /* spi master and devices */ 322#endif /* spi master and devices */
323 323
324#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 324#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
325static struct resource bfin_uart_resources[] = { 325#ifdef CONFIG_SERIAL_BFIN_UART0
326static struct resource bfin_uart0_resources[] = {
326 { 327 {
327 .start = 0xFFC00400, 328 .start = BFIN_UART_THR,
328 .end = 0xFFC004FF, 329 .end = BFIN_UART_GCTL+2,
329 .flags = IORESOURCE_MEM, 330 .flags = IORESOURCE_MEM,
330 }, 331 },
332 {
333 .start = IRQ_UART0_RX,
334 .end = IRQ_UART0_RX + 1,
335 .flags = IORESOURCE_IRQ,
336 },
337 {
338 .start = IRQ_UART0_ERROR,
339 .end = IRQ_UART0_ERROR,
340 .flags = IORESOURCE_IRQ,
341 },
342 {
343 .start = CH_UART0_TX,
344 .end = CH_UART0_TX,
345 .flags = IORESOURCE_DMA,
346 },
347 {
348 .start = CH_UART0_RX,
349 .end = CH_UART0_RX,
350 .flags = IORESOURCE_DMA,
351 },
352};
353
354unsigned short bfin_uart0_peripherals[] = {
355 P_UART0_TX, P_UART0_RX, 0
331}; 356};
332 357
333static struct platform_device bfin_uart_device = { 358static struct platform_device bfin_uart0_device = {
334 .name = "bfin-uart", 359 .name = "bfin-uart",
335 .id = 1, 360 .id = 0,
336 .num_resources = ARRAY_SIZE(bfin_uart_resources), 361 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
337 .resource = bfin_uart_resources, 362 .resource = bfin_uart0_resources,
363 .dev = {
364 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
365 },
338}; 366};
339#endif 367#endif
368#endif
340 369
341#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 370#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
342#ifdef CONFIG_BFIN_SIR0 371#ifdef CONFIG_BFIN_SIR0
@@ -495,7 +524,9 @@ static struct platform_device *stamp_devices[] __initdata = {
495#endif 524#endif
496 525
497#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 526#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
498 &bfin_uart_device, 527#ifdef CONFIG_SERIAL_BFIN_UART0
528 &bfin_uart0_device,
529#endif
499#endif 530#endif
500 531
501#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 532#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
index c85f4d770535..abb32ddc5122 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537e.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
@@ -329,8 +329,8 @@ static struct platform_device cm_flash_device = {
329#ifdef CONFIG_SERIAL_BFIN_UART0 329#ifdef CONFIG_SERIAL_BFIN_UART0
330static struct resource bfin_uart0_resources[] = { 330static struct resource bfin_uart0_resources[] = {
331 { 331 {
332 .start = 0xFFC00400, 332 .start = UART0_THR,
333 .end = 0xFFC004FF, 333 .end = UART0_GCTL+2,
334 .flags = IORESOURCE_MEM, 334 .flags = IORESOURCE_MEM,
335 }, 335 },
336 { 336 {
@@ -373,18 +373,25 @@ static struct resource bfin_uart0_resources[] = {
373#endif 373#endif
374}; 374};
375 375
376unsigned short bfin_uart0_peripherals[] = {
377 P_UART0_TX, P_UART0_RX, 0
378};
379
376static struct platform_device bfin_uart0_device = { 380static struct platform_device bfin_uart0_device = {
377 .name = "bfin-uart", 381 .name = "bfin-uart",
378 .id = 0, 382 .id = 0,
379 .num_resources = ARRAY_SIZE(bfin_uart0_resources), 383 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
380 .resource = bfin_uart0_resources, 384 .resource = bfin_uart0_resources,
385 .dev = {
386 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
387 },
381}; 388};
382#endif 389#endif
383#ifdef CONFIG_SERIAL_BFIN_UART1 390#ifdef CONFIG_SERIAL_BFIN_UART1
384static struct resource bfin_uart1_resources[] = { 391static struct resource bfin_uart1_resources[] = {
385 { 392 {
386 .start = 0xFFC02000, 393 .start = UART1_THR,
387 .end = 0xFFC020FF, 394 .end = UART1_GCTL+2,
388 .flags = IORESOURCE_MEM, 395 .flags = IORESOURCE_MEM,
389 }, 396 },
390 { 397 {
@@ -427,11 +434,18 @@ static struct resource bfin_uart1_resources[] = {
427#endif 434#endif
428}; 435};
429 436
437unsigned short bfin_uart1_peripherals[] = {
438 P_UART1_TX, P_UART1_RX, 0
439};
440
430static struct platform_device bfin_uart1_device = { 441static struct platform_device bfin_uart1_device = {
431 .name = "bfin-uart", 442 .name = "bfin-uart",
432 .id = 1, 443 .id = 1,
433 .num_resources = ARRAY_SIZE(bfin_uart1_resources), 444 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
434 .resource = bfin_uart1_resources, 445 .resource = bfin_uart1_resources,
446 .dev = {
447 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
448 },
435}; 449};
436#endif 450#endif
437#endif 451#endif
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537u.c b/arch/blackfin/mach-bf537/boards/cm_bf537u.c
index ea11aa81340d..b3182face957 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537u.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537u.c
@@ -327,25 +327,93 @@ static struct platform_device cm_flash_device = {
327#endif 327#endif
328 328
329#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 329#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
330static struct resource bfin_uart_resources[] = { 330#ifdef CONFIG_SERIAL_BFIN_UART0
331static struct resource bfin_uart0_resources[] = {
331 { 332 {
332 .start = 0xFFC00400, 333 .start = UART0_THR,
333 .end = 0xFFC004FF, 334 .end = UART0_GCTL+2,
334 .flags = IORESOURCE_MEM, 335 .flags = IORESOURCE_MEM,
335 }, { 336 },
336 .start = 0xFFC02000, 337 {
337 .end = 0xFFC020FF, 338 .start = IRQ_UART0_RX,
339 .end = IRQ_UART0_RX+1,
340 .flags = IORESOURCE_IRQ,
341 },
342 {
343 .start = IRQ_UART0_ERROR,
344 .end = IRQ_UART0_ERROR,
345 .flags = IORESOURCE_IRQ,
346 },
347 {
348 .start = CH_UART0_TX,
349 .end = CH_UART0_TX,
350 .flags = IORESOURCE_DMA,
351 },
352 {
353 .start = CH_UART0_RX,
354 .end = CH_UART0_RX,
355 .flags = IORESOURCE_DMA,
356 },
357};
358
359unsigned short bfin_uart0_peripherals[] = {
360 P_UART0_TX, P_UART0_RX, 0
361};
362
363static struct platform_device bfin_uart0_device = {
364 .name = "bfin-uart",
365 .id = 0,
366 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
367 .resource = bfin_uart0_resources,
368 .dev = {
369 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
370 },
371};
372#endif
373#ifdef CONFIG_SERIAL_BFIN_UART1
374static struct resource bfin_uart1_resources[] = {
375 {
376 .start = UART1_THR,
377 .end = UART1_GCTL+2,
338 .flags = IORESOURCE_MEM, 378 .flags = IORESOURCE_MEM,
339 }, 379 },
380 {
381 .start = IRQ_UART1_RX,
382 .end = IRQ_UART1_RX+1,
383 .flags = IORESOURCE_IRQ,
384 },
385 {
386 .start = IRQ_UART1_ERROR,
387 .end = IRQ_UART1_ERROR,
388 .flags = IORESOURCE_IRQ,
389 },
390 {
391 .start = CH_UART1_TX,
392 .end = CH_UART1_TX,
393 .flags = IORESOURCE_DMA,
394 },
395 {
396 .start = CH_UART1_RX,
397 .end = CH_UART1_RX,
398 .flags = IORESOURCE_DMA,
399 },
340}; 400};
341 401
342static struct platform_device bfin_uart_device = { 402unsigned short bfin_uart1_peripherals[] = {
403 P_UART1_TX, P_UART1_RX, 0
404};
405
406static struct platform_device bfin_uart1_device = {
343 .name = "bfin-uart", 407 .name = "bfin-uart",
344 .id = 1, 408 .id = 1,
345 .num_resources = ARRAY_SIZE(bfin_uart_resources), 409 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
346 .resource = bfin_uart_resources, 410 .resource = bfin_uart1_resources,
411 .dev = {
412 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
413 },
347}; 414};
348#endif 415#endif
416#endif
349 417
350#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 418#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
351#ifdef CONFIG_BFIN_SIR0 419#ifdef CONFIG_BFIN_SIR0
@@ -522,7 +590,12 @@ static struct platform_device *cm_bf537u_devices[] __initdata = {
522#endif 590#endif
523 591
524#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 592#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
525 &bfin_uart_device, 593#ifdef CONFIG_SERIAL_BFIN_UART0
594 &bfin_uart0_device,
595#endif
596#ifdef CONFIG_SERIAL_BFIN_UART1
597 &bfin_uart1_device,
598#endif
526#endif 599#endif
527 600
528#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 601#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c
index 0da927252701..58d6a20e7a0d 100644
--- a/arch/blackfin/mach-bf537/boards/minotaur.c
+++ b/arch/blackfin/mach-bf537/boards/minotaur.c
@@ -211,25 +211,93 @@ static struct platform_device bfin_spi0_device = {
211#endif /* spi master and devices */ 211#endif /* spi master and devices */
212 212
213#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 213#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
214static struct resource bfin_uart_resources[] = { 214#ifdef CONFIG_SERIAL_BFIN_UART0
215static struct resource bfin_uart0_resources[] = {
215 { 216 {
216 .start = 0xFFC00400, 217 .start = UART0_THR,
217 .end = 0xFFC004FF, 218 .end = UART0_GCTL+2,
218 .flags = IORESOURCE_MEM, 219 .flags = IORESOURCE_MEM,
219 }, { 220 },
220 .start = 0xFFC02000, 221 {
221 .end = 0xFFC020FF, 222 .start = IRQ_UART0_RX,
223 .end = IRQ_UART0_RX+1,
224 .flags = IORESOURCE_IRQ,
225 },
226 {
227 .start = IRQ_UART0_ERROR,
228 .end = IRQ_UART0_ERROR,
229 .flags = IORESOURCE_IRQ,
230 },
231 {
232 .start = CH_UART0_TX,
233 .end = CH_UART0_TX,
234 .flags = IORESOURCE_DMA,
235 },
236 {
237 .start = CH_UART0_RX,
238 .end = CH_UART0_RX,
239 .flags = IORESOURCE_DMA,
240 },
241};
242
243unsigned short bfin_uart0_peripherals[] = {
244 P_UART0_TX, P_UART0_RX, 0
245};
246
247static struct platform_device bfin_uart0_device = {
248 .name = "bfin-uart",
249 .id = 0,
250 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
251 .resource = bfin_uart0_resources,
252 .dev = {
253 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
254 },
255};
256#endif
257#ifdef CONFIG_SERIAL_BFIN_UART1
258static struct resource bfin_uart1_resources[] = {
259 {
260 .start = UART1_THR,
261 .end = UART1_GCTL+2,
222 .flags = IORESOURCE_MEM, 262 .flags = IORESOURCE_MEM,
223 }, 263 },
264 {
265 .start = IRQ_UART1_RX,
266 .end = IRQ_UART1_RX+1,
267 .flags = IORESOURCE_IRQ,
268 },
269 {
270 .start = IRQ_UART1_ERROR,
271 .end = IRQ_UART1_ERROR,
272 .flags = IORESOURCE_IRQ,
273 },
274 {
275 .start = CH_UART1_TX,
276 .end = CH_UART1_TX,
277 .flags = IORESOURCE_DMA,
278 },
279 {
280 .start = CH_UART1_RX,
281 .end = CH_UART1_RX,
282 .flags = IORESOURCE_DMA,
283 },
224}; 284};
225 285
226static struct platform_device bfin_uart_device = { 286unsigned short bfin_uart1_peripherals[] = {
287 P_UART1_TX, P_UART1_RX, 0
288};
289
290static struct platform_device bfin_uart1_device = {
227 .name = "bfin-uart", 291 .name = "bfin-uart",
228 .id = 1, 292 .id = 1,
229 .num_resources = ARRAY_SIZE(bfin_uart_resources), 293 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
230 .resource = bfin_uart_resources, 294 .resource = bfin_uart1_resources,
295 .dev = {
296 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
297 },
231}; 298};
232#endif 299#endif
300#endif
233 301
234#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 302#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
235#ifdef CONFIG_BFIN_SIR0 303#ifdef CONFIG_BFIN_SIR0
@@ -343,7 +411,12 @@ static struct platform_device *minotaur_devices[] __initdata = {
343#endif 411#endif
344 412
345#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 413#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
346 &bfin_uart_device, 414#ifdef CONFIG_SERIAL_BFIN_UART0
415 &bfin_uart0_device,
416#endif
417#ifdef CONFIG_SERIAL_BFIN_UART1
418 &bfin_uart1_device,
419#endif
347#endif 420#endif
348 421
349#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 422#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index 4e0afda472ab..3c36abdf3405 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -362,25 +362,93 @@ static struct platform_device bfin_fb_device = {
362#endif 362#endif
363 363
364#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 364#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
365static struct resource bfin_uart_resources[] = { 365#ifdef CONFIG_SERIAL_BFIN_UART0
366static struct resource bfin_uart0_resources[] = {
366 { 367 {
367 .start = 0xFFC00400, 368 .start = UART0_THR,
368 .end = 0xFFC004FF, 369 .end = UART0_GCTL+2,
369 .flags = IORESOURCE_MEM, 370 .flags = IORESOURCE_MEM,
370 }, { 371 },
371 .start = 0xFFC02000, 372 {
372 .end = 0xFFC020FF, 373 .start = IRQ_UART0_RX,
374 .end = IRQ_UART0_RX+1,
375 .flags = IORESOURCE_IRQ,
376 },
377 {
378 .start = IRQ_UART0_ERROR,
379 .end = IRQ_UART0_ERROR,
380 .flags = IORESOURCE_IRQ,
381 },
382 {
383 .start = CH_UART0_TX,
384 .end = CH_UART0_TX,
385 .flags = IORESOURCE_DMA,
386 },
387 {
388 .start = CH_UART0_RX,
389 .end = CH_UART0_RX,
390 .flags = IORESOURCE_DMA,
391 },
392};
393
394unsigned short bfin_uart0_peripherals[] = {
395 P_UART0_TX, P_UART0_RX, 0
396};
397
398static struct platform_device bfin_uart0_device = {
399 .name = "bfin-uart",
400 .id = 0,
401 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
402 .resource = bfin_uart0_resources,
403 .dev = {
404 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
405 },
406};
407#endif
408#ifdef CONFIG_SERIAL_BFIN_UART1
409static struct resource bfin_uart1_resources[] = {
410 {
411 .start = UART1_THR,
412 .end = UART1_GCTL+2,
373 .flags = IORESOURCE_MEM, 413 .flags = IORESOURCE_MEM,
374 }, 414 },
415 {
416 .start = IRQ_UART1_RX,
417 .end = IRQ_UART1_RX+1,
418 .flags = IORESOURCE_IRQ,
419 },
420 {
421 .start = IRQ_UART1_ERROR,
422 .end = IRQ_UART1_ERROR,
423 .flags = IORESOURCE_IRQ,
424 },
425 {
426 .start = CH_UART1_TX,
427 .end = CH_UART1_TX,
428 .flags = IORESOURCE_DMA,
429 },
430 {
431 .start = CH_UART1_RX,
432 .end = CH_UART1_RX,
433 .flags = IORESOURCE_DMA,
434 },
375}; 435};
376 436
377static struct platform_device bfin_uart_device = { 437unsigned short bfin_uart1_peripherals[] = {
438 P_UART1_TX, P_UART1_RX, 0
439};
440
441static struct platform_device bfin_uart1_device = {
378 .name = "bfin-uart", 442 .name = "bfin-uart",
379 .id = 1, 443 .id = 1,
380 .num_resources = ARRAY_SIZE(bfin_uart_resources), 444 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
381 .resource = bfin_uart_resources, 445 .resource = bfin_uart1_resources,
446 .dev = {
447 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
448 },
382}; 449};
383#endif 450#endif
451#endif
384 452
385#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 453#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
386#ifdef CONFIG_BFIN_SIR0 454#ifdef CONFIG_BFIN_SIR0
@@ -472,7 +540,12 @@ static struct platform_device *stamp_devices[] __initdata = {
472#endif 540#endif
473 541
474#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 542#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
475 &bfin_uart_device, 543#ifdef CONFIG_SERIAL_BFIN_UART0
544 &bfin_uart0_device,
545#endif
546#ifdef CONFIG_SERIAL_BFIN_UART1
547 &bfin_uart1_device,
548#endif
476#endif 549#endif
477 550
478#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 551#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index ac9b52e0087c..9842288c4f1c 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -1157,30 +1157,105 @@ static struct platform_device bfin_lq035q1_device = {
1157#endif 1157#endif
1158 1158
1159#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1159#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1160static struct resource bfin_uart_resources[] = {
1161#ifdef CONFIG_SERIAL_BFIN_UART0 1160#ifdef CONFIG_SERIAL_BFIN_UART0
1161static struct resource bfin_uart0_resources[] = {
1162 { 1162 {
1163 .start = 0xFFC00400, 1163 .start = UART0_THR,
1164 .end = 0xFFC004FF, 1164 .end = UART0_GCTL+2,
1165 .flags = IORESOURCE_MEM, 1165 .flags = IORESOURCE_MEM,
1166 }, 1166 },
1167 {
1168 .start = IRQ_UART0_RX,
1169 .end = IRQ_UART0_RX+1,
1170 .flags = IORESOURCE_IRQ,
1171 },
1172 {
1173 .start = IRQ_UART0_ERROR,
1174 .end = IRQ_UART0_ERROR,
1175 .flags = IORESOURCE_IRQ,
1176 },
1177 {
1178 .start = CH_UART0_TX,
1179 .end = CH_UART0_TX,
1180 .flags = IORESOURCE_DMA,
1181 },
1182 {
1183 .start = CH_UART0_RX,
1184 .end = CH_UART0_RX,
1185 .flags = IORESOURCE_DMA,
1186 },
1187#ifdef CONFIG_BFIN_UART0_CTSRTS
1188 { /* CTS pin */
1189 .start = GPIO_PG7,
1190 .end = GPIO_PG7,
1191 .flags = IORESOURCE_IO,
1192 },
1193 { /* RTS pin */
1194 .start = GPIO_PG6,
1195 .end = GPIO_PG6,
1196 .flags = IORESOURCE_IO,
1197 },
1198#endif
1199};
1200
1201unsigned short bfin_uart0_peripherals[] = {
1202 P_UART0_TX, P_UART0_RX, 0
1203};
1204
1205static struct platform_device bfin_uart0_device = {
1206 .name = "bfin-uart",
1207 .id = 0,
1208 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1209 .resource = bfin_uart0_resources,
1210 .dev = {
1211 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1212 },
1213};
1167#endif 1214#endif
1168#ifdef CONFIG_SERIAL_BFIN_UART1 1215#ifdef CONFIG_SERIAL_BFIN_UART1
1216static struct resource bfin_uart1_resources[] = {
1169 { 1217 {
1170 .start = 0xFFC02000, 1218 .start = UART1_THR,
1171 .end = 0xFFC020FF, 1219 .end = UART1_GCTL+2,
1172 .flags = IORESOURCE_MEM, 1220 .flags = IORESOURCE_MEM,
1173 }, 1221 },
1174#endif 1222 {
1223 .start = IRQ_UART1_RX,
1224 .end = IRQ_UART1_RX+1,
1225 .flags = IORESOURCE_IRQ,
1226 },
1227 {
1228 .start = IRQ_UART1_ERROR,
1229 .end = IRQ_UART1_ERROR,
1230 .flags = IORESOURCE_IRQ,
1231 },
1232 {
1233 .start = CH_UART1_TX,
1234 .end = CH_UART1_TX,
1235 .flags = IORESOURCE_DMA,
1236 },
1237 {
1238 .start = CH_UART1_RX,
1239 .end = CH_UART1_RX,
1240 .flags = IORESOURCE_DMA,
1241 },
1242};
1243
1244unsigned short bfin_uart1_peripherals[] = {
1245 P_UART1_TX, P_UART1_RX, 0
1175}; 1246};
1176 1247
1177static struct platform_device bfin_uart_device = { 1248static struct platform_device bfin_uart1_device = {
1178 .name = "bfin-uart", 1249 .name = "bfin-uart",
1179 .id = 1, 1250 .id = 1,
1180 .num_resources = ARRAY_SIZE(bfin_uart_resources), 1251 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1181 .resource = bfin_uart_resources, 1252 .resource = bfin_uart1_resources,
1253 .dev = {
1254 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1255 },
1182}; 1256};
1183#endif 1257#endif
1258#endif
1184 1259
1185#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1260#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1186#ifdef CONFIG_BFIN_SIR0 1261#ifdef CONFIG_BFIN_SIR0
@@ -1771,7 +1846,12 @@ static struct platform_device *stamp_devices[] __initdata = {
1771#endif 1846#endif
1772 1847
1773#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1848#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1774 &bfin_uart_device, 1849#ifdef CONFIG_SERIAL_BFIN_UART0
1850 &bfin_uart0_device,
1851#endif
1852#ifdef CONFIG_SERIAL_BFIN_UART1
1853 &bfin_uart1_device,
1854#endif
1775#endif 1855#endif
1776 1856
1777#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1857#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
index 57163b65a4f5..d77ca5b75685 100644
--- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
@@ -327,25 +327,93 @@ static struct platform_device cm_flash_device = {
327#endif 327#endif
328 328
329#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 329#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
330static struct resource bfin_uart_resources[] = { 330#ifdef CONFIG_SERIAL_BFIN_UART0
331static struct resource bfin_uart0_resources[] = {
331 { 332 {
332 .start = 0xFFC00400, 333 .start = UART0_THR,
333 .end = 0xFFC004FF, 334 .end = UART0_GCTL+2,
334 .flags = IORESOURCE_MEM, 335 .flags = IORESOURCE_MEM,
335 }, { 336 },
336 .start = 0xFFC02000, 337 {
337 .end = 0xFFC020FF, 338 .start = IRQ_UART0_RX,
339 .end = IRQ_UART0_RX+1,
340 .flags = IORESOURCE_IRQ,
341 },
342 {
343 .start = IRQ_UART0_ERROR,
344 .end = IRQ_UART0_ERROR,
345 .flags = IORESOURCE_IRQ,
346 },
347 {
348 .start = CH_UART0_TX,
349 .end = CH_UART0_TX,
350 .flags = IORESOURCE_DMA,
351 },
352 {
353 .start = CH_UART0_RX,
354 .end = CH_UART0_RX,
355 .flags = IORESOURCE_DMA,
356 },
357};
358
359unsigned short bfin_uart0_peripherals[] = {
360 P_UART0_TX, P_UART0_RX, 0
361};
362
363static struct platform_device bfin_uart0_device = {
364 .name = "bfin-uart",
365 .id = 0,
366 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
367 .resource = bfin_uart0_resources,
368 .dev = {
369 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
370 },
371};
372#endif
373#ifdef CONFIG_SERIAL_BFIN_UART1
374static struct resource bfin_uart1_resources[] = {
375 {
376 .start = UART1_THR,
377 .end = UART1_GCTL+2,
338 .flags = IORESOURCE_MEM, 378 .flags = IORESOURCE_MEM,
339 }, 379 },
380 {
381 .start = IRQ_UART1_RX,
382 .end = IRQ_UART1_RX+1,
383 .flags = IORESOURCE_IRQ,
384 },
385 {
386 .start = IRQ_UART1_ERROR,
387 .end = IRQ_UART1_ERROR,
388 .flags = IORESOURCE_IRQ,
389 },
390 {
391 .start = CH_UART1_TX,
392 .end = CH_UART1_TX,
393 .flags = IORESOURCE_DMA,
394 },
395 {
396 .start = CH_UART1_RX,
397 .end = CH_UART1_RX,
398 .flags = IORESOURCE_DMA,
399 },
340}; 400};
341 401
342static struct platform_device bfin_uart_device = { 402unsigned short bfin_uart1_peripherals[] = {
403 P_UART1_TX, P_UART1_RX, 0
404};
405
406static struct platform_device bfin_uart1_device = {
343 .name = "bfin-uart", 407 .name = "bfin-uart",
344 .id = 1, 408 .id = 1,
345 .num_resources = ARRAY_SIZE(bfin_uart_resources), 409 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
346 .resource = bfin_uart_resources, 410 .resource = bfin_uart1_resources,
411 .dev = {
412 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
413 },
347}; 414};
348#endif 415#endif
416#endif
349 417
350#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 418#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
351#ifdef CONFIG_BFIN_SIR0 419#ifdef CONFIG_BFIN_SIR0
@@ -524,7 +592,12 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
524#endif 592#endif
525 593
526#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 594#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
527 &bfin_uart_device, 595#ifdef CONFIG_SERIAL_BFIN_UART0
596 &bfin_uart0_device,
597#endif
598#ifdef CONFIG_SERIAL_BFIN_UART1
599 &bfin_uart1_device,
600#endif
528#endif 601#endif
529 602
530#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 603#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf538/boards/ezkit.c b/arch/blackfin/mach-bf538/boards/ezkit.c
index c296bb1ed503..1912bc4555aa 100644
--- a/arch/blackfin/mach-bf538/boards/ezkit.c
+++ b/arch/blackfin/mach-bf538/boards/ezkit.c
@@ -41,37 +41,148 @@ static struct platform_device rtc_device = {
41#endif 41#endif
42 42
43#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 43#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
44static struct resource bfin_uart_resources[] = {
45#ifdef CONFIG_SERIAL_BFIN_UART0 44#ifdef CONFIG_SERIAL_BFIN_UART0
45static struct resource bfin_uart0_resources[] = {
46 { 46 {
47 .start = 0xFFC00400, 47 .start = UART0_THR,
48 .end = 0xFFC004FF, 48 .end = UART0_GCTL+2,
49 .flags = IORESOURCE_MEM, 49 .flags = IORESOURCE_MEM,
50 }, 50 },
51 {
52 .start = IRQ_UART0_RX,
53 .end = IRQ_UART0_RX+1,
54 .flags = IORESOURCE_IRQ,
55 },
56 {
57 .start = IRQ_UART0_ERROR,
58 .end = IRQ_UART0_ERROR,
59 .flags = IORESOURCE_IRQ,
60 },
61 {
62 .start = CH_UART0_TX,
63 .end = CH_UART0_TX,
64 .flags = IORESOURCE_DMA,
65 },
66 {
67 .start = CH_UART0_RX,
68 .end = CH_UART0_RX,
69 .flags = IORESOURCE_DMA,
70 },
71#ifdef CONFIG_BFIN_UART0_CTSRTS
72 { /* CTS pin */
73 .start = GPIO_PG7,
74 .end = GPIO_PG7,
75 .flags = IORESOURCE_IO,
76 },
77 { /* RTS pin */
78 .start = GPIO_PG6,
79 .end = GPIO_PG6,
80 .flags = IORESOURCE_IO,
81 },
82#endif
83};
84
85unsigned short bfin_uart0_peripherals[] = {
86 P_UART0_TX, P_UART0_RX, 0
87};
88
89static struct platform_device bfin_uart0_device = {
90 .name = "bfin-uart",
91 .id = 0,
92 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
93 .resource = bfin_uart0_resources,
94 .dev = {
95 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
96 },
97};
51#endif 98#endif
52#ifdef CONFIG_SERIAL_BFIN_UART1 99#ifdef CONFIG_SERIAL_BFIN_UART1
100static struct resource bfin_uart1_resources[] = {
53 { 101 {
54 .start = 0xFFC02000, 102 .start = UART1_THR,
55 .end = 0xFFC020FF, 103 .end = UART1_GCTL+2,
56 .flags = IORESOURCE_MEM, 104 .flags = IORESOURCE_MEM,
57 }, 105 },
106 {
107 .start = IRQ_UART1_RX,
108 .end = IRQ_UART1_RX+1,
109 .flags = IORESOURCE_IRQ,
110 },
111 {
112 .start = IRQ_UART1_ERROR,
113 .end = IRQ_UART1_ERROR,
114 .flags = IORESOURCE_IRQ,
115 },
116 {
117 .start = CH_UART1_TX,
118 .end = CH_UART1_TX,
119 .flags = IORESOURCE_DMA,
120 },
121 {
122 .start = CH_UART1_RX,
123 .end = CH_UART1_RX,
124 .flags = IORESOURCE_DMA,
125 },
126};
127
128unsigned short bfin_uart1_peripherals[] = {
129 P_UART1_TX, P_UART1_RX, 0
130};
131
132static struct platform_device bfin_uart1_device = {
133 .name = "bfin-uart",
134 .id = 1,
135 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
136 .resource = bfin_uart1_resources,
137 .dev = {
138 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
139 },
140};
58#endif 141#endif
59#ifdef CONFIG_SERIAL_BFIN_UART2 142#ifdef CONFIG_SERIAL_BFIN_UART2
143static struct resource bfin_uart2_resources[] = {
60 { 144 {
61 .start = 0xFFC02100, 145 .start = UART2_THR,
62 .end = 0xFFC021FF, 146 .end = UART2_GCTL+2,
63 .flags = IORESOURCE_MEM, 147 .flags = IORESOURCE_MEM,
64 }, 148 },
65#endif 149 {
150 .start = IRQ_UART2_RX,
151 .end = IRQ_UART2_RX+1,
152 .flags = IORESOURCE_IRQ,
153 },
154 {
155 .start = IRQ_UART2_ERROR,
156 .end = IRQ_UART2_ERROR,
157 .flags = IORESOURCE_IRQ,
158 },
159 {
160 .start = CH_UART2_TX,
161 .end = CH_UART2_TX,
162 .flags = IORESOURCE_DMA,
163 },
164 {
165 .start = CH_UART2_RX,
166 .end = CH_UART2_RX,
167 .flags = IORESOURCE_DMA,
168 },
66}; 169};
67 170
68static struct platform_device bfin_uart_device = { 171unsigned short bfin_uart2_peripherals[] = {
172 P_UART2_TX, P_UART2_RX, 0
173};
174
175static struct platform_device bfin_uart2_device = {
69 .name = "bfin-uart", 176 .name = "bfin-uart",
70 .id = 1, 177 .id = 2,
71 .num_resources = ARRAY_SIZE(bfin_uart_resources), 178 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
72 .resource = bfin_uart_resources, 179 .resource = bfin_uart2_resources,
180 .dev = {
181 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
182 },
73}; 183};
74#endif 184#endif
185#endif
75 186
76#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 187#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
77#ifdef CONFIG_BFIN_SIR0 188#ifdef CONFIG_BFIN_SIR0
@@ -622,7 +733,15 @@ static struct platform_device *cm_bf538_devices[] __initdata = {
622#endif 733#endif
623 734
624#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 735#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
625 &bfin_uart_device, 736#ifdef CONFIG_SERIAL_BFIN_UART0
737 &bfin_uart0_device,
738#endif
739#ifdef CONFIG_SERIAL_BFIN_UART1
740 &bfin_uart1_device,
741#endif
742#ifdef CONFIG_SERIAL_BFIN_UART2
743 &bfin_uart2_device,
744#endif
626#endif 745#endif
627 746
628#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 747#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index ccdcd6da2e9f..635f92723e12 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -127,44 +127,211 @@ static struct platform_device rtc_device = {
127#endif 127#endif
128 128
129#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 129#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
130static struct resource bfin_uart_resources[] = {
131#ifdef CONFIG_SERIAL_BFIN_UART0 130#ifdef CONFIG_SERIAL_BFIN_UART0
131static struct resource bfin_uart0_resources[] = {
132 { 132 {
133 .start = 0xFFC00400, 133 .start = UART0_DLL,
134 .end = 0xFFC004FF, 134 .end = UART0_RBR+2,
135 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
136 }, 136 },
137 {
138 .start = IRQ_UART0_RX,
139 .end = IRQ_UART0_RX+1,
140 .flags = IORESOURCE_IRQ,
141 },
142 {
143 .start = IRQ_UART0_ERROR,
144 .end = IRQ_UART0_ERROR,
145 .flags = IORESOURCE_IRQ,
146 },
147 {
148 .start = CH_UART0_TX,
149 .end = CH_UART0_TX,
150 .flags = IORESOURCE_DMA,
151 },
152 {
153 .start = CH_UART0_RX,
154 .end = CH_UART0_RX,
155 .flags = IORESOURCE_DMA,
156 },
157};
158
159unsigned short bfin_uart0_peripherals[] = {
160 P_UART0_TX, P_UART0_RX, 0
161};
162
163static struct platform_device bfin_uart0_device = {
164 .name = "bfin-uart",
165 .id = 0,
166 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
167 .resource = bfin_uart0_resources,
168 .dev = {
169 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
170 },
171};
137#endif 172#endif
138#ifdef CONFIG_SERIAL_BFIN_UART1 173#ifdef CONFIG_SERIAL_BFIN_UART1
174static struct resource bfin_uart1_resources[] = {
139 { 175 {
140 .start = 0xFFC02000, 176 .start = UART1_DLL,
141 .end = 0xFFC020FF, 177 .end = UART1_RBR+2,
142 .flags = IORESOURCE_MEM, 178 .flags = IORESOURCE_MEM,
143 }, 179 },
180 {
181 .start = IRQ_UART1_RX,
182 .end = IRQ_UART1_RX+1,
183 .flags = IORESOURCE_IRQ,
184 },
185 {
186 .start = IRQ_UART1_ERROR,
187 .end = IRQ_UART1_ERROR,
188 .flags = IORESOURCE_IRQ,
189 },
190 {
191 .start = CH_UART1_TX,
192 .end = CH_UART1_TX,
193 .flags = IORESOURCE_DMA,
194 },
195 {
196 .start = CH_UART1_RX,
197 .end = CH_UART1_RX,
198 .flags = IORESOURCE_DMA,
199 },
200#ifdef CONFIG_BFIN_UART1_CTSRTS
201 { /* CTS pin -- 0 means not supported */
202 .start = GPIO_PE10,
203 .end = GPIO_PE10,
204 .flags = IORESOURCE_IO,
205 },
206 { /* RTS pin -- 0 means not supported */
207 .start = GPIO_PE9,
208 .end = GPIO_PE9,
209 .flags = IORESOURCE_IO,
210 },
211#endif
212};
213
214unsigned short bfin_uart1_peripherals[] = {
215 P_UART1_TX, P_UART1_RX,
216#ifdef CONFIG_BFIN_UART1_CTSRTS
217 P_UART1_RTS, P_UART1_CTS,
218#endif
219 0
220};
221
222static struct platform_device bfin_uart1_device = {
223 .name = "bfin-uart",
224 .id = 1,
225 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
226 .resource = bfin_uart1_resources,
227 .dev = {
228 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
229 },
230};
144#endif 231#endif
145#ifdef CONFIG_SERIAL_BFIN_UART2 232#ifdef CONFIG_SERIAL_BFIN_UART2
233static struct resource bfin_uart2_resources[] = {
146 { 234 {
147 .start = 0xFFC02100, 235 .start = UART2_DLL,
148 .end = 0xFFC021FF, 236 .end = UART2_RBR+2,
149 .flags = IORESOURCE_MEM, 237 .flags = IORESOURCE_MEM,
150 }, 238 },
239 {
240 .start = IRQ_UART2_RX,
241 .end = IRQ_UART2_RX+1,
242 .flags = IORESOURCE_IRQ,
243 },
244 {
245 .start = IRQ_UART2_ERROR,
246 .end = IRQ_UART2_ERROR,
247 .flags = IORESOURCE_IRQ,
248 },
249 {
250 .start = CH_UART2_TX,
251 .end = CH_UART2_TX,
252 .flags = IORESOURCE_DMA,
253 },
254 {
255 .start = CH_UART2_RX,
256 .end = CH_UART2_RX,
257 .flags = IORESOURCE_DMA,
258 },
259};
260
261unsigned short bfin_uart2_peripherals[] = {
262 P_UART2_TX, P_UART2_RX, 0
263};
264
265static struct platform_device bfin_uart2_device = {
266 .name = "bfin-uart",
267 .id = 2,
268 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
269 .resource = bfin_uart2_resources,
270 .dev = {
271 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
272 },
273};
151#endif 274#endif
152#ifdef CONFIG_SERIAL_BFIN_UART3 275#ifdef CONFIG_SERIAL_BFIN_UART3
276static struct resource bfin_uart3_resources[] = {
153 { 277 {
154 .start = 0xFFC03100, 278 .start = UART3_DLL,
155 .end = 0xFFC031FF, 279 .end = UART3_RBR+2,
156 .flags = IORESOURCE_MEM, 280 .flags = IORESOURCE_MEM,
157 }, 281 },
282 {
283 .start = IRQ_UART3_RX,
284 .end = IRQ_UART3_RX+1,
285 .flags = IORESOURCE_IRQ,
286 },
287 {
288 .start = IRQ_UART3_ERROR,
289 .end = IRQ_UART3_ERROR,
290 .flags = IORESOURCE_IRQ,
291 },
292 {
293 .start = CH_UART3_TX,
294 .end = CH_UART3_TX,
295 .flags = IORESOURCE_DMA,
296 },
297 {
298 .start = CH_UART3_RX,
299 .end = CH_UART3_RX,
300 .flags = IORESOURCE_DMA,
301 },
302#ifdef CONFIG_BFIN_UART3_CTSRTS
303 { /* CTS pin -- 0 means not supported */
304 .start = GPIO_PB3,
305 .end = GPIO_PB3,
306 .flags = IORESOURCE_IO,
307 },
308 { /* RTS pin -- 0 means not supported */
309 .start = GPIO_PB2,
310 .end = GPIO_PB2,
311 .flags = IORESOURCE_IO,
312 },
158#endif 313#endif
159}; 314};
160 315
161static struct platform_device bfin_uart_device = { 316unsigned short bfin_uart3_peripherals[] = {
317 P_UART3_TX, P_UART3_RX,
318#ifdef CONFIG_BFIN_UART3_CTSRTS
319 P_UART3_RTS, P_UART3_CTS,
320#endif
321 0
322};
323
324static struct platform_device bfin_uart3_device = {
162 .name = "bfin-uart", 325 .name = "bfin-uart",
163 .id = 1, 326 .id = 3,
164 .num_resources = ARRAY_SIZE(bfin_uart_resources), 327 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
165 .resource = bfin_uart_resources, 328 .resource = bfin_uart3_resources,
329 .dev = {
330 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
331 },
166}; 332};
167#endif 333#endif
334#endif
168 335
169#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 336#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
170#ifdef CONFIG_BFIN_SIR0 337#ifdef CONFIG_BFIN_SIR0
@@ -752,7 +919,18 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
752#endif 919#endif
753 920
754#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 921#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
755 &bfin_uart_device, 922#ifdef CONFIG_SERIAL_BFIN_UART0
923 &bfin_uart0_device,
924#endif
925#ifdef CONFIG_SERIAL_BFIN_UART1
926 &bfin_uart1_device,
927#endif
928#ifdef CONFIG_SERIAL_BFIN_UART2
929 &bfin_uart2_device,
930#endif
931#ifdef CONFIG_SERIAL_BFIN_UART3
932 &bfin_uart3_device,
933#endif
756#endif 934#endif
757 935
758#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 936#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 60193f72777c..1ed026157737 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -232,44 +232,211 @@ static struct platform_device rtc_device = {
232#endif 232#endif
233 233
234#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 234#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
235static struct resource bfin_uart_resources[] = {
236#ifdef CONFIG_SERIAL_BFIN_UART0 235#ifdef CONFIG_SERIAL_BFIN_UART0
236static struct resource bfin_uart0_resources[] = {
237 { 237 {
238 .start = 0xFFC00400, 238 .start = UART0_DLL,
239 .end = 0xFFC004FF, 239 .end = UART0_RBR+2,
240 .flags = IORESOURCE_MEM, 240 .flags = IORESOURCE_MEM,
241 }, 241 },
242 {
243 .start = IRQ_UART0_RX,
244 .end = IRQ_UART0_RX+1,
245 .flags = IORESOURCE_IRQ,
246 },
247 {
248 .start = IRQ_UART0_ERROR,
249 .end = IRQ_UART0_ERROR,
250 .flags = IORESOURCE_IRQ,
251 },
252 {
253 .start = CH_UART0_TX,
254 .end = CH_UART0_TX,
255 .flags = IORESOURCE_DMA,
256 },
257 {
258 .start = CH_UART0_RX,
259 .end = CH_UART0_RX,
260 .flags = IORESOURCE_DMA,
261 },
262};
263
264unsigned short bfin_uart0_peripherals[] = {
265 P_UART0_TX, P_UART0_RX, 0
266};
267
268static struct platform_device bfin_uart0_device = {
269 .name = "bfin-uart",
270 .id = 0,
271 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
272 .resource = bfin_uart0_resources,
273 .dev = {
274 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
275 },
276};
242#endif 277#endif
243#ifdef CONFIG_SERIAL_BFIN_UART1 278#ifdef CONFIG_SERIAL_BFIN_UART1
279static struct resource bfin_uart1_resources[] = {
244 { 280 {
245 .start = 0xFFC02000, 281 .start = UART1_DLL,
246 .end = 0xFFC020FF, 282 .end = UART1_RBR+2,
247 .flags = IORESOURCE_MEM, 283 .flags = IORESOURCE_MEM,
248 }, 284 },
285 {
286 .start = IRQ_UART1_RX,
287 .end = IRQ_UART1_RX+1,
288 .flags = IORESOURCE_IRQ,
289 },
290 {
291 .start = IRQ_UART1_ERROR,
292 .end = IRQ_UART1_ERROR,
293 .flags = IORESOURCE_IRQ,
294 },
295 {
296 .start = CH_UART1_TX,
297 .end = CH_UART1_TX,
298 .flags = IORESOURCE_DMA,
299 },
300 {
301 .start = CH_UART1_RX,
302 .end = CH_UART1_RX,
303 .flags = IORESOURCE_DMA,
304 },
305#ifdef CONFIG_BFIN_UART1_CTSRTS
306 { /* CTS pin -- 0 means not supported */
307 .start = GPIO_PE10,
308 .end = GPIO_PE10,
309 .flags = IORESOURCE_IO,
310 },
311 { /* RTS pin -- 0 means not supported */
312 .start = GPIO_PE9,
313 .end = GPIO_PE9,
314 .flags = IORESOURCE_IO,
315 },
316#endif
317};
318
319unsigned short bfin_uart1_peripherals[] = {
320 P_UART1_TX, P_UART1_RX,
321#ifdef CONFIG_BFIN_UART1_CTSRTS
322 P_UART1_RTS, P_UART1_CTS,
323#endif
324 0
325};
326
327static struct platform_device bfin_uart1_device = {
328 .name = "bfin-uart",
329 .id = 1,
330 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
331 .resource = bfin_uart1_resources,
332 .dev = {
333 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
334 },
335};
249#endif 336#endif
250#ifdef CONFIG_SERIAL_BFIN_UART2 337#ifdef CONFIG_SERIAL_BFIN_UART2
338static struct resource bfin_uart2_resources[] = {
251 { 339 {
252 .start = 0xFFC02100, 340 .start = UART2_DLL,
253 .end = 0xFFC021FF, 341 .end = UART2_RBR+2,
254 .flags = IORESOURCE_MEM, 342 .flags = IORESOURCE_MEM,
255 }, 343 },
344 {
345 .start = IRQ_UART2_RX,
346 .end = IRQ_UART2_RX+1,
347 .flags = IORESOURCE_IRQ,
348 },
349 {
350 .start = IRQ_UART2_ERROR,
351 .end = IRQ_UART2_ERROR,
352 .flags = IORESOURCE_IRQ,
353 },
354 {
355 .start = CH_UART2_TX,
356 .end = CH_UART2_TX,
357 .flags = IORESOURCE_DMA,
358 },
359 {
360 .start = CH_UART2_RX,
361 .end = CH_UART2_RX,
362 .flags = IORESOURCE_DMA,
363 },
364};
365
366unsigned short bfin_uart2_peripherals[] = {
367 P_UART2_TX, P_UART2_RX, 0
368};
369
370static struct platform_device bfin_uart2_device = {
371 .name = "bfin-uart",
372 .id = 2,
373 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
374 .resource = bfin_uart2_resources,
375 .dev = {
376 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
377 },
378};
256#endif 379#endif
257#ifdef CONFIG_SERIAL_BFIN_UART3 380#ifdef CONFIG_SERIAL_BFIN_UART3
381static struct resource bfin_uart3_resources[] = {
258 { 382 {
259 .start = 0xFFC03100, 383 .start = UART3_DLL,
260 .end = 0xFFC031FF, 384 .end = UART3_RBR+2,
261 .flags = IORESOURCE_MEM, 385 .flags = IORESOURCE_MEM,
262 }, 386 },
387 {
388 .start = IRQ_UART3_RX,
389 .end = IRQ_UART3_RX+1,
390 .flags = IORESOURCE_IRQ,
391 },
392 {
393 .start = IRQ_UART3_ERROR,
394 .end = IRQ_UART3_ERROR,
395 .flags = IORESOURCE_IRQ,
396 },
397 {
398 .start = CH_UART3_TX,
399 .end = CH_UART3_TX,
400 .flags = IORESOURCE_DMA,
401 },
402 {
403 .start = CH_UART3_RX,
404 .end = CH_UART3_RX,
405 .flags = IORESOURCE_DMA,
406 },
407#ifdef CONFIG_BFIN_UART3_CTSRTS
408 { /* CTS pin -- 0 means not supported */
409 .start = GPIO_PB3,
410 .end = GPIO_PB3,
411 .flags = IORESOURCE_IO,
412 },
413 { /* RTS pin -- 0 means not supported */
414 .start = GPIO_PB2,
415 .end = GPIO_PB2,
416 .flags = IORESOURCE_IO,
417 },
263#endif 418#endif
264}; 419};
265 420
266static struct platform_device bfin_uart_device = { 421unsigned short bfin_uart3_peripherals[] = {
422 P_UART3_TX, P_UART3_RX,
423#ifdef CONFIG_BFIN_UART3_CTSRTS
424 P_UART3_RTS, P_UART3_CTS,
425#endif
426 0
427};
428
429static struct platform_device bfin_uart3_device = {
267 .name = "bfin-uart", 430 .name = "bfin-uart",
268 .id = 1, 431 .id = 3,
269 .num_resources = ARRAY_SIZE(bfin_uart_resources), 432 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
270 .resource = bfin_uart_resources, 433 .resource = bfin_uart3_resources,
434 .dev = {
435 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
436 },
271}; 437};
272#endif 438#endif
439#endif
273 440
274#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 441#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
275#ifdef CONFIG_BFIN_SIR0 442#ifdef CONFIG_BFIN_SIR0
@@ -960,7 +1127,18 @@ static struct platform_device *ezkit_devices[] __initdata = {
960#endif 1127#endif
961 1128
962#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1129#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
963 &bfin_uart_device, 1130#ifdef CONFIG_SERIAL_BFIN_UART0
1131 &bfin_uart0_device,
1132#endif
1133#ifdef CONFIG_SERIAL_BFIN_UART1
1134 &bfin_uart1_device,
1135#endif
1136#ifdef CONFIG_SERIAL_BFIN_UART2
1137 &bfin_uart2_device,
1138#endif
1139#ifdef CONFIG_SERIAL_BFIN_UART3
1140 &bfin_uart3_device,
1141#endif
964#endif 1142#endif
965 1143
966#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1144#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index dfc8d5b77986..818266f6348f 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -305,21 +305,50 @@ static struct platform_device isp1362_hcd_device = {
305#endif 305#endif
306 306
307#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 307#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
308static struct resource bfin_uart_resources[] = { 308#ifdef CONFIG_SERIAL_BFIN_UART0
309static struct resource bfin_uart0_resources[] = {
309 { 310 {
310 .start = 0xFFC00400, 311 .start = BFIN_UART_THR,
311 .end = 0xFFC004FF, 312 .end = BFIN_UART_GCTL+2,
312 .flags = IORESOURCE_MEM, 313 .flags = IORESOURCE_MEM,
313 }, 314 },
315 {
316 .start = IRQ_UART_RX,
317 .end = IRQ_UART_RX+1,
318 .flags = IORESOURCE_IRQ,
319 },
320 {
321 .start = IRQ_UART_ERROR,
322 .end = IRQ_UART_ERROR,
323 .flags = IORESOURCE_IRQ,
324 },
325 {
326 .start = CH_UART_TX,
327 .end = CH_UART_TX,
328 .flags = IORESOURCE_DMA,
329 },
330 {
331 .start = CH_UART_RX,
332 .end = CH_UART_RX,
333 .flags = IORESOURCE_DMA,
334 },
335};
336
337unsigned short bfin_uart0_peripherals[] = {
338 P_UART0_TX, P_UART0_RX, 0
314}; 339};
315 340
316static struct platform_device bfin_uart_device = { 341static struct platform_device bfin_uart0_device = {
317 .name = "bfin-uart", 342 .name = "bfin-uart",
318 .id = 1, 343 .id = 0,
319 .num_resources = ARRAY_SIZE(bfin_uart_resources), 344 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
320 .resource = bfin_uart_resources, 345 .resource = bfin_uart0_resources,
346 .dev = {
347 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
348 },
321}; 349};
322#endif 350#endif
351#endif
323 352
324#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 353#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
325#ifdef CONFIG_BFIN_SIR0 354#ifdef CONFIG_BFIN_SIR0
@@ -463,7 +492,9 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
463#endif 492#endif
464 493
465#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 494#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
466 &bfin_uart_device, 495#ifdef CONFIG_SERIAL_BFIN_UART0
496 &bfin_uart0_device,
497#endif
467#endif 498#endif
468 499
469#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 500#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index ffd3e6a80d1a..c59041c513e0 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -160,21 +160,50 @@ static struct platform_device smc91x_device = {
160#endif 160#endif
161 161
162#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 162#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
163static struct resource bfin_uart_resources[] = { 163#ifdef CONFIG_SERIAL_BFIN_UART0
164static struct resource bfin_uart0_resources[] = {
164 { 165 {
165 .start = 0xFFC00400, 166 .start = BFIN_UART_THR,
166 .end = 0xFFC004FF, 167 .end = BFIN_UART_GCTL+2,
167 .flags = IORESOURCE_MEM, 168 .flags = IORESOURCE_MEM,
168 }, 169 },
170 {
171 .start = IRQ_UART_RX,
172 .end = IRQ_UART_RX+1,
173 .flags = IORESOURCE_IRQ,
174 },
175 {
176 .start = IRQ_UART_ERROR,
177 .end = IRQ_UART_ERROR,
178 .flags = IORESOURCE_IRQ,
179 },
180 {
181 .start = CH_UART_TX,
182 .end = CH_UART_TX,
183 .flags = IORESOURCE_DMA,
184 },
185 {
186 .start = CH_UART_RX,
187 .end = CH_UART_RX,
188 .flags = IORESOURCE_DMA,
189 },
190};
191
192unsigned short bfin_uart0_peripherals[] = {
193 P_UART0_TX, P_UART0_RX, 0
169}; 194};
170 195
171static struct platform_device bfin_uart_device = { 196static struct platform_device bfin_uart0_device = {
172 .name = "bfin-uart", 197 .name = "bfin-uart",
173 .id = 1, 198 .id = 0,
174 .num_resources = ARRAY_SIZE(bfin_uart_resources), 199 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
175 .resource = bfin_uart_resources, 200 .resource = bfin_uart0_resources,
201 .dev = {
202 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
203 },
176}; 204};
177#endif 205#endif
206#endif
178 207
179#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 208#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
180#ifdef CONFIG_BFIN_SIR0 209#ifdef CONFIG_BFIN_SIR0
@@ -412,7 +441,9 @@ static struct platform_device *ezkit_devices[] __initdata = {
412#endif 441#endif
413 442
414#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 443#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
415 &bfin_uart_device, 444#ifdef CONFIG_SERIAL_BFIN_UART0
445 &bfin_uart0_device,
446#endif
416#endif 447#endif
417 448
418#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 449#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
diff --git a/arch/blackfin/mach-bf561/boards/tepla.c b/arch/blackfin/mach-bf561/boards/tepla.c
index 8ba7252455e1..6c33397355b3 100644
--- a/arch/blackfin/mach-bf561/boards/tepla.c
+++ b/arch/blackfin/mach-bf561/boards/tepla.c
@@ -42,6 +42,52 @@ static struct platform_device smc91x_device = {
42 .resource = smc91x_resources, 42 .resource = smc91x_resources,
43}; 43};
44 44
45#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
46#ifdef CONFIG_SERIAL_BFIN_UART0
47static struct resource bfin_uart0_resources[] = {
48 {
49 .start = BFIN_UART_THR,
50 .end = BFIN_UART_GCTL+2,
51 .flags = IORESOURCE_MEM,
52 },
53 {
54 .start = IRQ_UART_RX,
55 .end = IRQ_UART_RX+1,
56 .flags = IORESOURCE_IRQ,
57 },
58 {
59 .start = IRQ_UART_ERROR,
60 .end = IRQ_UART_ERROR,
61 .flags = IORESOURCE_IRQ,
62 },
63 {
64 .start = CH_UART_TX,
65 .end = CH_UART_TX,
66 .flags = IORESOURCE_DMA,
67 },
68 {
69 .start = CH_UART_RX,
70 .end = CH_UART_RX,
71 .flags = IORESOURCE_DMA,
72 },
73};
74
75unsigned short bfin_uart0_peripherals[] = {
76 P_UART0_TX, P_UART0_RX, 0
77};
78
79static struct platform_device bfin_uart0_device = {
80 .name = "bfin-uart",
81 .id = 0,
82 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
83 .resource = bfin_uart0_resources,
84 .dev = {
85 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
86 },
87};
88#endif
89#endif
90
45#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 91#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
46#ifdef CONFIG_BFIN_SIR0 92#ifdef CONFIG_BFIN_SIR0
47static struct resource bfin_sir0_resources[] = { 93static struct resource bfin_sir0_resources[] = {
@@ -73,6 +119,13 @@ static struct platform_device bfin_sir0_device = {
73 119
74static struct platform_device *tepla_devices[] __initdata = { 120static struct platform_device *tepla_devices[] __initdata = {
75 &smc91x_device, 121 &smc91x_device,
122
123#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
124#ifdef CONFIG_SERIAL_BFIN_UART0
125 &bfin_uart0_device,
126#endif
127#endif
128
76#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 129#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
77#ifdef CONFIG_BFIN_SIR0 130#ifdef CONFIG_BFIN_SIR0
78 &bfin_sir0_device, 131 &bfin_sir0_device,