Skip to content

Commit 4f14fb0

Browse files
lrgirdwolgirdwood
authored andcommitted
kconfig: heap: Add Kconfig option to set heap size.
Allow the developer to set the maximum heap size so that power savings can be made when full memory is not required for device use cases. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 97fbd99 commit 4f14fb0

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

src/platform/ace30/include/platform/lib/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
/**
5555
* size of HPSRAM system heap
5656
*/
57-
#define HEAPMEM_SIZE 0xD0000
57+
#define HEAPMEM_SIZE CONFIG_SOF_ZEPHYR_HEAP_SIZE
5858

5959
#if CONFIG_COLD_STORE_EXECUTE_DRAM && \
6060
(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD))

src/platform/lunarlake/include/platform/lib/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
/**
5757
* size of HPSRAM system heap
5858
*/
59-
#define HEAPMEM_SIZE 0xF0000
59+
#define HEAPMEM_SIZE CONFIG_SOF_ZEPHYR_HEAP_SIZE
6060

6161
#if CONFIG_COLD_STORE_EXECUTE_DRAM && \
6262
(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD))

src/platform/meteorlake/include/platform/lib/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
/**
5757
* size of HPSRAM system heap
5858
*/
59-
#define HEAPMEM_SIZE 0xF0000
59+
#define HEAPMEM_SIZE CONFIG_SOF_ZEPHYR_HEAP_SIZE
6060

6161
#if CONFIG_COLD_STORE_EXECUTE_DRAM && \
6262
(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD))

zephyr/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ config SOF_ZEPHYR_HEAP_CACHED
1919
Enable cached heap by mapping cached SOF memory zones to different
2020
Zephyr sys_heap objects and enable caching for non-shared zones.
2121

22+
config SOF_ZEPHYR_HEAP_SIZE
23+
hex "Size of the Zephyr heap for SOF"
24+
default 0xF0000 if SOC_INTEL_ACE15_MTPM || SOC_INTEL_ACE20_LNL
25+
default 0xD0000 if SOC_INTEL_ACE30
26+
default 0x0
27+
help
28+
Support scaling of the heap size for different platforms and different types
29+
of heaps. This is the default heap size for most users.
30+
TODO: Currently this setting is only available on platforms with a
31+
simplified heap size configuration. i.e. a single macro that defines the
32+
heap size. This is not the case for all platforms.
33+
NOTE: Keep in mind that the heap size should not be greater than the physical
34+
memory size of the system defined in DT (and this includes baseFW text/data).
35+
2236
config ZEPHYR_NATIVE_DRIVERS
2337
bool "Use Zephyr native drivers"
2438
default n

0 commit comments

Comments
 (0)