Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DPPI on nRF54H20 #69811

Merged
merged 5 commits into from
Mar 12, 2024
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
4 changes: 2 additions & 2 deletions drivers/timer/nrf_grtc_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#if !DT_NODE_HAS_PROP(GRTC_NODE, owned_channels)
#error GRTC owned-channels DT property is not defined
#endif
#define OWNED_CHANNELS_MASK NRFX_CONFIG_GRTC_MASK_DT(owned_channels)
#define CHILD_OWNED_CHANNELS_MASK NRFX_CONFIG_GRTC_MASK_DT(child_owned_channels)
#define OWNED_CHANNELS_MASK NRFX_CONFIG_MASK_DT(GRTC_NODE, owned_channels)
#define CHILD_OWNED_CHANNELS_MASK NRFX_CONFIG_MASK_DT(GRTC_NODE, child_owned_channels)
#if ((OWNED_CHANNELS_MASK | CHILD_OWNED_CHANNELS_MASK) != OWNED_CHANNELS_MASK)
#error GRTC child-owned-channels DT property must be a subset of owned-channels
#endif
Expand Down
45 changes: 45 additions & 0 deletions dts/bindings/ipc/nordic,nrf-ipct-common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic IPCT (Interprocessor Communication Transceiver)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add example snippets, these bindings are complex enough that it would be good to have, also with some extended details on what IPCT does


include: base.yaml

properties:
reg:
required: true

channels:
type: int
required: true
description: Number of channels implemented by the IPCT instance.

source-channel-links:
type: array
description: |
Mapping of IPCT channels that are mapped between two IPCT instances on
separate domains, in which a channel on this IPCT node is considered
the source. This array is then comprised of a 3-integer-wide "unit"
that defines one connection of the mapping. The format of this unit
is <source_channel sink_domain_id sink_channel>. Units are sequential
in the array, therefore requiring the length of this property to be
a factor of 3.

For example, if channel 2 is to be mapped to Radio Core (ID: 3) IPCT
channel 4, then the array "unit" would be <2 NRF_DOMAIN_ID_RADIOCORE 4>
or <2 3 4>.

sink-channel-links:
type: array
description: |
Mapping of IPCT channels that are mapped between two IPCT instances on
separate domains, in which a channel on this IPCT node is considered
the sink. This array is then comprised of a 3-integer-wide "unit"
that defines one connection of the mapping. The format of this unit
is <sink_channel source_domain_id source_channel>. Units are sequential
in the array, therefore requiring the length of this property to be
a factor of 3.

For example, if channel 2 is to be mapped to Radio Core (ID: 3) IPCT
channel 4, then the array "unit" would be <2 NRF_DOMAIN_ID_RADIOCORE 4>
or <2 3 4>.
17 changes: 17 additions & 0 deletions dts/bindings/ipc/nordic,nrf-ipct-global.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic Global IPCT (Interprocessor Communication Transceiver)

compatible: "nordic,nrf-ipct-global"

include: ["nordic,nrf-ipct-common.yaml", "nordic,split-channels.yaml"]

properties:
global-domain-id:
required: true
type: int
description: |
Global IPCT instances reside on specific buses within the Global Domain,
such as fast and slow, which have different IDs that do not match the
standard Global Domain ID presented in their address.
Comment on lines +11 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: what is the real purpose of this property? Feels like the domain one that existed for mbox-nrf-ids

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I saw that it is used by regtool so I thought it should be kept. @57300 Could you comment on that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what "mbox-nrf-ids" is, but global-domain-id is used by regtool to populate UICR.IPCMAP[n].DOMAINIDSINK/DOMAINIDSOURCE registers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can domain be inferred by other means, like it happened with ipc related stuff? I'd like to make sure we do not add redundancy in DT just for a tool.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is redundant here? This can't be inferred from the address, as the description says, because our brilliant hardware designers assigned both IPCT instances to domain ID 15, instead of 12 and 13.

The IPC stuff we solved by parsing node labels, which I still don't think is great. Do you want to do the same here, and label the nodes globalfast_ipct and globalslow_ipct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point. To me, both options are equally bad (nodelabels adding info, or, adding properties not consumed by driver code). Sad that HW has been laid out like this. Let's take the shortest path here, we can always address this later.

12 changes: 12 additions & 0 deletions dts/bindings/ipc/nordic,nrf-ipct-local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic Local IPCT (Interprocessor Communication Transceiver)

compatible: "nordic,nrf-ipct-local"

include: "nordic,nrf-ipct-common.yaml"

properties:
interrupts:
required: true
18 changes: 18 additions & 0 deletions dts/bindings/misc/nordic,nrf-dppic-global.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: |
Nordic Global DPPIC
(Distributed Programmable Peripheral Interconnect Controller)

Updated DPPIC binding set for Nordic products that have global DPPIC instances
with inter-bridge functionality. These instances also have split-ownership
of its channels and channel groups.

compatible: "nordic,nrf-dppic-global"

include:
- "nordic,nrf-dppic.yaml"
- "nordic,nrf-dppic-links.yaml"
- "nordic,split-channels.yaml"
- "nordic,split-channel-groups.yaml"
17 changes: 17 additions & 0 deletions dts/bindings/misc/nordic,nrf-dppic-links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic DPPIC Channel Linking

properties:
source-channels:
type: array
description: |
Channels that are linked to channels of DPPIC instances on separate
bridges as publishing sources.

sink-channels:
type: array
description: |
Channels that are linked to channels of DPPIC instances on separate
bridges as subscribing sinks.
13 changes: 13 additions & 0 deletions dts/bindings/misc/nordic,nrf-dppic-local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

description: |
Nordic Local DPPIC
(Distributed Programmable Peripheral Interconnect Controller)

Updated DPPIC binding set for Nordic products that have local DPPIC instances
with inter-bridge functionality.

compatible: "nordic,nrf-dppic-local"

include: ["nordic,nrf-dppic.yaml", "nordic,nrf-dppic-links.yaml"]
20 changes: 20 additions & 0 deletions dts/bindings/misc/nordic,split-channel-groups.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

description: Nordic Split Channel Groups

properties:
owned-channel-groups:
type: array
description: |
List of channel groups of a split-ownership peripheral that are to be
owned for use by the compiled domain.

nonsecure-channel-groups:
type: array
description: |
List of channel groups in a split-ownership, split-security peripheral
that are to be configured as nonsecure. In Trustzone systems, this
property is only evaluated for secure peripherals, as nonsecure channels
are implicitly specified through the owned-channels property. This
property is ignored in non-Trustzone systems.
101 changes: 101 additions & 0 deletions dts/common/nordic/nrf54h20_enga.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

#include <zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf54h20-enga.h>

/* Domain IDs. Can be used to specify channel links in IPCT nodes. */
#define NRF_DOMAIN_ID_APPLICATION 2
#define NRF_DOMAIN_ID_RADIOCORE 3
#define NRF_DOMAIN_ID_GLOBALFAST 12
#define NRF_DOMAIN_ID_GLOBALSLOW 13

/delete-node/ &sw_pwm;

/ {
Expand Down Expand Up @@ -152,6 +158,15 @@
<&ficr NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_FINE_0>;
nordic,ficr-names = "vsup", "coarse", "fine";
};

cpuapp_ipct: ipct@13000 {
compatible = "nordic,nrf-ipct-local";
reg = <0x13000 0x1000>;
status = "disabled";
channels = <4>;
interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>,
<65 NRF_DEFAULT_IRQ_PRIORITY>;
};
};

cpurad_peripherals: peripheral@53000000 {
Expand All @@ -172,13 +187,35 @@
nordic,ficr-names = "vsup", "coarse", "fine";
};

dppic020: dppic@22000 {
compatible = "nordic,nrf-dppic-local";
reg = <0x22000 0x1000>;
status = "disabled";
};

cpurad_ipct: ipct@24000 {
compatible = "nordic,nrf-ipct-local";
reg = <0x24000 0x1000>;
status = "disabled";
channels = <8>;
interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>,
<65 NRF_DEFAULT_IRQ_PRIORITY>;
};

egu020: egu@25000 {
compatible = "nordic,nrf-egu";
reg = <0x25000 0x1000>;
status = "disabled";
interrupts = <37 NRF_DEFAULT_IRQ_PRIORITY>;
};

ecb020: ecb@27000 {
compatible = "nordic,nrf-ecb";
reg = <0x27000 0x1000>;
status = "disabled";
interrupts = <39 NRF_DEFAULT_IRQ_PRIORITY>;
};

timer020: timer@28000 {
compatible = "nordic,nrf-timer";
reg = <0x28000 0x1000>;
Expand Down Expand Up @@ -266,6 +303,20 @@
#mbox-cells = <1>;
};

ipct120: ipct@8d1000 {
compatible = "nordic,nrf-ipct-global";
reg = <0x8d1000 0x1000>;
status = "disabled";
channels = <8>;
global-domain-id = <12>;
};

dppic120: dppic@8e1000 {
compatible = "nordic,nrf-dppic-global";
reg = <0x8e1000 0x1000>;
status = "disabled";
};

timer120: timer@8e2000 {
compatible = "nordic,nrf-timer";
reg = <0x8e2000 0x1000>;
Expand Down Expand Up @@ -343,6 +394,20 @@
};
};

ipct130: ipct@921000 {
compatible = "nordic,nrf-ipct-global";
reg = <0x921000 0x1000>;
status = "disabled";
channels = <8>;
global-domain-id = <13>;
};

dppic130: dppic@922000 {
compatible = "nordic,nrf-dppic-global";
reg = <0x922000 0x1000>;
status = "disabled";
};

rtc130: rtc@928000 {
compatible = "nordic,nrf-rtc";
reg = <0x928000 0x1000>;
Expand Down Expand Up @@ -448,6 +513,12 @@
port = <9>;
};

dppic131: dppic@981000 {
compatible = "nordic,nrf-dppic-global";
reg = <0x981000 0x1000>;
status = "disabled";
};

comp: comparator@983000 {
compatible = "nordic,nrf-comp";
reg = <0x983000 0x1000>;
Expand All @@ -470,6 +541,12 @@
interrupts = <389 NRF_DEFAULT_IRQ_PRIORITY>;
};

dppic132: dppic@991000 {
compatible = "nordic,nrf-dppic-global";
reg = <0x991000 0x1000>;
status = "disabled";
};

qdec130: qdec@994000 {
compatible = "nordic,nrf-qdec";
reg = <0x994000 0x1000>;
Expand All @@ -491,6 +568,12 @@
cc-num = <16>;
};

dppic133: dppic@9a1000 {
compatible = "nordic,nrf-dppic-global";
reg = <0x9a1000 0x1000>;
status = "disabled";
};

timer130: timer@9a2000 {
compatible = "nordic,nrf-timer";
reg = <0x9a2000 0x1000>;
Expand Down Expand Up @@ -567,6 +650,12 @@
interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>;
};

dppic134: dppic@9b1000 {
compatible = "nordic,nrf-dppic-global";
reg = <0x9b1000 0x1000>;
status = "disabled";
};

timer132: timer@9b2000 {
compatible = "nordic,nrf-timer";
reg = <0x9b2000 0x1000>;
Expand Down Expand Up @@ -643,6 +732,12 @@
interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>;
};

dppic135: dppic@9c1000 {
compatible = "nordic,nrf-dppic-global";
reg = <0x9c1000 0x1000>;
status = "disabled";
};

timer134: timer@9c2000 {
compatible = "nordic,nrf-timer";
reg = <0x9c2000 0x1000>;
Expand Down Expand Up @@ -719,6 +814,12 @@
interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>;
};

dppic136: dppic@9d1000 {
compatible = "nordic,nrf-dppic-global";
reg = <0x9d1000 0x1000>;
status = "disabled";
};

timer136: timer@9d2000 {
compatible = "nordic,nrf-timer";
reg = <0x9d2000 0x1000>;
Expand Down
8 changes: 8 additions & 0 deletions modules/hal_nordic/nrfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ if(CONFIG_SOC_SERIES_NRF54LX AND CONFIG_NRFX_DPPI)
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c)
endif()

if(CONFIG_SOC_SERIES_NRF54HX AND
(CONFIG_DT_HAS_NORDIC_NRF_DPPIC_LOCAL_ENABLED OR
CONFIG_DT_HAS_NORDIC_NRF_DPPIC_GLOBAL_ENABLED))
zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib.c)
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c)
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c)
endif()

# Get the SVD file for the current SoC
macro(mdk_svd_ifdef feature_toggle filename)
if(${feature_toggle})
Expand Down
Loading
Loading