Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dts/bindings/misc/nordic,nrf-dppic-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ description: |
compatible: "nordic,nrf-dppic-local"

include: ["nordic,nrf-dppic.yaml", "nordic,nrf-dppic-links.yaml"]

properties:
channels:
type: int
required: true
description: Number of channels implemented by the DPPIC instance.
1 change: 1 addition & 0 deletions dts/common/nordic/nrf54h20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@
dppic020: dppic@22000 {
compatible = "nordic,nrf-dppic-local";
reg = <0x22000 0x1000>;
channels = <32>;
status = "disabled";
};

Expand Down
1 change: 1 addition & 0 deletions dts/common/nordic/nrf9280.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
dppic020: dppic@22000 {
compatible = "nordic,nrf-dppic-local";
reg = <0x22000 0x1000>;
channels = <32>;
status = "disabled";
};

Expand Down
20 changes: 13 additions & 7 deletions modules/hal_nordic/nrfx/nrfx_zephyr_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@
* definitions required by the interconnect/apb layer:
* - NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
* - NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
* - NRFX_DPPI_PUB_OR_SUB_MASK(inst_num)
* - NRFX_DPPI_OWNED_MASK(inst_num)
* - NRFX_DPPI_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num)
* - NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE
* - NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE
* based on information from devicetree.
*/
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || \
DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_local)

/* Channels masks generation. */
#define NRFX_CONFIG_DPPI_MASK_DT(node_id) \
COND_CODE_1(DT_NODE_HAS_PROP(node_id, owned_channels), \
(NRFX_CONFIG_MASK_DT(node_id, owned_channels)), \
(COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, nordic_nrf_dppic_local), \
(BIT64_MASK(DT_PROP(node_id, channels))), (0))))

/* Source (publish) channels masks generation. */
#define NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels)
Expand All @@ -50,9 +58,9 @@
#define NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels)

#define NRFX_DPPI_PUB_OR_SUB_MASK(inst_num) \
UTIL_OR(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels), \
DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels))
#define NRFX_DPPI_OWNED_MASK(inst_num) \
UTIL_OR(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), owned_channels), \
DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), channels))

/* Variables names generation. */
#define NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) _CONCAT(_CONCAT(m_, node_id), _channels)
Expand All @@ -62,9 +70,7 @@
/* Variables entries generation. */
#define NRFX_CONFIG_DPPI_CHANNELS_ENTRY(node_id) \
static nrfx_atomic_t NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) \
__attribute__((used)) = \
NRFX_CONFIG_MASK_DT(node_id, source_channels) | \
NRFX_CONFIG_MASK_DT(node_id, sink_channels);
__attribute__((used)) = (uint32_t)NRFX_CONFIG_DPPI_MASK_DT(node_id);
#define NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE \
DT_FOREACH_STATUS_OKAY(nordic_nrf_dppic_global, NRFX_CONFIG_DPPI_CHANNELS_ENTRY)
#define NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE \
Expand Down