Skip to content

Commit 6798c8d

Browse files
author
Hubert Miś
committed
[nrf fromlist] drv: nordic_vpr_launcher: manage data cache
Write-back cache after copying VPR's code and data to the destination memory. It allows VPRs to run from RAM regions cacheable by its host. It allows to use FLPR in nRF54H20. Upstream PR #: 84104 Signed-off-by: Hubert Miś <[email protected]>
1 parent 52a1cee commit 6798c8d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <string.h>
99

10+
#include <zephyr/cache.h>
1011
#include <zephyr/devicetree.h>
1112
#include <zephyr/init.h>
1213
#include <zephyr/logging/log.h>
@@ -38,6 +39,11 @@ static int nordic_vpr_launcher_init(const struct device *dev)
3839
LOG_DBG("Loading VPR (%p) from %p to %p (%zu bytes)", config->vpr,
3940
(void *)config->src_addr, (void *)config->exec_addr, config->size);
4041
memcpy((void *)config->exec_addr, (void *)config->src_addr, config->size);
42+
#if defined(CONFIG_DCACHE)
43+
LOG_DBG("Writing back cache with loaded VPR (from %p %zu bytes)",
44+
(void *)config->exec_addr, config->size);
45+
sys_cache_data_flush_range((void *)config->exec_addr, config->size);
46+
#endif
4147
}
4248
#endif
4349

0 commit comments

Comments
 (0)