Skip to content

Commit ab1f9aa

Browse files
Hubert Miśkarstenkoenig
authored andcommitted
[nrf fromtree] 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. Signed-off-by: Hubert Miś <[email protected]> (cherry picked from commit dab6c733e30f7d3644d36eadb421a6f7fc9e515e)
1 parent 942ee1b commit ab1f9aa

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)