Skip to content

Commit

Permalink
dmaengine/dw_dmac: Add 64 bit access width support for slave xfers on…
Browse files Browse the repository at this point in the history
… mem side

64 bit transfers are possible on both sides in slave transfers (memory as well
as peripherals). This patch adds support for it memory side 64 bit transfers.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
  • Loading branch information
Viresh Kumar authored and Vinod Koul committed Feb 22, 2012
1 parent ff7b05f commit 6bc711f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions drivers/dma/dw_dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,14 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,

mem = sg_phys(sg);
len = sg_dma_len(sg);
mem_width = 2;
if (unlikely(mem & 3 || len & 3))

if (!((mem | len) & 7))
mem_width = 3;
else if (!((mem | len) & 3))
mem_width = 2;
else if (!((mem | len) & 1))
mem_width = 1;
else
mem_width = 0;

slave_sg_todev_fill_desc:
Expand Down Expand Up @@ -807,8 +813,14 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,

mem = sg_phys(sg);
len = sg_dma_len(sg);
mem_width = 2;
if (unlikely(mem & 3 || len & 3))

if (!((mem | len) & 7))
mem_width = 3;
else if (!((mem | len) & 3))
mem_width = 2;
else if (!((mem | len) & 1))
mem_width = 1;
else
mem_width = 0;

slave_sg_fromdev_fill_desc:
Expand Down

0 comments on commit 6bc711f

Please sign in to comment.