From 45e3a772ac6e6bef8f4f5b2036498492c6569837 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 7 Oct 2021 09:59:53 +0200 Subject: [PATCH 1/2] zephyr: further reduce the size of heap on APL with XCC Building SOF with Zephyr for Apollolake with XCC fails because of insufficient RAM. Reduce the heap size to fix the problem. Signed-off-by: Guennadi Liakhovetski --- zephyr/wrapper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zephyr/wrapper.c b/zephyr/wrapper.c index 1bbe36fd025a..c630b7c6500b 100644 --- a/zephyr/wrapper.c +++ b/zephyr/wrapper.c @@ -80,7 +80,11 @@ __section(".heap_mem") static uint8_t __aligned(64) heapmem[HEAPMEM_SIZE]; */ #if (CONFIG_HP_MEMORY_BANKS < 16) /* e.g. APL */ +#if defined __XCC__ +#define HEAP_SIZE 0x28000 +#else #define HEAP_SIZE 0x30000 +#endif #elif (CONFIG_HP_MEMORY_BANKS < 30) /* e.g. JSL */ #define HEAP_SIZE 0x80000 From d50bef36eb80a03029edbcf008526dcff0f91f23 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 7 Oct 2021 10:10:18 +0200 Subject: [PATCH 2/2] zephyr: apl: re-enable building with XCC Zephyr XCC builds for Apollolake can be re-enabled now after the RAM footprint has been reduced. Signed-off-by: Guennadi Liakhovetski --- scripts/xtensa-build-zephyr.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/xtensa-build-zephyr.sh b/scripts/xtensa-build-zephyr.sh index 3b24c087e674..3b09cba0c940 100755 --- a/scripts/xtensa-build-zephyr.sh +++ b/scripts/xtensa-build-zephyr.sh @@ -150,11 +150,8 @@ build_all() case "$platform" in apl) PLAT_CONFIG='intel_adsp_cavs15' - # XCC build runs out of memory, tracked as - # https://github.com/thesofproject/sof/issues/4645 - unset XTENSA_TOOLS_ROOT - #XTENSA_CORE="X4H3I16w2D48w3a_2017_8" - #XTENSA_TOOLS_VERSION="RG-2017.8-linux" + XTENSA_CORE="X4H3I16w2D48w3a_2017_8" + XTENSA_TOOLS_VERSION="RG-2017.8-linux" ;; cnl) PLAT_CONFIG='intel_adsp_cavs18'