From 7789baaf337bf0447b74bb58fdd6c03692569e06 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 12 Jul 2021 17:51:26 +0200 Subject: [PATCH] zephyr: fix memory allocation coherency Commit 34bb9b728268 ("zephyr: wrapper: build SOF with Zephyr for imx") broke coherent memory allocations on Intel DSP platforms. Restore the original code. Signed-off-by: Guennadi Liakhovetski --- zephyr/wrapper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zephyr/wrapper.c b/zephyr/wrapper.c index 55f3f7e17210..25858f46b570 100644 --- a/zephyr/wrapper.c +++ b/zephyr/wrapper.c @@ -151,10 +151,12 @@ void *rmalloc(enum mem_zone zone, uint32_t flags, uint32_t caps, size_t bytes) { if (zone_is_cached(zone)) return heap_alloc_aligned_cached(&sof_heap, 0, bytes); - else - return heap_alloc_aligned(&sof_heap, 8, bytes); +#ifdef CONFIG_IMX + return heap_alloc_aligned(&sof_heap, 8, bytes); +#else return heap_alloc_aligned(&sof_heap_shared, 8, bytes); +#endif } /* Use SOF_MEM_ZONE_BUFFER at the moment */