Skip to content

Commit 5cf6f9c

Browse files
lyakhlgirdwood
authored andcommitted
heap: simplify heap size calculation
Fixes two issues: 1. remove confusingly named CONFIG_SOF_ZEPHYR_VIRTUAL_HEAP_SIZE since it isn't used for virtual heap but for a traditional one - not using run-time memory mapping. 2. instead of adding CONFIG_SOF_ZEPHYR_VIRTUAL_HEAP_SIZE switch back to using CONFIG_SOF_ZEPHYR_HEAP_SIZE also when CONFIG_VIRTUAL_HEAP is selected by just adjusting its value. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 1abeaa2 commit 5cf6f9c

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

zephyr/Kconfig

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ config SOF_ZEPHYR_HEAP_CACHED
4848

4949
config SOF_ZEPHYR_HEAP_SIZE
5050
hex "Size of the Zephyr heap for SOF"
51+
default 0x40000 if VIRTUAL_HEAP
5152
default 0xF0000 if SOC_ACE15_MTPM || SOC_ACE20_LNL
5253
default 0xD0000 if SOC_ACE30 || SOC_ACE40
5354
default 0x0
@@ -81,15 +82,6 @@ config SOF_ZEPHYR_SHARED_BUFFER_HEAP_SIZE
8182
NOTE: Keep in mind that the shared heap size should not be greater than the
8283
heap size.
8384

84-
config SOF_ZEPHYR_VIRTUAL_HEAP_SIZE
85-
hex "Size of the Zephyr virtual heap for SOF"
86-
depends on VIRTUAL_HEAP
87-
default 0x40000
88-
help
89-
Support scaling of the virtual address heap size for different platforms.
90-
NOTE: Keep in mind that the heap size should not be greater than the physical
91-
memory size of the system defined in DT (and this includes baseFW text/data).
92-
9385
config SOF_ZEPHYR_VIRTUAL_HEAP_REGION_SIZE
9486
hex "Size in bytes of virtual memory region for virtual heap shared for all cores"
9587
depends on MM_DRV_INTEL_ADSP_MTL_TLB

zephyr/lib/alloc.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929

3030
struct vmh_heap;
3131
struct vmh_heap *virtual_buffers_heap;
32-
33-
#undef HEAPMEM_SIZE
34-
/* Buffers are allocated from virtual space so we can safely reduce the heap size.
35-
*/
36-
#define HEAPMEM_SIZE CONFIG_SOF_ZEPHYR_VIRTUAL_HEAP_SIZE
3732
#endif /* CONFIG_VIRTUAL_HEAP */
3833

3934

0 commit comments

Comments
 (0)