Skip to content

Commit 6b17ab4

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 <guennadi.liakhovetski@linux.intel.com>
1 parent 8fa754f commit 6b17ab4

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
@@ -395,7 +395,9 @@ void scheduler_dp_domain_free(struct processing_module *pmod)
395395
struct task_dp_pdata *pdata = pmod->dev->task->priv_data;
396396

397397
k_mem_domain_remove_partition(dp_mdom + core, pdata->mpart + SOF_DP_PART_HEAP);
398+
k_mem_domain_remove_partition(dp_mdom + core, pdata->mpart + SOF_DP_PART_HEAP_CACHE);
398399
k_mem_domain_remove_partition(dp_mdom + core, pdata->mpart + SOF_DP_PART_CFG);
400+
k_mem_domain_remove_partition(dp_mdom + core, pdata->mpart + SOF_DP_PART_CFG_CACHE);
399401
#endif
400402
}
401403

@@ -518,12 +520,22 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
518520
.size = size,
519521
.attr = K_MEM_PARTITION_P_RW_U_RW,
520522
};
523+
pdata->mpart[SOF_DP_PART_HEAP_CACHE] = (struct k_mem_partition){
524+
.start = (uintptr_t)sys_cache_cached_ptr_get((void *)start),
525+
.size = size,
526+
.attr = K_MEM_PARTITION_P_RW_U_RW | XTENSA_MMU_CACHED_WB,
527+
};
521528
/* Host mailbox partition for additional IPC parameters: read-only */
522529
pdata->mpart[SOF_DP_PART_CFG] = (struct k_mem_partition){
523-
.start = (uintptr_t)MAILBOX_HOSTBOX_BASE,
530+
.start = (uintptr_t)sys_cache_uncached_ptr_get((void *)MAILBOX_HOSTBOX_BASE),
524531
.size = 4096,
525532
.attr = K_MEM_PARTITION_P_RO_U_RO,
526533
};
534+
pdata->mpart[SOF_DP_PART_CFG_CACHE] = (struct k_mem_partition){
535+
.start = (uintptr_t)MAILBOX_HOSTBOX_BASE,
536+
.size = 4096,
537+
.attr = K_MEM_PARTITION_P_RO_U_RO | XTENSA_MMU_CACHED_WB,
538+
};
527539

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

0 commit comments

Comments
 (0)