Skip to content

Commit

Permalink
[nrf fromlist] drv: nordic_vpr_launcher: manage data cache
Browse files Browse the repository at this point in the history
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ś <hubert.mis@nordicsemi.no>
  • Loading branch information
hubertmis authored and carlescufi committed Jan 20, 2025
1 parent 20a2ba2 commit 185906a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <string.h>

#include <zephyr/cache.h>
#include <zephyr/devicetree.h>
#include <zephyr/init.h>
#include <zephyr/logging/log.h>
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 185906a

Please sign in to comment.