|
|
|
@ -15,7 +15,7 @@
@@ -15,7 +15,7 @@
|
|
|
|
|
#include <zephyr/toolchain.h> |
|
|
|
|
|
|
|
|
|
#include <hal/nrf_vpr.h> |
|
|
|
|
#if defined(CONFIG_SOC_NRF54L_CPUAPP_COMMON) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) |
|
|
|
|
#if DT_ANY_INST_HAS_BOOL_STATUS_OKAY(enable_secure) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) |
|
|
|
|
#include <hal/nrf_spu.h> |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -24,6 +24,7 @@ LOG_MODULE_REGISTER(nordic_vpr_launcher, CONFIG_NORDIC_VPR_LAUNCHER_LOG_LEVEL);
@@ -24,6 +24,7 @@ LOG_MODULE_REGISTER(nordic_vpr_launcher, CONFIG_NORDIC_VPR_LAUNCHER_LOG_LEVEL);
|
|
|
|
|
struct nordic_vpr_launcher_config { |
|
|
|
|
NRF_VPR_Type *vpr; |
|
|
|
|
uintptr_t exec_addr; |
|
|
|
|
bool enable_secure; |
|
|
|
|
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(source_memory) |
|
|
|
|
uintptr_t src_addr; |
|
|
|
|
size_t size; |
|
|
|
@ -52,9 +53,12 @@ static int nordic_vpr_launcher_init(const struct device *dev)
@@ -52,9 +53,12 @@ static int nordic_vpr_launcher_init(const struct device *dev)
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if defined(CONFIG_SOC_NRF54L_CPUAPP_COMMON) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) |
|
|
|
|
nrf_spu_periph_perm_secattr_set(NRF_SPU00, nrf_address_slave_get((uint32_t)config->vpr), |
|
|
|
|
true); |
|
|
|
|
#if DT_ANY_INST_HAS_BOOL_STATUS_OKAY(enable_secure) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) |
|
|
|
|
if (config->enable_secure) { |
|
|
|
|
nrf_spu_periph_perm_secattr_set(NRF_SPU00, |
|
|
|
|
nrf_address_slave_get((uint32_t)config->vpr), |
|
|
|
|
true); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
LOG_DBG("Launching VPR (%p) from %p", config->vpr, (void *)config->exec_addr); |
|
|
|
|
nrf_vpr_initpc_set(config->vpr, config->exec_addr); |
|
|
|
@ -81,6 +85,7 @@ static int nordic_vpr_launcher_init(const struct device *dev)
@@ -81,6 +85,7 @@ static int nordic_vpr_launcher_init(const struct device *dev)
|
|
|
|
|
.vpr = (NRF_VPR_Type *)DT_INST_REG_ADDR(inst), \ |
|
|
|
|
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, execution_memory), \ |
|
|
|
|
(.exec_addr = VPR_ADDR(DT_INST_PHANDLE(inst, execution_memory)),)) \ |
|
|
|
|
.enable_secure = DT_INST_PROP(inst, enable_secure), \ |
|
|
|
|
IF_ENABLED(NEEDS_COPYING(inst), \ |
|
|
|
|
(.src_addr = VPR_ADDR(DT_INST_PHANDLE(inst, source_memory)), \ |
|
|
|
|
.size = DT_REG_SIZE(DT_INST_PHANDLE(inst, execution_memory)),))}; \ |
|
|
|
|