diff options
Diffstat (limited to 'drivers/dma/sirf-dma.c')
-rw-r--r-- | drivers/dma/sirf-dma.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c index c3de6edb9651..3c210ba9f938 100644 --- a/drivers/dma/sirf-dma.c +++ b/drivers/dma/sirf-dma.c | |||
@@ -32,7 +32,9 @@ | |||
32 | #define SIRFSOC_DMA_CH_VALID 0x140 | 32 | #define SIRFSOC_DMA_CH_VALID 0x140 |
33 | #define SIRFSOC_DMA_CH_INT 0x144 | 33 | #define SIRFSOC_DMA_CH_INT 0x144 |
34 | #define SIRFSOC_DMA_INT_EN 0x148 | 34 | #define SIRFSOC_DMA_INT_EN 0x148 |
35 | #define SIRFSOC_DMA_INT_EN_CLR 0x14C | ||
35 | #define SIRFSOC_DMA_CH_LOOP_CTRL 0x150 | 36 | #define SIRFSOC_DMA_CH_LOOP_CTRL 0x150 |
37 | #define SIRFSOC_DMA_CH_LOOP_CTRL_CLR 0x15C | ||
36 | 38 | ||
37 | #define SIRFSOC_DMA_MODE_CTRL_BIT 4 | 39 | #define SIRFSOC_DMA_MODE_CTRL_BIT 4 |
38 | #define SIRFSOC_DMA_DIR_CTRL_BIT 5 | 40 | #define SIRFSOC_DMA_DIR_CTRL_BIT 5 |
@@ -76,6 +78,7 @@ struct sirfsoc_dma { | |||
76 | struct sirfsoc_dma_chan channels[SIRFSOC_DMA_CHANNELS]; | 78 | struct sirfsoc_dma_chan channels[SIRFSOC_DMA_CHANNELS]; |
77 | void __iomem *base; | 79 | void __iomem *base; |
78 | int irq; | 80 | int irq; |
81 | bool is_marco; | ||
79 | }; | 82 | }; |
80 | 83 | ||
81 | #define DRV_NAME "sirfsoc_dma" | 84 | #define DRV_NAME "sirfsoc_dma" |
@@ -288,13 +291,19 @@ static int sirfsoc_dma_terminate_all(struct sirfsoc_dma_chan *schan) | |||
288 | int cid = schan->chan.chan_id; | 291 | int cid = schan->chan.chan_id; |
289 | unsigned long flags; | 292 | unsigned long flags; |
290 | 293 | ||
291 | writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_INT_EN) & | 294 | if (!sdma->is_marco) { |
292 | ~(1 << cid), sdma->base + SIRFSOC_DMA_INT_EN); | 295 | writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_INT_EN) & |
293 | writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_CH_VALID); | 296 | ~(1 << cid), sdma->base + SIRFSOC_DMA_INT_EN); |
294 | 297 | writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL) | |
295 | writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL) | 298 | & ~((1 << cid) | 1 << (cid + 16)), |
296 | & ~((1 << cid) | 1 << (cid + 16)), | ||
297 | sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL); | 299 | sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL); |
300 | } else { | ||
301 | writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_INT_EN_CLR); | ||
302 | writel_relaxed((1 << cid) | 1 << (cid + 16), | ||
303 | sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL_CLR); | ||
304 | } | ||
305 | |||
306 | writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_CH_VALID); | ||
298 | 307 | ||
299 | spin_lock_irqsave(&schan->lock, flags); | 308 | spin_lock_irqsave(&schan->lock, flags); |
300 | list_splice_tail_init(&schan->active, &schan->free); | 309 | list_splice_tail_init(&schan->active, &schan->free); |
@@ -568,6 +577,9 @@ static int sirfsoc_dma_probe(struct platform_device *op) | |||
568 | return -ENOMEM; | 577 | return -ENOMEM; |
569 | } | 578 | } |
570 | 579 | ||
580 | if (of_device_is_compatible(dn, "sirf,marco-dmac")) | ||
581 | sdma->is_marco = true; | ||
582 | |||
571 | if (of_property_read_u32(dn, "cell-index", &id)) { | 583 | if (of_property_read_u32(dn, "cell-index", &id)) { |
572 | dev_err(dev, "Fail to get DMAC index\n"); | 584 | dev_err(dev, "Fail to get DMAC index\n"); |
573 | return -ENODEV; | 585 | return -ENODEV; |
@@ -668,6 +680,7 @@ static int __devexit sirfsoc_dma_remove(struct platform_device *op) | |||
668 | 680 | ||
669 | static struct of_device_id sirfsoc_dma_match[] = { | 681 | static struct of_device_id sirfsoc_dma_match[] = { |
670 | { .compatible = "sirf,prima2-dmac", }, | 682 | { .compatible = "sirf,prima2-dmac", }, |
683 | { .compatible = "sirf,marco-dmac", }, | ||
671 | {}, | 684 | {}, |
672 | }; | 685 | }; |
673 | 686 | ||