Skip to content
Closed
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
11 changes: 6 additions & 5 deletions src/drivers/intel/baytrail/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ static void do_notify(void)

/* clear DONE bit - tell Host we have completed */
shim_write(SHIM_IPCDH, shim_read(SHIM_IPCDH) & ~SHIM_IPCDH_DONE);

/* unmask Done interrupt */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) & ~SHIM_IMRD_DONE);
}

static void irq_handler(void *arg)
Expand Down Expand Up @@ -150,6 +147,9 @@ void ipc_platform_send_msg(struct ipc *ipc)
ipc->shared_ctx->dsp_msg = msg;
tracev_ipc("ipc: msg tx -> 0x%x", msg->header);

/* Unmask Done interrupts first to receive ack */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) & ~SHIM_IMRD_DONE);

/* now interrupt host to tell it we have message sent */
shim_write(SHIM_IPCDL, msg->header);
shim_write(SHIM_IPCDH, SHIM_IPCDH_BUSY);
Expand Down Expand Up @@ -202,9 +202,10 @@ int platform_ipc_init(struct ipc *ipc)
interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, ipc);
interrupt_enable(PLATFORM_IPC_INTERRUPT, ipc);

/* Unmask Busy and Done interrupts */
/* Unmask Busy and mask Done interrupts */
imrd = shim_read(SHIM_IMRD);
imrd &= ~(SHIM_IMRD_BUSY | SHIM_IMRD_DONE);
imrd &= ~SHIM_IMRD_BUSY;
imrd |= SHIM_IMRD_DONE;
shim_write(SHIM_IMRD, imrd);

return 0;
Expand Down
13 changes: 7 additions & 6 deletions src/drivers/intel/haswell/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ static void do_notify(void)

/* clear DONE bit - tell Host we have completed */
shim_write(SHIM_IPCD, 0);

/* unmask Done interrupt */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) & ~SHIM_IMRD_DONE);
}

static void irq_handler(void *arg)
Expand All @@ -70,7 +67,7 @@ static void irq_handler(void *arg)

tracev_ipc("ipc: irq isr 0x%x", isr);

if (isr & SHIM_ISRD_DONE) {
if (isr & SHIM_ISRD_DONE && !(imrd & SHIM_IMRD_DONE)) {

/* Mask Done interrupt before return */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_DONE);
Expand Down Expand Up @@ -141,6 +138,9 @@ void ipc_platform_send_msg(struct ipc *ipc)
ipc->shared_ctx->dsp_msg = msg;
tracev_ipc("ipc: msg tx -> 0x%x", msg->header);

/* Unmask Done interrupts first to receive ack */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) & ~SHIM_IMRD_DONE);

/* now interrupt host to tell it we have message sent */
shim_write(SHIM_IPCD, SHIM_IPCD_BUSY);

Expand Down Expand Up @@ -192,9 +192,10 @@ int platform_ipc_init(struct ipc *ipc)
interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, ipc);
interrupt_enable(PLATFORM_IPC_INTERRUPT, ipc);

/* Unmask Busy and Done interrupts */
/* Unmask Busy and mask Done interrupts */
imrd = shim_read(SHIM_IMRD);
imrd &= ~(SHIM_IMRD_BUSY | SHIM_IMRD_DONE);
imrd &= ~SHIM_IMRD_BUSY;
imrd |= SHIM_IMRD_DONE;
shim_write(SHIM_IMRD, imrd);

return 0;
Expand Down
3 changes: 3 additions & 0 deletions src/platform/baytrail/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ int platform_boot_complete(uint32_t boot_message)
mailbox_dspbox_write(sizeof(ready), &sram_window,
sram_window.ext_hdr.hdr.size);

/* Unmask Done interrupts first to receive ack */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) & ~SHIM_IMRD_DONE);

/* now interrupt host to tell it we are done booting */
shim_write(SHIM_IPCDL, SOF_IPC_FW_READY | outbox);
shim_write(SHIM_IPCDH, SHIM_IPCDH_BUSY);
Expand Down
3 changes: 3 additions & 0 deletions src/platform/haswell/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ int platform_boot_complete(uint32_t boot_message)
mailbox_dspbox_write(sizeof(ready), &sram_window,
sram_window.ext_hdr.hdr.size);

/* Unmask Done interrupts first to receive ack */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) & ~SHIM_IMRD_DONE);

/* now interrupt host to tell it we are done booting */
shim_write(SHIM_IPCD, outbox | SHIM_IPCD_BUSY);

Expand Down