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