From b890575e72319779f8ff471f14e8f04c9f68ccae Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Mon, 24 May 2021 19:49:21 +0800 Subject: [PATCH 1/2] dw-dma: allocate RUNTIME_SHARED for dw_chan The DMA channels need to be shared among pipelines and DSP cores, allocate buffer for it in RUNTIME_SHARED area. Signed-off-by: Keyon Jie --- src/drivers/dw/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/dw/dma.c b/src/drivers/dw/dma.c index ed8b28f4a305..e9dd7aa0a79c 100644 --- a/src/drivers/dw/dma.c +++ b/src/drivers/dw/dma.c @@ -985,7 +985,7 @@ static int dw_dma_probe(struct dma *dma) chan->index = i; chan->core = DMA_CORE_INVALID; - dw_chan = rzalloc(SOF_MEM_ZONE_SYS_RUNTIME, 0, SOF_MEM_CAPS_RAM, + dw_chan = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*dw_chan)); if (!dw_chan) { From 394c16563bebcc83dff9d7047127c6189cab89e3 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Mon, 24 May 2021 19:51:20 +0800 Subject: [PATCH 2/2] dai: allocate RUNTIME_SHARED for shared data The dd and dai_spec_config need to be shared among DSP cores, allocate them in RUNTIME_SHARED area. Signed-off-by: Keyon Jie --- src/audio/dai.c | 2 +- src/ipc/dai-ipc3.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/dai.c b/src/audio/dai.c index 7a90198d01fa..de086eafe723 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -164,7 +164,7 @@ static struct comp_dev *dai_new(const struct comp_driver *drv, return NULL; dev->ipc_config = *config; - dd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*dd)); + dd = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*dd)); if (!dd) { rfree(dev); return NULL; diff --git a/src/ipc/dai-ipc3.c b/src/ipc/dai-ipc3.c index 7a44069ab619..c4403c465760 100644 --- a/src/ipc/dai-ipc3.c +++ b/src/ipc/dai-ipc3.c @@ -247,7 +247,7 @@ int dai_config(struct comp_dev *dev, struct ipc_config_dai *common_config, /* allocated dai_config if not yet */ if (!dd->dai_spec_config) { - dd->dai_spec_config = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, + dd->dai_spec_config = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(struct sof_ipc_dai_config)); if (!dd->dai_spec_config) { comp_err(dev, "dai_config(): No memory for dai_config.");