From c37f1ff487a1297f4ca461ebe4a0896aba26a51c Mon Sep 17 00:00:00 2001 From: John Gunn Date: Thu, 25 Apr 2019 23:00:04 +0100 Subject: [PATCH 1/2] hikey: fix IRAM/DRAM base addresses Add base addresses so FW will load correctly using SOF format. Signed-off-by: John Gunn --- hw/adsp/dsp/hikey.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/adsp/dsp/hikey.c b/hw/adsp/dsp/hikey.c index bc6cadb6a1b21..6d42d353a1172 100644 --- a/hw/adsp/dsp/hikey.c +++ b/hw/adsp/dsp/hikey.c @@ -387,6 +387,9 @@ static const struct adsp_desc hikey_dsp_desc = { .num_io = ARRAY_SIZE(hikey_io), .io_dev = hikey_io, + + .iram_base = ADSP_HIKEY_HOST_RUN_ITCM_BASE, + .dram_base = ADSP_HIKEY_HOST_RUN_DTCM_BASE, }; static void hikey_adsp_init(MachineState *machine) From aba78973b1e6e42bc42937880d535f9d7d0ced87 Mon Sep 17 00:00:00 2001 From: John Gunn Date: Thu, 25 Apr 2019 23:01:46 +0100 Subject: [PATCH 2/2] adsp: common: simple file parser needs to increment block on error. Simple file parser does not increment block when it detects an error in the current block. Make sure block is always incremented. Signed-off-by: John Gunn --- hw/adsp/dsp/common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/adsp/dsp/common.c b/hw/adsp/dsp/common.c index 19b2279cb84ab..2d628fe24b551 100644 --- a/hw/adsp/dsp/common.c +++ b/hw/adsp/dsp/common.c @@ -175,7 +175,7 @@ static int sof_module_memcpy(struct adsp_dev *adsp, mem = adsp_get_mem_space(adsp, board->iram_base + block->offset - board->host_iram_offset); if (!mem) - continue; + goto next; memcpy(mem->ptr + block->offset - board->host_iram_offset, (void *)block + sizeof(*block), block->size); break; @@ -186,7 +186,7 @@ static int sof_module_memcpy(struct adsp_dev *adsp, mem = adsp_get_mem_space(adsp, board->dram_base + block->offset - board->host_dram_offset); if (!mem) - continue; + goto next; memcpy(mem->ptr + block->offset - board->host_dram_offset, (void *)block + sizeof(*block), block->size); break; @@ -200,7 +200,7 @@ static int sof_module_memcpy(struct adsp_dev *adsp, "block %d type 0x%x size 0x%x ==> offset 0x%x\n", count, block->type, block->size, block->offset); - +next: /* next block */ block = (void *)block + sizeof(*block) + block->size; }