sue: enable IPC over SPI

Sue Creek uses SPI for IPC messages. This patch removes all DMA IPC
artefacts and makes necessary for SPI adjustments in sue-ipc.c. Note,
that it still uses the purely software IPC mailbox for uniformity
with other architectures.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2019-01-16 12:40:57 +01:00 committed by Liam Girdwood
parent 488bc759c9
commit ba7b7a6ce5
1 changed files with 4 additions and 13 deletions

View File

@ -42,6 +42,7 @@
#include <sof/alloc.h> #include <sof/alloc.h>
#include <sof/wait.h> #include <sof/wait.h>
#include <sof/trace.h> #include <sof/trace.h>
#include <sof/spi.h>
#include <sof/ssp.h> #include <sof/ssp.h>
#include <platform/interrupt.h> #include <platform/interrupt.h>
#include <platform/mailbox.h> #include <platform/mailbox.h>
@ -54,11 +55,6 @@
extern struct ipc *_ipc; extern struct ipc *_ipc;
/* test code to check working IRQ */
static void irq_handler(void *arg)
{
}
void ipc_platform_do_cmd(struct ipc *ipc) void ipc_platform_do_cmd(struct ipc *ipc)
{ {
struct ipc_data *iipc = ipc_get_drvdata(ipc); struct ipc_data *iipc = ipc_get_drvdata(ipc);
@ -68,6 +64,7 @@ void ipc_platform_do_cmd(struct ipc *ipc)
/* perform command and return any error */ /* perform command and return any error */
err = ipc_cmd(); err = ipc_cmd();
if (err > 0) { if (err > 0) {
mailbox_hostbox_read(&reply, 0, sizeof(reply));
goto done; /* reply created and copied by cmd() */ goto done; /* reply created and copied by cmd() */
} else if (err < 0) { } else if (err < 0) {
/* send std error reply */ /* send std error reply */
@ -80,9 +77,10 @@ void ipc_platform_do_cmd(struct ipc *ipc)
/* send std error/ok reply */ /* send std error/ok reply */
reply.hdr.cmd = SOF_IPC_GLB_REPLY; reply.hdr.cmd = SOF_IPC_GLB_REPLY;
reply.hdr.size = sizeof(reply); reply.hdr.size = sizeof(reply);
mailbox_hostbox_write(0, &reply, sizeof(reply));
done: done:
spi_push(spi_get(SOF_SPI_INTEL_SLAVE), &reply, sizeof(reply));
ipc->host_pending = 0; ipc->host_pending = 0;
// TODO: signal audio work to enter D3 in normal context // TODO: signal audio work to enter D3 in normal context
@ -140,12 +138,5 @@ int platform_ipc_init(struct ipc *ipc)
/* PM */ /* PM */
iipc->pm_prepare_D3 = 0; iipc->pm_prepare_D3 = 0;
/* configure interrupt */
interrupt_register(PLATFORM_IPC_INTERRUPT, IRQ_AUTO_UNMASK,
irq_handler, NULL);
interrupt_enable(PLATFORM_IPC_INTERRUPT);
/* enable IPC interrupts from host */
return 0; return 0;
} }