mirror of https://github.com/thesofproject/sof.git
dma: dw-dma: use 32 bit words for non peripheral copies.
DW-DMA is more optimal using 32bit data size when transferring between memories. Set configuration to always use 32 bit mode for non peripheral copies from memory to memory. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
parent
1532dfdad4
commit
b0f8e5d5c2
|
@ -586,9 +586,20 @@ static int dw_dma_set_config(struct dma *dma, int channel,
|
|||
/* write CTL_LOn for each lli */
|
||||
switch (config->src_width) {
|
||||
case 2:
|
||||
/* config the src tr width for 16 bit samples */
|
||||
/* non peripheral copies are optimal using words */
|
||||
switch (config->direction) {
|
||||
case DMA_DIR_LMEM_TO_HMEM:
|
||||
case DMA_DIR_HMEM_TO_LMEM:
|
||||
case DMA_DIR_MEM_TO_MEM:
|
||||
/* config the src tr width for 32 bit words */
|
||||
lli_desc->ctrl_lo |= DW_CTLL_SRC_WIDTH(2);
|
||||
break;
|
||||
default:
|
||||
/* config the src width for 16 bit samples */
|
||||
lli_desc->ctrl_lo |= DW_CTLL_SRC_WIDTH(1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
/* config the src tr width for 24, 32 bit samples */
|
||||
lli_desc->ctrl_lo |= DW_CTLL_SRC_WIDTH(2);
|
||||
|
@ -601,9 +612,20 @@ static int dw_dma_set_config(struct dma *dma, int channel,
|
|||
|
||||
switch (config->dest_width) {
|
||||
case 2:
|
||||
/* config the dest tr width for 16 bit samples */
|
||||
/* non peripheral copies are optimal using words */
|
||||
switch (config->direction) {
|
||||
case DMA_DIR_LMEM_TO_HMEM:
|
||||
case DMA_DIR_HMEM_TO_LMEM:
|
||||
case DMA_DIR_MEM_TO_MEM:
|
||||
/* config the dest tr width for 32 bit words */
|
||||
lli_desc->ctrl_lo |= DW_CTLL_DST_WIDTH(2);
|
||||
break;
|
||||
default:
|
||||
/* config the dest width for 16 bit samples */
|
||||
lli_desc->ctrl_lo |= DW_CTLL_DST_WIDTH(1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
/* config the dest tr width for 24, 32 bit samples */
|
||||
lli_desc->ctrl_lo |= DW_CTLL_DST_WIDTH(2);
|
||||
|
|
Loading…
Reference in New Issue