From 7249fac80d60b84d2ba9c2a1de6d42d8b3d9bd0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 25 Feb 2025 11:12:09 +0100 Subject: [PATCH] soc: nordic: nrf54h: Add option to use NFCT pins as GPIOs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Protection circuit must be disabled to use NFCT antenna pins as GPIOs. It can be done by adding nfct-pins-as-gpios to nfct node in the devicetree in cpuapp. Node must be disabled as NFCT is not used. In legacy platforms same property was added to uicr node because that information was stored in UICR. In nrf54h20 it is not part of UICR so property is part of nfct node. Signed-off-by: Krzysztof Chruściński --- dts/arm/nordic/nrf54h20_cpuapp.dtsi | 4 ++++ .../net/wireless/nordic,nrf-nfct-v2.yaml | 18 ++++++++++++++++++ soc/nordic/nrf54h/soc.c | 6 ++++++ 3 files changed, 28 insertions(+) create mode 100644 dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index c56df42ddd5..15eac9c5d19 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -59,3 +59,7 @@ wdt011: &cpuapp_wdt011 {}; &grtc { interrupts = <109 NRF_DEFAULT_IRQ_PRIORITY>; }; + +&nfct { + compatible = "nordic,nrf-nfct-v2"; +}; diff --git a/dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml b/dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml new file mode 100644 index 00000000000..e6b34aff3ec --- /dev/null +++ b/dts/bindings/net/wireless/nordic,nrf-nfct-v2.yaml @@ -0,0 +1,18 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic nRF family NFCT (Near Field Communication Tag) + +compatible: "nordic,nrf-nfct-v2" + +include: nordic,nrf-nfct.yaml + +properties: + nfct-pins-as-gpios: + type: boolean + description: | + When enabled this property will configure pins dedicated to NFCT + peripheral as regular GPIOs. This property must be applied in cpuapp + if NFCT pins are intended to be used as regular GPIOs by any core. + + NFC pins in nRF54H series: P2.10 and P2.11 diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 43c84e1b9a7..6dc8100e00c 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -151,6 +152,11 @@ static int nordicsemi_nrf54h_init(void) nrf_spu_periph_perm_dmasec_set(spu, nrf_address_slave_get(ccm030_addr), true); #endif + if (DT_NODE_HAS_STATUS(DT_NODELABEL(nfct), disabled) && + DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { + nrf_nfct_pad_config_enable_set(NRF_NFCT, false); + } + return 0; }