Skip to content

Commit b3adea5

Browse files
ananglcarlescufi
authored andcommitted
[nrf fromtree] dts: bindings: nrf-vpr: Allow specifying pins and not using launcher
Add possibility to use pinctrl to configure pins that should be assigned to nRF VPR coprocessors and also provide a way of preventing activation of the nordic_vpr_launcher driver for an enabled VPR so that it can be supplied with the code to execute and launched in a custom way. Signed-off-by: Andrzej Głąbek <[email protected]> (cherry picked from commit 54d8c80)
1 parent eacfed3 commit b3adea5

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

drivers/misc/nordic_vpr_launcher/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
config NORDIC_VPR_LAUNCHER
55
bool "Nordic VPR coprocessor launcher"
66
default y
7-
depends on DT_HAS_NORDIC_NRF_VPR_COPROCESSOR_ENABLED
7+
depends on DT_HAS_NORDIC_NRF_VPR_COPROCESSOR_ENABLED && \
8+
$(dt_compat_any_has_prop,$(DT_COMPAT_NORDIC_NRF_VPR_COPROCESSOR),execution-memory)
89
help
910
When enabled, the VPR coprocessors will be automatically launched
1011
during system initialization.

drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ static int nordic_vpr_launcher_init(const struct device *dev)
3434
{
3535
const struct nordic_vpr_launcher_config *config = dev->config;
3636

37+
/* Do nothing if execution memory is not specified for a given VPR. */
38+
if (config->exec_addr == 0) {
39+
return 0;
40+
}
41+
3742
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(source_memory)
3843
if (config->size > 0U) {
3944
LOG_DBG("Loading VPR (%p) from %p to %p (%zu bytes)", config->vpr,
@@ -63,16 +68,20 @@ static int nordic_vpr_launcher_init(const struct device *dev)
6368
(DT_REG_ADDR(node_id) + \
6469
COND_CODE_0(DT_FIXED_PARTITION_EXISTS(node_id), (0), (DT_REG_ADDR(DT_GPARENT(node_id)))))
6570

71+
#define NEEDS_COPYING(inst) UTIL_AND(DT_INST_NODE_HAS_PROP(inst, execution_memory), \
72+
DT_INST_NODE_HAS_PROP(inst, source_memory))
73+
6674
#define NORDIC_VPR_LAUNCHER_DEFINE(inst) \
67-
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, source_memory), \
75+
IF_ENABLED(NEEDS_COPYING(inst), \
6876
(BUILD_ASSERT((DT_REG_SIZE(DT_INST_PHANDLE(inst, execution_memory)) <= \
6977
DT_REG_SIZE(DT_INST_PHANDLE(inst, source_memory))), \
7078
"Execution memory exceeds source memory size");)) \
7179
\
7280
static const struct nordic_vpr_launcher_config config##inst = { \
7381
.vpr = (NRF_VPR_Type *)DT_INST_REG_ADDR(inst), \
74-
.exec_addr = VPR_ADDR(DT_INST_PHANDLE(inst, execution_memory)), \
75-
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, source_memory), \
82+
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, execution_memory), \
83+
(.exec_addr = VPR_ADDR(DT_INST_PHANDLE(inst, execution_memory)),)) \
84+
IF_ENABLED(NEEDS_COPYING(inst), \
7685
(.src_addr = VPR_ADDR(DT_INST_PHANDLE(inst, source_memory)), \
7786
.size = DT_REG_SIZE(DT_INST_PHANDLE(inst, execution_memory)),))}; \
7887
\

dts/bindings/riscv/nordic,nrf-vpr-coprocessor.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ description: |
99
VPR is a RISC-V CPU implementation. VPR instances are exposed to other CPUs as
1010
peripherals.
1111
12-
include: base.yaml
12+
include: [base.yaml, pinctrl-device.yaml]
1313

1414
properties:
1515
execution-memory:
1616
type: phandle
17-
required: true
1817
description: |
19-
Memory area from which the VPR core will execute.
18+
Memory area from which the VPR code will execute.
19+
If not specified, the VPR coprocessor will not be launched automatically
20+
by the nordic_vpr_launcher driver when the node is enabled. In such case,
21+
the launching is supposed to be done explicitly by the user code, in some
22+
custom way presumably.
2023
2124
source-memory:
2225
type: phandle

0 commit comments

Comments
 (0)