Skip to content

Commit 4b7ada0

Browse files
adamkondraciukjfischer-no
authored andcommitted
[nrf fromlist] modules: hal_nordic: nrfx: Use owned-channels property for DPPIC
The `owned-channels` property specifies which channels are assigned to a given target. Additionally, the `source-channels` or `sink-channels` property defines channels that can be used to forward an event outside the DPPI domain, otherwise they can only be used within it. Upstream PR #: 85853 Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no> (cherry picked from commit cfc35c9)
1 parent b212602 commit 4b7ada0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

modules/hal_nordic/nrfx/nrfx_zephyr_utils.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,22 @@
3434
* definitions required by the interconnect/apb layer:
3535
* - NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
3636
* - NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
37-
* - NRFX_DPPI_PUB_OR_SUB_MASK(inst_num)
37+
* - NRFX_DPPI_OWNED_MASK(inst_num)
3838
* - NRFX_DPPI_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num)
3939
* - NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE
4040
* - NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE
4141
* based on information from devicetree.
4242
*/
4343
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || \
4444
DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_local)
45+
46+
/* Channels masks generation. */
47+
#define NRFX_CONFIG_DPPI_MASK_DT(node_id) \
48+
COND_CODE_1(DT_NODE_HAS_PROP(node_id, owned_channels), \
49+
(NRFX_CONFIG_MASK_DT(node_id, owned_channels)), \
50+
(COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, nordic_nrf_dppic_local), \
51+
(BIT64_MASK(DT_PROP(node_id, channels))), (0))))
52+
4553
/* Source (publish) channels masks generation. */
4654
#define NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
4755
NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels)
@@ -50,9 +58,9 @@
5058
#define NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
5159
NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels)
5260

53-
#define NRFX_DPPI_PUB_OR_SUB_MASK(inst_num) \
54-
UTIL_OR(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels), \
55-
DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels))
61+
#define NRFX_DPPI_OWNED_MASK(inst_num) \
62+
UTIL_OR(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), owned_channels), \
63+
DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), channels))
5664

5765
/* Variables names generation. */
5866
#define NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) _CONCAT(_CONCAT(m_, node_id), _channels)
@@ -62,9 +70,7 @@
6270
/* Variables entries generation. */
6371
#define NRFX_CONFIG_DPPI_CHANNELS_ENTRY(node_id) \
6472
static nrfx_atomic_t NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) \
65-
__attribute__((used)) = \
66-
NRFX_CONFIG_MASK_DT(node_id, source_channels) | \
67-
NRFX_CONFIG_MASK_DT(node_id, sink_channels);
73+
__attribute__((used)) = (uint32_t)NRFX_CONFIG_DPPI_MASK_DT(node_id);
6874
#define NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE \
6975
DT_FOREACH_STATUS_OKAY(nordic_nrf_dppic_global, NRFX_CONFIG_DPPI_CHANNELS_ENTRY)
7076
#define NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE \

0 commit comments

Comments
 (0)