Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/audio/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,7 @@ static int host_params(struct comp_dev *dev)
config->dest_width = comp_sample_bytes(dev);
config->cyclic = 0;

#if !defined CONFIG_DMA_GW
host_elements_reset(dev);
#endif

#if defined CONFIG_DMA_GW
dev->params.stream_tag -= 1;
/* get DMA channel from DMAC
* note: stream_tag is ignored by dw-dma
Expand All @@ -527,13 +524,22 @@ static int host_params(struct comp_dev *dev)
trace_host_error("eDC");
return -ENODEV;
}
#if defined CONFIG_DMA_GW
err = dma_set_config(hd->dma, hd->chan, &hd->config);
if (err < 0) {
trace_host_error("eDc");
dma_channel_put(hd->dma, hd->chan);
return err;
}
#else
host_elements_reset(dev);
/* get DMA channel from DMAC
* note: stream_tag is ignored by dw-dma
*/
hd->chan = dma_channel_get(hd->dma, 0);
if (hd->chan < 0) {
trace_host_error("eDC");
return -ENODEV;
}
#endif
/* set up callback */
dma_set_cb(hd->dma, hd->chan, DMA_IRQ_TYPE_LLIST,
Expand Down
1 change: 1 addition & 0 deletions src/ipc/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ int ipc_get_page_descriptors(struct dma *dmac, uint8_t *page_table,
config.src_width = sizeof(uint32_t);
config.dest_width = sizeof(uint32_t);
config.cyclic = 0;
config.timer_delay = 0;
dma_sg_init(&config.elem_array);

/* set up DMA descriptor */
Expand Down
19 changes: 9 additions & 10 deletions src/platform/baytrail/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ struct dma dma[PLATFORM_NUM_DMACS] = {
.caps = DMA_CAP_GP_HP,
.devs = DMA_DEV_SSP | DMA_DEV_DMIC | DMA_DEV_HOST,
.base = DMA0_BASE,
.channels = 8,
.irq = IRQ_NUM_EXT_DMAC0,
.drv_plat_data = &dmac0,
},
Expand All @@ -167,6 +168,7 @@ struct dma dma[PLATFORM_NUM_DMACS] = {
.caps = DMA_CAP_GP_HP,
.devs = DMA_DEV_SSP | DMA_DEV_DMIC | DMA_DEV_HOST,
.base = DMA1_BASE,
.channels = 8,
.irq = IRQ_NUM_EXT_DMAC1,
.drv_plat_data = &dmac1,
},
Expand All @@ -182,6 +184,7 @@ struct dma dma[PLATFORM_NUM_DMACS] = {
.caps = DMA_CAP_GP_HP,
.devs = DMA_DEV_SSP | DMA_DEV_DMIC | DMA_DEV_HOST,
.base = DMA2_BASE,
.channels = 8,
.irq = IRQ_NUM_EXT_DMAC2,
.drv_plat_data = &dmac2,
},
Expand All @@ -193,18 +196,14 @@ struct dma dma[PLATFORM_NUM_DMACS] = {
/* Initialize all platform DMAC's */
int dmac_init(void)
{
int i, ret;
int i;
/* no probing before first use */

for (i = 0; i < ARRAY_SIZE(dma); i++) {
ret = dma_probe(&dma[i]);
if (ret < 0) {
/* TODO: dynamic init based on platform settings */

/* trace failed DMAC ID */
trace_error(TRACE_CLASS_DMA, "edi");
trace_error_value(dma[i].plat_data.id);
return ret;
}
}
/* early lock initialization for ref counting */
for (i = 0; i < ARRAY_SIZE(dma); i++)
spinlock_init(&dma[i].lock);

/* tell the lib DMAs are ready to use */
dma_install(dma, ARRAY_SIZE(dma));
Expand Down
18 changes: 8 additions & 10 deletions src/platform/haswell/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ struct dma dma[PLATFORM_NUM_DMACS] = {
.devs = DMA_DEV_SSP | DMA_DEV_DMIC | DMA_DEV_HOST,
.irq = IRQ_NUM_EXT_DMAC0,
.drv_plat_data = &dmac0,
.channels = 8,
},
.ops = &dw_dma_ops,
},
Expand All @@ -128,25 +129,22 @@ struct dma dma[PLATFORM_NUM_DMACS] = {
.devs = DMA_DEV_SSP | DMA_DEV_DMIC | DMA_DEV_HOST,
.irq = IRQ_NUM_EXT_DMAC1,
.drv_plat_data = &dmac1,
.channels = 8,
},
.ops = &dw_dma_ops,
},};

/* Initialize all platform DMAC's */
int dmac_init(void)
{
int i, ret;
int i;
/* no probing before first use */

for (i = 0; i < ARRAY_SIZE(dma); i++) {
ret = dma_probe(&dma[i]);
if (ret < 0) {
/* TODO: dynamic init based on platform settings */

/* trace failed DMAC ID */
trace_error(TRACE_CLASS_DMA, "edi");
trace_error_value(dma[i].plat_data.id);
return ret;
}
}
/* early lock initialization for ref counting */
for (i = 0; i < ARRAY_SIZE(dma); i++)
spinlock_init(&dma[i].lock);

/* clear the masks for dsp of the dmacs */
io_reg_update_bits(SHIM_BASE + SHIM_IMRD,
Expand Down