Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine updates from Vinod Koul: "This is fairly big pull by my standards as I had missed last merge window. So we have the support for device tree for slave-dmaengine, large updates to dw_dmac driver from Andy for reusing on different architectures. Along with this we have fixes on bunch of the drivers" Fix up trivial conflicts, usually due to #include line movement next to each other. * 'next' of git://git.infradead.org/users/vkoul/slave-dma: (111 commits) Revert "ARM: SPEAr13xx: Pass DW DMAC platform data from DT" ARM: dts: pl330: Add #dma-cells for generic dma binding support DMA: PL330: Register the DMA controller with the generic DMA helpers DMA: PL330: Add xlate function DMA: PL330: Add new pl330 filter for DT case. dma: tegra20-apb-dma: remove unnecessary assignment edma: do not waste memory for dma_mask dma: coh901318: set residue only if dma is in progress dma: coh901318: avoid unbalanced locking dmaengine.h: remove redundant else keyword dma: of-dma: protect list write operation by spin_lock dmaengine: ste_dma40: do not remove descriptors for cyclic transfers dma: of-dma.c: fix memory leakage dw_dmac: apply default dma_mask if needed dmaengine: ioat - fix spare sparse complain dmaengine: move drivers/of/dma.c -> drivers/dma/of-dma.c ioatdma: fix race between updating ioat->head and IOAT_COMPLETION_PENDING dw_dmac: add support for Lynxpoint DMA controllers dw_dmac: return proper residue value dw_dmac: fill individual length of descriptor ...
这个提交包含在:
@@ -32,7 +32,9 @@
|
||||
#define SIRFSOC_DMA_CH_VALID 0x140
|
||||
#define SIRFSOC_DMA_CH_INT 0x144
|
||||
#define SIRFSOC_DMA_INT_EN 0x148
|
||||
#define SIRFSOC_DMA_INT_EN_CLR 0x14C
|
||||
#define SIRFSOC_DMA_CH_LOOP_CTRL 0x150
|
||||
#define SIRFSOC_DMA_CH_LOOP_CTRL_CLR 0x15C
|
||||
|
||||
#define SIRFSOC_DMA_MODE_CTRL_BIT 4
|
||||
#define SIRFSOC_DMA_DIR_CTRL_BIT 5
|
||||
@@ -76,6 +78,7 @@ struct sirfsoc_dma {
|
||||
struct sirfsoc_dma_chan channels[SIRFSOC_DMA_CHANNELS];
|
||||
void __iomem *base;
|
||||
int irq;
|
||||
bool is_marco;
|
||||
};
|
||||
|
||||
#define DRV_NAME "sirfsoc_dma"
|
||||
@@ -288,17 +291,67 @@ static int sirfsoc_dma_terminate_all(struct sirfsoc_dma_chan *schan)
|
||||
int cid = schan->chan.chan_id;
|
||||
unsigned long flags;
|
||||
|
||||
writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_INT_EN) &
|
||||
~(1 << cid), sdma->base + SIRFSOC_DMA_INT_EN);
|
||||
spin_lock_irqsave(&schan->lock, flags);
|
||||
|
||||
if (!sdma->is_marco) {
|
||||
writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_INT_EN) &
|
||||
~(1 << cid), sdma->base + SIRFSOC_DMA_INT_EN);
|
||||
writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL)
|
||||
& ~((1 << cid) | 1 << (cid + 16)),
|
||||
sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL);
|
||||
} else {
|
||||
writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_INT_EN_CLR);
|
||||
writel_relaxed((1 << cid) | 1 << (cid + 16),
|
||||
sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL_CLR);
|
||||
}
|
||||
|
||||
writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_CH_VALID);
|
||||
|
||||
writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL)
|
||||
& ~((1 << cid) | 1 << (cid + 16)),
|
||||
sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL);
|
||||
|
||||
spin_lock_irqsave(&schan->lock, flags);
|
||||
list_splice_tail_init(&schan->active, &schan->free);
|
||||
list_splice_tail_init(&schan->queued, &schan->free);
|
||||
|
||||
spin_unlock_irqrestore(&schan->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sirfsoc_dma_pause_chan(struct sirfsoc_dma_chan *schan)
|
||||
{
|
||||
struct sirfsoc_dma *sdma = dma_chan_to_sirfsoc_dma(&schan->chan);
|
||||
int cid = schan->chan.chan_id;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&schan->lock, flags);
|
||||
|
||||
if (!sdma->is_marco)
|
||||
writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL)
|
||||
& ~((1 << cid) | 1 << (cid + 16)),
|
||||
sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL);
|
||||
else
|
||||
writel_relaxed((1 << cid) | 1 << (cid + 16),
|
||||
sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL_CLR);
|
||||
|
||||
spin_unlock_irqrestore(&schan->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sirfsoc_dma_resume_chan(struct sirfsoc_dma_chan *schan)
|
||||
{
|
||||
struct sirfsoc_dma *sdma = dma_chan_to_sirfsoc_dma(&schan->chan);
|
||||
int cid = schan->chan.chan_id;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&schan->lock, flags);
|
||||
|
||||
if (!sdma->is_marco)
|
||||
writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL)
|
||||
| ((1 << cid) | 1 << (cid + 16)),
|
||||
sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL);
|
||||
else
|
||||
writel_relaxed((1 << cid) | 1 << (cid + 16),
|
||||
sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL);
|
||||
|
||||
spin_unlock_irqrestore(&schan->lock, flags);
|
||||
|
||||
return 0;
|
||||
@@ -311,6 +364,10 @@ static int sirfsoc_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
|
||||
struct sirfsoc_dma_chan *schan = dma_chan_to_sirfsoc_dma_chan(chan);
|
||||
|
||||
switch (cmd) {
|
||||
case DMA_PAUSE:
|
||||
return sirfsoc_dma_pause_chan(schan);
|
||||
case DMA_RESUME:
|
||||
return sirfsoc_dma_resume_chan(schan);
|
||||
case DMA_TERMINATE_ALL:
|
||||
return sirfsoc_dma_terminate_all(schan);
|
||||
case DMA_SLAVE_CONFIG:
|
||||
@@ -568,6 +625,9 @@ static int sirfsoc_dma_probe(struct platform_device *op)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (of_device_is_compatible(dn, "sirf,marco-dmac"))
|
||||
sdma->is_marco = true;
|
||||
|
||||
if (of_property_read_u32(dn, "cell-index", &id)) {
|
||||
dev_err(dev, "Fail to get DMAC index\n");
|
||||
return -ENODEV;
|
||||
@@ -668,6 +728,7 @@ static int sirfsoc_dma_remove(struct platform_device *op)
|
||||
|
||||
static struct of_device_id sirfsoc_dma_match[] = {
|
||||
{ .compatible = "sirf,prima2-dmac", },
|
||||
{ .compatible = "sirf,marco-dmac", },
|
||||
{},
|
||||
};
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户