From 6798c8df0fbe8fa5297d2a2a8921438c7462bbd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Mi=C5=9B?= Date: Thu, 16 Jan 2025 17:23:27 +0100 Subject: [PATCH] [nrf fromlist] drv: nordic_vpr_launcher: manage data cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ś --- drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c index 2c2915a7984..5bd43f87fb9 100644 --- a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c +++ b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c @@ -7,6 +7,7 @@ #include +#include #include #include #include @@ -38,6 +39,11 @@ static int nordic_vpr_launcher_init(const struct device *dev) LOG_DBG("Loading VPR (%p) from %p to %p (%zu bytes)", config->vpr, (void *)config->src_addr, (void *)config->exec_addr, config->size); memcpy((void *)config->exec_addr, (void *)config->src_addr, config->size); +#if defined(CONFIG_DCACHE) + LOG_DBG("Writing back cache with loaded VPR (from %p %zu bytes)", + (void *)config->exec_addr, config->size); + sys_cache_data_flush_range((void *)config->exec_addr, config->size); +#endif } #endif