Skip to content

Commit 99663a4

Browse files
committed
dp: application: restore double mapping for userspace
Since Zephyr has removed double mapping per Kconfig switch we need to restore it in SOF. Next we should try to optimize mappings to only use the ones we really need. Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent e19293c commit 99663a4

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/schedule/zephyr_dp_schedule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ struct scheduler_dp_data {
2525

2626
enum sof_dp_part_type {
2727
SOF_DP_PART_HEAP,
28+
SOF_DP_PART_HEAP_CACHE,
2829
SOF_DP_PART_CFG,
30+
SOF_DP_PART_CFG_CACHE,
2931
SOF_DP_PART_TYPE_COUNT,
3032
};
3133

src/schedule/zephyr_dp_schedule_application.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ void scheduler_dp_domain_free(struct processing_module *pmod)
391391
struct task_dp_pdata *pdata = pmod->dev->task->priv_data;
392392

393393
k_mem_domain_remove_partition(dp_mdom + core, pdata->mpart + SOF_DP_PART_HEAP);
394+
k_mem_domain_remove_partition(dp_mdom + core, pdata->mpart + SOF_DP_PART_HEAP_CACHE);
394395
k_mem_domain_remove_partition(dp_mdom + core, pdata->mpart + SOF_DP_PART_CFG);
396+
k_mem_domain_remove_partition(dp_mdom + core, pdata->mpart + SOF_DP_PART_CFG_CACHE);
395397
}
396398

397399
/* Called only in IPC context */
@@ -505,12 +507,22 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
505507
.size = size,
506508
.attr = K_MEM_PARTITION_P_RW_U_RW,
507509
};
510+
pdata->mpart[SOF_DP_PART_HEAP_CACHE] = (struct k_mem_partition){
511+
.start = (uintptr_t)sys_cache_cached_ptr_get((void *)start),
512+
.size = size,
513+
.attr = K_MEM_PARTITION_P_RW_U_RW | XTENSA_MMU_CACHED_WB,
514+
};
508515
/* Host mailbox partition for additional IPC parameters: read-only */
509516
pdata->mpart[SOF_DP_PART_CFG] = (struct k_mem_partition){
510-
.start = (uintptr_t)MAILBOX_HOSTBOX_BASE,
517+
.start = (uintptr_t)sys_cache_uncached_ptr_get((void *)MAILBOX_HOSTBOX_BASE),
511518
.size = 4096,
512519
.attr = K_MEM_PARTITION_P_RO_U_RO,
513520
};
521+
pdata->mpart[SOF_DP_PART_CFG_CACHE] = (struct k_mem_partition){
522+
.start = (uintptr_t)MAILBOX_HOSTBOX_BASE,
523+
.size = 4096,
524+
.attr = K_MEM_PARTITION_P_RO_U_RO | XTENSA_MMU_CACHED_WB,
525+
};
514526

515527
for (pidx = 0; pidx < SOF_DP_PART_TYPE_COUNT; pidx++) {
516528
ret = k_mem_domain_add_partition(dp_mdom + core, pdata->mpart + pidx);

0 commit comments

Comments
 (0)