[Sound-open-firmware] [PATCH] BYT memory: Fix calculation of HEAP_BUFFER_SIZE

Seppo Ingalsuo seppo.ingalsuo at linux.intel.com
Wed Feb 21 17:09:15 CET 2018


This patch fixes the overlap between heap buffer and stack. The macro
for calculation missed the data size that caused heap to become too large.
Compilation of sof with xt-xcc triggers this issue in rimage and causes
image build fail.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo at linux.intel.com>
---
 src/platform/baytrail/include/platform/memory.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/platform/baytrail/include/platform/memory.h b/src/platform/baytrail/include/platform/memory.h
index c6a1301..082592c 100644
--- a/src/platform/baytrail/include/platform/memory.h
+++ b/src/platform/baytrail/include/platform/memory.h
@@ -122,8 +122,9 @@
 	HEAP_RT_COUNT512 * 512 + HEAP_RT_COUNT1024 * 1024)
 
 #define HEAP_BUFFER_BASE		(HEAP_RUNTIME_BASE + HEAP_RUNTIME_SIZE)
-#define HEAP_BUFFER_SIZE	\
-    (DRAM0_SIZE - HEAP_RUNTIME_SIZE - REEF_STACK_SIZE - HEAP_SYSTEM_SIZE)
+#define HEAP_BUFFER_SIZE \
+	(DRAM0_SIZE - HEAP_RUNTIME_SIZE - REEF_STACK_SIZE -\
+	HEAP_SYSTEM_SIZE - REEF_DATA_SIZE)
 
 #define HEAP_BUFFER_BLOCK_SIZE		0x180
 #define HEAP_BUFFER_COUNT	(HEAP_BUFFER_SIZE / HEAP_BUFFER_BLOCK_SIZE)
-- 
2.14.1



More information about the Sound-open-firmware mailing list