From e243122c1e560c5df81b765a27fc1c7435377cb8 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 7 Jul 2022 09:34:49 +0300 Subject: [PATCH] dma/cavs_hda: Configure DGMBS only for host DMA configuration The DGMBS should be only set for the host side and not on the link DMA. Fixes: #46632 Signed-off-by: Peter Ujfalusi --- drivers/dma/dma_cavs_hda.c | 20 +++++++++++++------ .../intel_adsp/common/include/cavs_hda.h | 1 - 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/dma/dma_cavs_hda.c b/drivers/dma/dma_cavs_hda.c index 02bac09f34..b7e4c1b97c 100644 --- a/drivers/dma/dma_cavs_hda.c +++ b/drivers/dma/dma_cavs_hda.c @@ -55,9 +55,13 @@ int cavs_hda_dma_host_in_config(const struct device *dev, res = cavs_hda_set_buffer(cfg->base, channel, buf, blk_cfg->block_size); - if (res == 0 && dma_cfg->source_data_size <= 3) { - /* set the sample container set bit to 16bits */ - *DGCS(cfg->base, channel) |= DGCS_SCS; + if (res == 0) { + *DGMBS(cfg->base, channel) = blk_cfg->block_size & HDA_ALIGN_MASK; + + if (dma_cfg->source_data_size <= 3) { + /* set the sample container set bit to 16bits */ + *DGCS(cfg->base, channel) |= DGCS_SCS; + } } return res; @@ -87,9 +91,13 @@ int cavs_hda_dma_host_out_config(const struct device *dev, res = cavs_hda_set_buffer(cfg->base, channel, buf, blk_cfg->block_size); - if (res == 0 && dma_cfg->dest_data_size <= 3) { - /* set the sample container set bit to 16bits */ - *DGCS(cfg->base, channel) |= DGCS_SCS; + if (res == 0) { + *DGMBS(cfg->base, channel) = blk_cfg->block_size & HDA_ALIGN_MASK; + + if (dma_cfg->dest_data_size <= 3) { + /* set the sample container set bit to 16bits */ + *DGCS(cfg->base, channel) |= DGCS_SCS; + } } return res; diff --git a/soc/xtensa/intel_adsp/common/include/cavs_hda.h b/soc/xtensa/intel_adsp/common/include/cavs_hda.h index e8d1bcd2a0..2dc53bd2ce 100644 --- a/soc/xtensa/intel_adsp/common/include/cavs_hda.h +++ b/soc/xtensa/intel_adsp/common/include/cavs_hda.h @@ -178,7 +178,6 @@ static inline int cavs_hda_set_buffer(uint32_t base, uint32_t sid, *DGBBA(base, sid) = aligned_addr; *DGBS(base, sid) = aligned_size; - *DGMBS(base, sid) = aligned_size; return 0; }