Skip to content

Commit a1af7ff

Browse files
authored
Merge pull request #219 from tlauda/topic/memory_cache_line_align
cavs: memory: align runtime heap buffers to cache lines
2 parents 2ed30b5 + 512de60 commit a1af7ff

3 files changed

Lines changed: 4 additions & 14 deletions

File tree

src/platform/apollolake/include/platform/memory.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@
132132
#define L2_SRAM_SIZE 0x00056000
133133

134134
/* Heap section sizes for module pool */
135-
#define HEAP_RT_COUNT16 256
136-
#define HEAP_RT_COUNT32 128
137-
#define HEAP_RT_COUNT64 64
135+
#define HEAP_RT_COUNT64 256
138136
#define HEAP_RT_COUNT128 32
139137
#define HEAP_RT_COUNT256 64
140138
#define HEAP_RT_COUNT512 32
@@ -149,8 +147,7 @@
149147

150148
#define HEAP_RUNTIME_BASE (HEAP_SYSTEM_BASE + HEAP_SYSTEM_SIZE)
151149
#define HEAP_RUNTIME_SIZE \
152-
(HEAP_RT_COUNT16 * 16 + HEAP_RT_COUNT32 * 32 + \
153-
HEAP_RT_COUNT64 * 64 + HEAP_RT_COUNT128 * 128 + \
150+
(HEAP_RT_COUNT64 * 64 + HEAP_RT_COUNT128 * 128 + \
154151
HEAP_RT_COUNT256 * 256 + HEAP_RT_COUNT512 * 512)
155152

156153
#define HEAP_BUFFER_BASE (HEAP_RUNTIME_BASE + HEAP_RUNTIME_SIZE)

src/platform/cannonlake/include/platform/memory.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@
169169
#define HP_SRAM_VECBASE_RESET (HP_SRAM_BASE + 0x40000)
170170

171171
/* Heap section sizes for module pool */
172-
#define HEAP_RT_COUNT16 256
173-
#define HEAP_RT_COUNT32 128
174-
#define HEAP_RT_COUNT64 64
172+
#define HEAP_RT_COUNT64 256
175173
#define HEAP_RT_COUNT128 32
176174
#define HEAP_RT_COUNT256 64
177175
#define HEAP_RT_COUNT512 32
@@ -249,8 +247,7 @@
249247

250248
#define HEAP_RUNTIME_BASE (HEAP_SYSTEM_BASE + HEAP_SYSTEM_SIZE)
251249
#define HEAP_RUNTIME_SIZE \
252-
(HEAP_RT_COUNT16 * 16 + HEAP_RT_COUNT32 * 32 + \
253-
HEAP_RT_COUNT64 * 64 + HEAP_RT_COUNT128 * 128 + \
250+
(HEAP_RT_COUNT64 * 64 + HEAP_RT_COUNT128 * 128 + \
254251
HEAP_RT_COUNT256 * 256 + HEAP_RT_COUNT512 * 512)
255252

256253
/* Stack configuration */

src/platform/intel/cavs/memory.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,13 @@
3232
#include <sof/alloc.h>
3333

3434
/* Heap blocks for modules */
35-
static struct block_hdr mod_block16[HEAP_RT_COUNT16];
36-
static struct block_hdr mod_block32[HEAP_RT_COUNT32];
3735
static struct block_hdr mod_block64[HEAP_RT_COUNT64];
3836
static struct block_hdr mod_block128[HEAP_RT_COUNT128];
3937
static struct block_hdr mod_block256[HEAP_RT_COUNT256];
4038
static struct block_hdr mod_block512[HEAP_RT_COUNT512];
4139

4240
/* Heap memory map for modules */
4341
static struct block_map rt_heap_map[] = {
44-
BLOCK_DEF(16, HEAP_RT_COUNT16, mod_block16),
45-
BLOCK_DEF(32, HEAP_RT_COUNT32, mod_block32),
4642
BLOCK_DEF(64, HEAP_RT_COUNT64, mod_block64),
4743
BLOCK_DEF(128, HEAP_RT_COUNT128, mod_block128),
4844
BLOCK_DEF(256, HEAP_RT_COUNT256, mod_block256),

0 commit comments

Comments
 (0)