ipc: dont assume DMAC0 is always used for IPC.

Refactor so other DMACs can be used for IPC purposes.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Liam Girdwood 2018-02-25 20:40:29 +00:00
parent dcf2369e4a
commit 24851d2f74
7 changed files with 9 additions and 10 deletions

View File

@ -36,7 +36,7 @@
/* private data for IPC */
struct intel_ipc_data {
/* DMA */
struct dma *dmac0;
struct dma *dmac;
uint8_t *page_table;
completion_t complete;

View File

@ -198,7 +198,7 @@ int platform_ipc_init(struct ipc *ipc)
bzero(iipc->page_table, HOST_PAGE_SIZE);
/* dma */
iipc->dmac0 = dma_get(DMA_GP_LP_DMAC0);
iipc->dmac = dma_get(DMA_GP_LP_DMAC0);
/* PM */
iipc->pm_prepare_D3 = 0;

View File

@ -86,7 +86,6 @@ out:
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) & ~SHIM_IMRD_DONE);
}
/* test code to check working IRQ */
static void irq_handler(void *arg)
{
uint32_t isr;
@ -226,7 +225,7 @@ int platform_ipc_init(struct ipc *ipc)
bzero(iipc->page_table, PLATFORM_PAGE_TABLE_SIZE);
/* dma */
iipc->dmac0 = dma_get(DMA_ID_DMAC0);
iipc->dmac = dma_get(DMA_ID_DMAC0);
/* PM */
iipc->pm_prepare_D3 = 0;

View File

@ -198,7 +198,7 @@ int platform_ipc_init(struct ipc *ipc)
bzero(iipc->page_table, HOST_PAGE_SIZE);
/* dma */
iipc->dmac0 = dma_get(DMA_GP_LP_DMAC0);
iipc->dmac = dma_get(DMA_GP_LP_DMAC0);
/* PM */
iipc->pm_prepare_D3 = 0;

View File

@ -215,7 +215,7 @@ int platform_ipc_init(struct ipc *ipc)
bzero(iipc->page_table, PLATFORM_PAGE_TABLE_SIZE);
/* dma */
iipc->dmac0 = dma_get(DMA_ID_DMAC0);
iipc->dmac = dma_get(DMA_ID_DMAC1);
/* PM */
iipc->pm_prepare_D3 = 0;

View File

@ -104,13 +104,13 @@ static int get_page_descriptors(struct intel_ipc_data *iipc,
int chan;
int ret = 0;
/* get DMA channel from DMAC0 */
chan = dma_channel_get(iipc->dmac0, 0);
/* get DMA channel from DMAC */
chan = dma_channel_get(iipc->dmac, 0);
if (chan < 0) {
trace_ipc_error("ePC");
return chan;
}
dma = iipc->dmac0;
dma = iipc->dmac;
/* set up DMA configuration */
config.direction = DMA_DIR_HMEM_TO_LMEM;

View File

@ -91,7 +91,7 @@ struct reef;
#define DMA_TRACE_RESCHEDULE_TIME 5000
/* DMAC used for trace DMA */
#define PLATFORM_TRACE_DMAC DMA_ID_DMAC0
#define PLATFORM_TRACE_DMAC DMA_ID_DMAC1
/* DSP should be idle in this time frame */
#define PLATFORM_IDLE_TIME 750000