aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/shdma.c6
-rw-r--r--include/linux/sh_dma.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index 6a21cd843ab7..0f3ec8d57a7a 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -194,6 +194,9 @@ static void dmae_start(struct sh_dmae_chan *sh_chan)
194 struct sh_dmae_device *shdev = to_sh_dev(sh_chan); 194 struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
195 u32 chcr = chcr_read(sh_chan); 195 u32 chcr = chcr_read(sh_chan);
196 196
197 if (shdev->pdata->needs_tend_set)
198 sh_dmae_writel(sh_chan, 0xFFFFFFFF, TEND);
199
197 chcr |= CHCR_DE | shdev->chcr_ie_bit; 200 chcr |= CHCR_DE | shdev->chcr_ie_bit;
198 chcr_write(sh_chan, chcr & ~CHCR_TE); 201 chcr_write(sh_chan, chcr & ~CHCR_TE);
199} 202}
@@ -242,6 +245,9 @@ static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val)
242 if (dmae_is_busy(sh_chan)) 245 if (dmae_is_busy(sh_chan))
243 return -EBUSY; 246 return -EBUSY;
244 247
248 if (pdata->no_dmars)
249 return 0;
250
245 /* in the case of a missing DMARS resource use first memory window */ 251 /* in the case of a missing DMARS resource use first memory window */
246 if (!addr) 252 if (!addr)
247 addr = (u16 __iomem *)shdev->chan_reg; 253 addr = (u16 __iomem *)shdev->chan_reg;
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index f25afc61e1c6..cb2dd118cc0f 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -66,6 +66,8 @@ struct sh_dmae_pdata {
66 u32 chcr_ie_bit; 66 u32 chcr_ie_bit;
67 67
68 unsigned int dmaor_is_32bit:1; 68 unsigned int dmaor_is_32bit:1;
69 unsigned int needs_tend_set:1;
70 unsigned int no_dmars:1;
69}; 71};
70 72
71/* DMA register */ 73/* DMA register */
@@ -75,6 +77,8 @@ struct sh_dmae_pdata {
75#define CHCR 0x0C 77#define CHCR 0x0C
76#define DMAOR 0x40 78#define DMAOR 0x40
77 79
80#define TEND 0x18 /* USB-DMAC */
81
78/* DMAOR definitions */ 82/* DMAOR definitions */
79#define DMAOR_AE 0x00000004 83#define DMAOR_AE 0x00000004
80#define DMAOR_NMIF 0x00000002 84#define DMAOR_NMIF 0x00000002