diff options
Diffstat (limited to 'arch/arm/mach-shmobile/setup-sh7372.c')
| -rw-r--r-- | arch/arm/mach-shmobile/setup-sh7372.c | 176 |
1 files changed, 161 insertions, 15 deletions
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index 79f0413d8725..2d9b1b1a2538 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c | |||
| @@ -169,35 +169,35 @@ static struct platform_device scif6_device = { | |||
| 169 | }; | 169 | }; |
| 170 | 170 | ||
| 171 | /* CMT */ | 171 | /* CMT */ |
| 172 | static struct sh_timer_config cmt10_platform_data = { | 172 | static struct sh_timer_config cmt2_platform_data = { |
| 173 | .name = "CMT10", | 173 | .name = "CMT2", |
| 174 | .channel_offset = 0x10, | 174 | .channel_offset = 0x40, |
| 175 | .timer_bit = 0, | 175 | .timer_bit = 5, |
| 176 | .clockevent_rating = 125, | 176 | .clockevent_rating = 125, |
| 177 | .clocksource_rating = 125, | 177 | .clocksource_rating = 125, |
| 178 | }; | 178 | }; |
| 179 | 179 | ||
| 180 | static struct resource cmt10_resources[] = { | 180 | static struct resource cmt2_resources[] = { |
| 181 | [0] = { | 181 | [0] = { |
| 182 | .name = "CMT10", | 182 | .name = "CMT2", |
| 183 | .start = 0xe6138010, | 183 | .start = 0xe6130040, |
| 184 | .end = 0xe613801b, | 184 | .end = 0xe613004b, |
| 185 | .flags = IORESOURCE_MEM, | 185 | .flags = IORESOURCE_MEM, |
| 186 | }, | 186 | }, |
| 187 | [1] = { | 187 | [1] = { |
| 188 | .start = evt2irq(0x0b00), /* CMT1_CMT10 */ | 188 | .start = evt2irq(0x0b80), /* CMT2 */ |
| 189 | .flags = IORESOURCE_IRQ, | 189 | .flags = IORESOURCE_IRQ, |
| 190 | }, | 190 | }, |
| 191 | }; | 191 | }; |
| 192 | 192 | ||
| 193 | static struct platform_device cmt10_device = { | 193 | static struct platform_device cmt2_device = { |
| 194 | .name = "sh_cmt", | 194 | .name = "sh_cmt", |
| 195 | .id = 10, | 195 | .id = 2, |
| 196 | .dev = { | 196 | .dev = { |
| 197 | .platform_data = &cmt10_platform_data, | 197 | .platform_data = &cmt2_platform_data, |
| 198 | }, | 198 | }, |
| 199 | .resource = cmt10_resources, | 199 | .resource = cmt2_resources, |
| 200 | .num_resources = ARRAY_SIZE(cmt10_resources), | 200 | .num_resources = ARRAY_SIZE(cmt2_resources), |
| 201 | }; | 201 | }; |
| 202 | 202 | ||
| 203 | /* TMU */ | 203 | /* TMU */ |
| @@ -602,6 +602,150 @@ static struct platform_device dma2_device = { | |||
| 602 | }, | 602 | }, |
| 603 | }; | 603 | }; |
| 604 | 604 | ||
| 605 | /* | ||
| 606 | * USB-DMAC | ||
| 607 | */ | ||
| 608 | |||
| 609 | unsigned int usbts_shift[] = {3, 4, 5}; | ||
| 610 | |||
| 611 | enum { | ||
| 612 | XMIT_SZ_8BYTE = 0, | ||
| 613 | XMIT_SZ_16BYTE = 1, | ||
| 614 | XMIT_SZ_32BYTE = 2, | ||
| 615 | }; | ||
| 616 | |||
| 617 | #define USBTS_INDEX2VAL(i) (((i) & 3) << 6) | ||
| 618 | |||
| 619 | static const struct sh_dmae_channel sh7372_usb_dmae_channels[] = { | ||
| 620 | { | ||
| 621 | .offset = 0, | ||
| 622 | }, { | ||
| 623 | .offset = 0x20, | ||
| 624 | }, | ||
| 625 | }; | ||
| 626 | |||
| 627 | /* USB DMAC0 */ | ||
| 628 | static const struct sh_dmae_slave_config sh7372_usb_dmae0_slaves[] = { | ||
| 629 | { | ||
| 630 | .slave_id = SHDMA_SLAVE_USB0_TX, | ||
| 631 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
| 632 | }, { | ||
| 633 | .slave_id = SHDMA_SLAVE_USB0_RX, | ||
| 634 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
| 635 | }, | ||
| 636 | }; | ||
| 637 | |||
| 638 | static struct sh_dmae_pdata usb_dma0_platform_data = { | ||
| 639 | .slave = sh7372_usb_dmae0_slaves, | ||
| 640 | .slave_num = ARRAY_SIZE(sh7372_usb_dmae0_slaves), | ||
| 641 | .channel = sh7372_usb_dmae_channels, | ||
| 642 | .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels), | ||
| 643 | .ts_low_shift = 6, | ||
| 644 | .ts_low_mask = 0xc0, | ||
| 645 | .ts_high_shift = 0, | ||
| 646 | .ts_high_mask = 0, | ||
| 647 | .ts_shift = usbts_shift, | ||
| 648 | .ts_shift_num = ARRAY_SIZE(usbts_shift), | ||
| 649 | .dmaor_init = DMAOR_DME, | ||
| 650 | .chcr_offset = 0x14, | ||
| 651 | .chcr_ie_bit = 1 << 5, | ||
| 652 | .dmaor_is_32bit = 1, | ||
| 653 | .needs_tend_set = 1, | ||
| 654 | .no_dmars = 1, | ||
| 655 | }; | ||
| 656 | |||
| 657 | static struct resource sh7372_usb_dmae0_resources[] = { | ||
| 658 | { | ||
| 659 | /* Channel registers and DMAOR */ | ||
| 660 | .start = 0xe68a0020, | ||
| 661 | .end = 0xe68a0064 - 1, | ||
| 662 | .flags = IORESOURCE_MEM, | ||
| 663 | }, | ||
| 664 | { | ||
| 665 | /* VCR/SWR/DMICR */ | ||
| 666 | .start = 0xe68a0000, | ||
| 667 | .end = 0xe68a0014 - 1, | ||
| 668 | .flags = IORESOURCE_MEM, | ||
| 669 | }, | ||
| 670 | { | ||
| 671 | /* IRQ for channels */ | ||
| 672 | .start = evt2irq(0x0a00), | ||
| 673 | .end = evt2irq(0x0a00), | ||
| 674 | .flags = IORESOURCE_IRQ, | ||
| 675 | }, | ||
| 676 | }; | ||
| 677 | |||
| 678 | static struct platform_device usb_dma0_device = { | ||
| 679 | .name = "sh-dma-engine", | ||
| 680 | .id = 3, | ||
| 681 | .resource = sh7372_usb_dmae0_resources, | ||
| 682 | .num_resources = ARRAY_SIZE(sh7372_usb_dmae0_resources), | ||
| 683 | .dev = { | ||
| 684 | .platform_data = &usb_dma0_platform_data, | ||
| 685 | }, | ||
| 686 | }; | ||
| 687 | |||
| 688 | /* USB DMAC1 */ | ||
| 689 | static const struct sh_dmae_slave_config sh7372_usb_dmae1_slaves[] = { | ||
| 690 | { | ||
| 691 | .slave_id = SHDMA_SLAVE_USB1_TX, | ||
| 692 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
| 693 | }, { | ||
| 694 | .slave_id = SHDMA_SLAVE_USB1_RX, | ||
| 695 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
| 696 | }, | ||
| 697 | }; | ||
| 698 | |||
| 699 | static struct sh_dmae_pdata usb_dma1_platform_data = { | ||
| 700 | .slave = sh7372_usb_dmae1_slaves, | ||
| 701 | .slave_num = ARRAY_SIZE(sh7372_usb_dmae1_slaves), | ||
| 702 | .channel = sh7372_usb_dmae_channels, | ||
| 703 | .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels), | ||
| 704 | .ts_low_shift = 6, | ||
| 705 | .ts_low_mask = 0xc0, | ||
| 706 | .ts_high_shift = 0, | ||
| 707 | .ts_high_mask = 0, | ||
| 708 | .ts_shift = usbts_shift, | ||
| 709 | .ts_shift_num = ARRAY_SIZE(usbts_shift), | ||
| 710 | .dmaor_init = DMAOR_DME, | ||
| 711 | .chcr_offset = 0x14, | ||
| 712 | .chcr_ie_bit = 1 << 5, | ||
| 713 | .dmaor_is_32bit = 1, | ||
| 714 | .needs_tend_set = 1, | ||
| 715 | .no_dmars = 1, | ||
| 716 | }; | ||
| 717 | |||
| 718 | static struct resource sh7372_usb_dmae1_resources[] = { | ||
| 719 | { | ||
| 720 | /* Channel registers and DMAOR */ | ||
| 721 | .start = 0xe68c0020, | ||
| 722 | .end = 0xe68c0064 - 1, | ||
| 723 | .flags = IORESOURCE_MEM, | ||
| 724 | }, | ||
| 725 | { | ||
| 726 | /* VCR/SWR/DMICR */ | ||
| 727 | .start = 0xe68c0000, | ||
| 728 | .end = 0xe68c0014 - 1, | ||
| 729 | .flags = IORESOURCE_MEM, | ||
| 730 | }, | ||
| 731 | { | ||
| 732 | /* IRQ for channels */ | ||
| 733 | .start = evt2irq(0x1d00), | ||
| 734 | .end = evt2irq(0x1d00), | ||
| 735 | .flags = IORESOURCE_IRQ, | ||
| 736 | }, | ||
| 737 | }; | ||
| 738 | |||
| 739 | static struct platform_device usb_dma1_device = { | ||
| 740 | .name = "sh-dma-engine", | ||
| 741 | .id = 4, | ||
| 742 | .resource = sh7372_usb_dmae1_resources, | ||
| 743 | .num_resources = ARRAY_SIZE(sh7372_usb_dmae1_resources), | ||
| 744 | .dev = { | ||
| 745 | .platform_data = &usb_dma1_platform_data, | ||
| 746 | }, | ||
| 747 | }; | ||
| 748 | |||
| 605 | /* VPU */ | 749 | /* VPU */ |
| 606 | static struct uio_info vpu_platform_data = { | 750 | static struct uio_info vpu_platform_data = { |
| 607 | .name = "VPU5HG", | 751 | .name = "VPU5HG", |
| @@ -818,7 +962,7 @@ static struct platform_device *sh7372_early_devices[] __initdata = { | |||
| 818 | &scif4_device, | 962 | &scif4_device, |
| 819 | &scif5_device, | 963 | &scif5_device, |
| 820 | &scif6_device, | 964 | &scif6_device, |
| 821 | &cmt10_device, | 965 | &cmt2_device, |
| 822 | &tmu00_device, | 966 | &tmu00_device, |
| 823 | &tmu01_device, | 967 | &tmu01_device, |
| 824 | }; | 968 | }; |
| @@ -829,6 +973,8 @@ static struct platform_device *sh7372_late_devices[] __initdata = { | |||
| 829 | &dma0_device, | 973 | &dma0_device, |
| 830 | &dma1_device, | 974 | &dma1_device, |
| 831 | &dma2_device, | 975 | &dma2_device, |
| 976 | &usb_dma0_device, | ||
| 977 | &usb_dma1_device, | ||
| 832 | &vpu_device, | 978 | &vpu_device, |
| 833 | &veu0_device, | 979 | &veu0_device, |
| 834 | &veu1_device, | 980 | &veu1_device, |
