|
@@ -408,3 +408,105 @@ static struct resource r8a7740_dmae1_resources[] = {
|
|
|
{
|
|
|
/* IRQ for channels 0-5 */
|
|
|
.start = evt2irq(0x2100),
|
|
|
+ .end = evt2irq(0x21a0),
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+/* Resource order important! */
|
|
|
+static struct resource r8a7740_dmae2_resources[] = {
|
|
|
+ {
|
|
|
+ /* Channel registers and DMAOR */
|
|
|
+ .start = 0xfe028020,
|
|
|
+ .end = 0xfe02828f,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ /* DMARSx */
|
|
|
+ .start = 0xfe029000,
|
|
|
+ .end = 0xfe02900b,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ .name = "error_irq",
|
|
|
+ .start = evt2irq(0x22c0),
|
|
|
+ .end = evt2irq(0x22c0),
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ /* IRQ for channels 0-5 */
|
|
|
+ .start = evt2irq(0x2200),
|
|
|
+ .end = evt2irq(0x22a0),
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device dma0_device = {
|
|
|
+ .name = "sh-dma-engine",
|
|
|
+ .id = 0,
|
|
|
+ .resource = r8a7740_dmae0_resources,
|
|
|
+ .num_resources = ARRAY_SIZE(r8a7740_dmae0_resources),
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &dma_platform_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device dma1_device = {
|
|
|
+ .name = "sh-dma-engine",
|
|
|
+ .id = 1,
|
|
|
+ .resource = r8a7740_dmae1_resources,
|
|
|
+ .num_resources = ARRAY_SIZE(r8a7740_dmae1_resources),
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &dma_platform_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device dma2_device = {
|
|
|
+ .name = "sh-dma-engine",
|
|
|
+ .id = 2,
|
|
|
+ .resource = r8a7740_dmae2_resources,
|
|
|
+ .num_resources = ARRAY_SIZE(r8a7740_dmae2_resources),
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &dma_platform_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+/* USB-DMAC */
|
|
|
+static const struct sh_dmae_channel r8a7740_usb_dma_channels[] = {
|
|
|
+ {
|
|
|
+ .offset = 0,
|
|
|
+ }, {
|
|
|
+ .offset = 0x20,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static const struct sh_dmae_slave_config r8a7740_usb_dma_slaves[] = {
|
|
|
+ {
|
|
|
+ .slave_id = SHDMA_SLAVE_USBHS_TX,
|
|
|
+ .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE),
|
|
|
+ }, {
|
|
|
+ .slave_id = SHDMA_SLAVE_USBHS_RX,
|
|
|
+ .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE),
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct sh_dmae_pdata usb_dma_platform_data = {
|
|
|
+ .slave = r8a7740_usb_dma_slaves,
|
|
|
+ .slave_num = ARRAY_SIZE(r8a7740_usb_dma_slaves),
|
|
|
+ .channel = r8a7740_usb_dma_channels,
|
|
|
+ .channel_num = ARRAY_SIZE(r8a7740_usb_dma_channels),
|
|
|
+ .ts_low_shift = USBTS_LOW_SHIFT,
|
|
|
+ .ts_low_mask = USBTS_LOW_BIT << USBTS_LOW_SHIFT,
|
|
|
+ .ts_high_shift = USBTS_HI_SHIFT,
|
|
|
+ .ts_high_mask = USBTS_HI_BIT << USBTS_HI_SHIFT,
|
|
|
+ .ts_shift = dma_usbts_shift,
|
|
|
+ .ts_shift_num = ARRAY_SIZE(dma_usbts_shift),
|
|
|
+ .dmaor_init = DMAOR_DME,
|
|
|
+ .chcr_offset = 0x14,
|
|
|
+ .chcr_ie_bit = 1 << 5,
|
|
|
+ .dmaor_is_32bit = 1,
|
|
|
+ .needs_tend_set = 1,
|
|
|
+ .no_dmars = 1,
|
|
|
+ .slave_only = 1,
|
|
|
+};
|
|
|
+
|