|
|
@@ -93,16 +93,16 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
for (i = 0; i < chip->dw->hdata->nr_channels; i++) {
|
|
|
axi_chan_irq_disable(&chip->dw->chan[i], DWAXIDMAC_IRQ_ALL);
|
|
|
axi_chan_disable(&chip->dw->chan[i]);
|
|
|
-@@ -282,7 +305,7 @@ static struct axi_dma_lli *axi_desc_get(
|
|
|
+@@ -283,7 +306,7 @@ static struct axi_dma_lli *axi_desc_get(
|
|
|
static void axi_desc_put(struct axi_dma_desc *desc)
|
|
|
{
|
|
|
struct axi_dma_chan *chan = desc->chan;
|
|
|
-- int count = atomic_read(&chan->descs_allocated);
|
|
|
+- int count = desc->nr_hw_descs;
|
|
|
+ u32 count = desc->hw_desc_count;
|
|
|
struct axi_dma_hw_desc *hw_desc;
|
|
|
int descs_put;
|
|
|
|
|
|
-@@ -304,6 +327,48 @@ static void vchan_desc_put(struct virt_d
|
|
|
+@@ -305,6 +328,48 @@ static void vchan_desc_put(struct virt_d
|
|
|
axi_desc_put(vd_to_axi_desc(vdesc));
|
|
|
}
|
|
|
|
|
|
@@ -151,7 +151,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
static enum dma_status
|
|
|
dma_chan_tx_status(struct dma_chan *dchan, dma_cookie_t cookie,
|
|
|
struct dma_tx_state *txstate)
|
|
|
-@@ -313,10 +378,7 @@ dma_chan_tx_status(struct dma_chan *dcha
|
|
|
+@@ -314,10 +379,7 @@ dma_chan_tx_status(struct dma_chan *dcha
|
|
|
enum dma_status status;
|
|
|
u32 completed_length;
|
|
|
unsigned long flags;
|
|
|
@@ -162,7 +162,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
|
|
|
status = dma_cookie_status(dchan, cookie, txstate);
|
|
|
if (status == DMA_COMPLETE || !txstate)
|
|
|
-@@ -325,16 +387,31 @@ dma_chan_tx_status(struct dma_chan *dcha
|
|
|
+@@ -326,16 +388,31 @@ dma_chan_tx_status(struct dma_chan *dcha
|
|
|
spin_lock_irqsave(&chan->vc.lock, flags);
|
|
|
|
|
|
vdesc = vchan_find_desc(&chan->vc, cookie);
|
|
|
@@ -201,7 +201,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
|
|
|
return status;
|
|
|
}
|
|
|
-@@ -522,7 +599,7 @@ static void dw_axi_dma_set_hw_channel(st
|
|
|
+@@ -523,7 +600,7 @@ static void dw_axi_dma_set_hw_channel(st
|
|
|
unsigned long reg_value, val;
|
|
|
|
|
|
if (!chip->apb_regs) {
|
|
|
@@ -210,7 +210,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-@@ -626,18 +703,25 @@ static int dw_axi_dma_set_hw_desc(struct
|
|
|
+@@ -627,18 +704,25 @@ static int dw_axi_dma_set_hw_desc(struct
|
|
|
switch (chan->direction) {
|
|
|
case DMA_MEM_TO_DEV:
|
|
|
reg_width = __ffs(chan->config.dst_addr_width);
|
|
|
@@ -238,7 +238,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
DWAXIDMAC_CH_CTL_L_INC << CH_CTL_L_DST_INC_POS |
|
|
|
DWAXIDMAC_CH_CTL_L_NOINC << CH_CTL_L_SRC_INC_POS;
|
|
|
block_ts = len >> reg_width;
|
|
|
-@@ -673,9 +757,6 @@ static int dw_axi_dma_set_hw_desc(struct
|
|
|
+@@ -674,9 +758,6 @@ static int dw_axi_dma_set_hw_desc(struct
|
|
|
}
|
|
|
|
|
|
hw_desc->lli->block_ts_lo = cpu_to_le32(block_ts - 1);
|
|
|
@@ -248,7 +248,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
hw_desc->lli->ctl_lo = cpu_to_le32(ctllo);
|
|
|
|
|
|
set_desc_src_master(hw_desc);
|
|
|
-@@ -770,6 +851,8 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c
|
|
|
+@@ -771,6 +852,8 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c
|
|
|
src_addr += segment_len;
|
|
|
}
|
|
|
|
|
|
@@ -257,7 +257,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
llp = desc->hw_desc[0].llp;
|
|
|
|
|
|
/* Managed transfer list */
|
|
|
-@@ -849,6 +932,8 @@ dw_axi_dma_chan_prep_slave_sg(struct dma
|
|
|
+@@ -850,6 +933,8 @@ dw_axi_dma_chan_prep_slave_sg(struct dma
|
|
|
} while (len >= segment_len);
|
|
|
}
|
|
|
|
|
|
@@ -266,7 +266,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
/* Set end-of-link to the last link descriptor of list */
|
|
|
set_desc_last(&desc->hw_desc[num_sgs - 1]);
|
|
|
|
|
|
-@@ -956,6 +1041,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan
|
|
|
+@@ -957,6 +1042,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan
|
|
|
num++;
|
|
|
}
|
|
|
|
|
|
@@ -275,7 +275,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
/* Set end-of-link to the last link descriptor of list */
|
|
|
set_desc_last(&desc->hw_desc[num - 1]);
|
|
|
/* Managed transfer list */
|
|
|
-@@ -1004,7 +1091,7 @@ static void axi_chan_dump_lli(struct axi
|
|
|
+@@ -1005,7 +1092,7 @@ static void axi_chan_dump_lli(struct axi
|
|
|
static void axi_chan_list_dump_lli(struct axi_dma_chan *chan,
|
|
|
struct axi_dma_desc *desc_head)
|
|
|
{
|
|
|
@@ -284,7 +284,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
int i;
|
|
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
-@@ -1047,11 +1134,11 @@ out:
|
|
|
+@@ -1048,11 +1135,11 @@ out:
|
|
|
|
|
|
static void axi_chan_block_xfer_complete(struct axi_dma_chan *chan)
|
|
|
{
|
|
|
@@ -297,7 +297,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
u64 llp;
|
|
|
int i;
|
|
|
|
|
|
-@@ -1073,6 +1160,7 @@ static void axi_chan_block_xfer_complete
|
|
|
+@@ -1074,6 +1161,7 @@ static void axi_chan_block_xfer_complete
|
|
|
if (chan->cyclic) {
|
|
|
desc = vd_to_axi_desc(vd);
|
|
|
if (desc) {
|
|
|
@@ -305,7 +305,7 @@ Signed-off-by: Phil Elwell <[email protected]>
|
|
|
llp = lo_hi_readq(chan->chan_regs + CH_LLP);
|
|
|
for (i = 0; i < count; i++) {
|
|
|
hw_desc = &desc->hw_desc[i];
|
|
|
-@@ -1325,6 +1413,10 @@ static int parse_device_properties(struc
|
|
|
+@@ -1323,6 +1411,10 @@ static int parse_device_properties(struc
|
|
|
|
|
|
chip->dw->hdata->nr_masters = tmp;
|
|
|
|