diff --git a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c index aaf3f0d4474..bf7462c5e05 100644 --- a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c +++ b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c @@ -15,7 +15,9 @@ #include #include -#if DT_ANY_INST_HAS_BOOL_STATUS_OKAY(enable_secure) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#if (DT_ANY_INST_HAS_BOOL_STATUS_OKAY(enable_secure) || \ + DT_ANY_INST_HAS_BOOL_STATUS_OKAY(enable_dma_secure)) && \ + !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) #include #endif @@ -25,6 +27,7 @@ struct nordic_vpr_launcher_config { NRF_VPR_Type *vpr; uintptr_t exec_addr; bool enable_secure; + bool enable_dma_secure; #if DT_ANY_INST_HAS_PROP_STATUS_OKAY(source_memory) uintptr_t src_addr; size_t size; @@ -53,12 +56,21 @@ static int nordic_vpr_launcher_init(const struct device *dev) } #endif -#if DT_ANY_INST_HAS_BOOL_STATUS_OKAY(enable_secure) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#if DT_ANY_INST_HAS_BOOL_STATUS_OKAY(enable_secure) if (config->enable_secure) { nrf_spu_periph_perm_secattr_set(NRF_SPU00, nrf_address_slave_get((uint32_t)config->vpr), true); } +#endif +#if DT_ANY_INST_HAS_BOOL_STATUS_OKAY(enable_dma_secure) + if (config->enable_dma_secure) { + nrf_spu_periph_perm_dmasec_set(NRF_SPU00, + nrf_address_slave_get((uint32_t)config->vpr), + true); + } +#endif #endif LOG_DBG("Launching VPR (%p) from %p", config->vpr, (void *)config->exec_addr); nrf_vpr_initpc_set(config->vpr, config->exec_addr); @@ -86,6 +98,7 @@ static int nordic_vpr_launcher_init(const struct device *dev) 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), \ + .enable_dma_secure = DT_INST_PROP(inst, enable_dma_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)),))}; \ diff --git a/dts/bindings/riscv/nordic,nrf-vpr-coprocessor.yaml b/dts/bindings/riscv/nordic,nrf-vpr-coprocessor.yaml index f204d1679a4..016675dbf01 100644 --- a/dts/bindings/riscv/nordic,nrf-vpr-coprocessor.yaml +++ b/dts/bindings/riscv/nordic,nrf-vpr-coprocessor.yaml @@ -30,3 +30,8 @@ properties: type: boolean description: | Enables setting VPR core's secure attribute to secure. + + enable-dma-secure: + type: boolean + description: | + Enables setting VPR core's DMA secure attribute to secure.