From 692cae92a1ee2975169109b33b9de400c9d78387 Mon Sep 17 00:00:00 2001 From: Rafal Redzimski Date: Thu, 10 Mar 2022 16:56:40 +0100 Subject: [PATCH 1/2] zephyr: correct the idc payload initialization For zephyr case remove the dynamic allocation of per-core idc elements since these are already statically allocated in a form of idc array in zephyr/wrapper.c. The payload pointer initialization need to use idc entries which are returned by the get_idc() call. Signed-off-by: Rafal Redzimski --- src/idc/idc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/idc/idc.c b/src/idc/idc.c index f23acf3a5f39..ba179c6d00a9 100644 --- a/src/idc/idc.c +++ b/src/idc/idc.c @@ -342,12 +342,13 @@ int idc_init(void) .get_deadline = ipc_task_deadline, .complete = idc_complete, }; + + *idc = rzalloc(SOF_MEM_ZONE_SYS, 0, SOF_MEM_CAPS_RAM, sizeof(**idc)); #endif tr_info(&idc_tr, "idc_init()"); /* initialize idc data */ - *idc = rzalloc(SOF_MEM_ZONE_SYS, 0, SOF_MEM_CAPS_RAM, sizeof(**idc)); (*idc)->payload = platform_shared_get(static_payload, sizeof(static_payload)); /* process task */ From 3edb29471864b5e63c98844cfcda95684e0fea78 Mon Sep 17 00:00:00 2001 From: Rafal Redzimski Date: Mon, 21 Mar 2022 12:41:51 +0100 Subject: [PATCH 2/2] idc: modify idc payload size and align to cache line size Modify IDC payload size to be cache aligned and have size of 2 cache lines. Signed-off-by: Rafal Redzimski Signed-off-by: Liam Girdwood --- src/include/sof/drivers/idc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/sof/drivers/idc.h b/src/include/sof/drivers/idc.h index 1c078b826519..a743141db7a1 100644 --- a/src/include/sof/drivers/idc.h +++ b/src/include/sof/drivers/idc.h @@ -20,6 +20,7 @@ #include #include #include +#include /** \brief IDC send blocking flag. */ #define IDC_BLOCKING 0 @@ -96,7 +97,7 @@ #define iTS(x) (((x) >> IDC_TYPE_SHIFT) & IDC_TYPE_MASK) /** \brief Max IDC message payload size in bytes. */ -#define IDC_MAX_PAYLOAD_SIZE 96 +#define IDC_MAX_PAYLOAD_SIZE (DCACHE_LINE_SIZE * 2) /** \brief IDC free function flags */ #define IDC_FREE_IRQ_ONLY BIT(0) /**< disable only irqs */