aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/ste_dma40.c8
-rw-r--r--drivers/dma/ste_dma40_ll.c42
-rw-r--r--drivers/dma/ste_dma40_ll.h5
3 files changed, 22 insertions, 33 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index c597dba713b0..3c61c582303d 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1679,17 +1679,13 @@ d40_prep_sg_phy(struct d40_chan *chan, struct d40_desc *desc,
1679 desc->lli_phy.src, 1679 desc->lli_phy.src,
1680 virt_to_phys(desc->lli_phy.src), 1680 virt_to_phys(desc->lli_phy.src),
1681 chan->src_def_cfg, 1681 chan->src_def_cfg,
1682 src_info->data_width, 1682 src_info, dst_info);
1683 dst_info->data_width,
1684 src_info->psize);
1685 1683
1686 ret = d40_phy_sg_to_lli(sg_dst, sg_len, dst_dev_addr, 1684 ret = d40_phy_sg_to_lli(sg_dst, sg_len, dst_dev_addr,
1687 desc->lli_phy.dst, 1685 desc->lli_phy.dst,
1688 virt_to_phys(desc->lli_phy.dst), 1686 virt_to_phys(desc->lli_phy.dst),
1689 chan->dst_def_cfg, 1687 chan->dst_def_cfg,
1690 dst_info->data_width, 1688 dst_info, src_info);
1691 src_info->data_width,
1692 dst_info->psize);
1693 1689
1694 dma_sync_single_for_device(chan->base->dev, desc->lli_pool.dma_addr, 1690 dma_sync_single_for_device(chan->base->dev, desc->lli_pool.dma_addr,
1695 desc->lli_pool.size, DMA_TO_DEVICE); 1691 desc->lli_pool.size, DMA_TO_DEVICE);
diff --git a/drivers/dma/ste_dma40_ll.c b/drivers/dma/ste_dma40_ll.c
index 9935c6dbcfe0..509a13049d7e 100644
--- a/drivers/dma/ste_dma40_ll.c
+++ b/drivers/dma/ste_dma40_ll.c
@@ -125,13 +125,14 @@ void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
125static int d40_phy_fill_lli(struct d40_phy_lli *lli, 125static int d40_phy_fill_lli(struct d40_phy_lli *lli,
126 dma_addr_t data, 126 dma_addr_t data,
127 u32 data_size, 127 u32 data_size,
128 int psize,
129 dma_addr_t next_lli, 128 dma_addr_t next_lli,
130 u32 reg_cfg, 129 u32 reg_cfg,
131 bool term_int, 130 bool term_int,
132 u32 data_width, 131 bool is_device,
133 bool is_device) 132 struct stedma40_half_channel_info *info)
134{ 133{
134 unsigned int data_width = info->data_width;
135 int psize = info->psize;
135 int num_elems; 136 int num_elems;
136 137
137 if (psize == STEDMA40_PSIZE_PHY_1) 138 if (psize == STEDMA40_PSIZE_PHY_1)
@@ -198,16 +199,11 @@ static int d40_seg_size(int size, int data_width1, int data_width2)
198 return seg_max; 199 return seg_max;
199} 200}
200 201
201static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli, 202static struct d40_phy_lli *
202 dma_addr_t addr, 203d40_phy_buf_to_lli(struct d40_phy_lli *lli, dma_addr_t addr, u32 size,
203 u32 size, 204 dma_addr_t lli_phys, u32 reg_cfg, bool term_int,
204 int psize, 205 bool is_device, struct stedma40_half_channel_info *info,
205 dma_addr_t lli_phys, 206 struct stedma40_half_channel_info *otherinfo)
206 u32 reg_cfg,
207 bool term_int,
208 u32 data_width1,
209 u32 data_width2,
210 bool is_device)
211{ 207{
212 int err; 208 int err;
213 dma_addr_t next = lli_phys; 209 dma_addr_t next = lli_phys;
@@ -215,7 +211,8 @@ static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli,
215 int size_seg = 0; 211 int size_seg = 0;
216 212
217 do { 213 do {
218 size_seg = d40_seg_size(size_rest, data_width1, data_width2); 214 size_seg = d40_seg_size(size_rest, info->data_width,
215 otherinfo->data_width);
219 size_rest -= size_seg; 216 size_rest -= size_seg;
220 217
221 if (term_int && size_rest == 0) 218 if (term_int && size_rest == 0)
@@ -227,12 +224,11 @@ static struct d40_phy_lli *d40_phy_buf_to_lli(struct d40_phy_lli *lli,
227 err = d40_phy_fill_lli(lli, 224 err = d40_phy_fill_lli(lli,
228 addr, 225 addr,
229 size_seg, 226 size_seg,
230 psize,
231 next, 227 next,
232 reg_cfg, 228 reg_cfg,
233 !next, 229 !next,
234 data_width1, 230 is_device,
235 is_device); 231 info);
236 232
237 if (err) 233 if (err)
238 goto err; 234 goto err;
@@ -254,9 +250,8 @@ int d40_phy_sg_to_lli(struct scatterlist *sg,
254 struct d40_phy_lli *lli_sg, 250 struct d40_phy_lli *lli_sg,
255 dma_addr_t lli_phys, 251 dma_addr_t lli_phys,
256 u32 reg_cfg, 252 u32 reg_cfg,
257 u32 data_width1, 253 struct stedma40_half_channel_info *info,
258 u32 data_width2, 254 struct stedma40_half_channel_info *otherinfo)
259 int psize)
260{ 255{
261 int total_size = 0; 256 int total_size = 0;
262 int i; 257 int i;
@@ -280,13 +275,12 @@ int d40_phy_sg_to_lli(struct scatterlist *sg,
280 lli = d40_phy_buf_to_lli(lli, 275 lli = d40_phy_buf_to_lli(lli,
281 dst, 276 dst,
282 sg_dma_len(current_sg), 277 sg_dma_len(current_sg),
283 psize,
284 l_phys, 278 l_phys,
285 reg_cfg, 279 reg_cfg,
286 sg_len - 1 == i, 280 sg_len - 1 == i,
287 data_width1, 281 target == dst,
288 data_width2, 282 info,
289 target == dst); 283 otherinfo);
290 if (lli == NULL) 284 if (lli == NULL)
291 return -EINVAL; 285 return -EINVAL;
292 } 286 }
diff --git a/drivers/dma/ste_dma40_ll.h b/drivers/dma/ste_dma40_ll.h
index 867f23f6e098..cd94afd9c2f2 100644
--- a/drivers/dma/ste_dma40_ll.h
+++ b/drivers/dma/ste_dma40_ll.h
@@ -308,9 +308,8 @@ int d40_phy_sg_to_lli(struct scatterlist *sg,
308 struct d40_phy_lli *lli, 308 struct d40_phy_lli *lli,
309 dma_addr_t lli_phys, 309 dma_addr_t lli_phys,
310 u32 reg_cfg, 310 u32 reg_cfg,
311 u32 data_width1, 311 struct stedma40_half_channel_info *info,
312 u32 data_width2, 312 struct stedma40_half_channel_info *otherinfo);
313 int psize);
314 313
315/* Logical channels */ 314/* Logical channels */
316 315