From 49df14c08a69839d8a7bfcae742547ba818ce640 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 20 Sep 2023 11:33:37 +0200 Subject: [PATCH] dts: arm: nordic: fix cryptocell description The ARM Cryptocell 310/312 IP is wrapped by Nordic specific registers. It is organized as follows: - Base address: Nordic wrapper - Base address + 0x1000: ARM Cryptocell IP registers Following more standard devicetree conventions, use a single node for what is exposed as a single peripheral. The node contains 2 register entries, one for the wrapper and a second one for the 3rd party IP. Compatibles are used from more specific (nordic,cryptocell) to more generic (arm,cryptocell-3xx). Other minor fixes: peripheral is disabled by default (as it should be in SoC dts files). Signed-off-by: Gerard Marull-Paretas --- dts/arm/nordic/nrf52840.dtsi | 15 +++++---------- dts/arm/nordic/nrf5340_cpuapp.dtsi | 15 +++++---------- dts/arm/nordic/nrf91.dtsi | 15 +++++---------- dts/bindings/crypto/nordic,nrf-cc310.yaml | 12 ------------ dts/bindings/crypto/nordic,nrf-cc312.yaml | 12 ------------ soc/arm/nordic_nrf/Kconfig.peripherals | 4 ++-- 6 files changed, 17 insertions(+), 56 deletions(-) delete mode 100644 dts/bindings/crypto/nordic,nrf-cc310.yaml delete mode 100644 dts/bindings/crypto/nordic,nrf-cc312.yaml diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 8c89968c108..f35778a9d48 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -537,16 +537,11 @@ }; cryptocell: crypto@5002a000 { - compatible = "nordic,nrf-cc310"; - reg = <0x5002A000 0x1000>; - status = "okay"; - #address-cells = <1>; - #size-cells = <1>; - cryptocell310: crypto@5002b000 { - compatible = "arm,cryptocell-310"; - reg = <0x5002B000 0x1000>; - interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - }; + compatible = "nordic,cryptocell", "arm,cryptocell-310"; + reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>; + reg-names = "wrapper", "core"; + interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; }; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 7a32c5398db..77762990e13 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -87,16 +87,11 @@ }; cryptocell: crypto@50844000 { - compatible = "nordic,nrf-cc312"; - reg = <0x50844000 0x1000>; - status = "okay"; - #address-cells = <1>; - #size-cells = <1>; - cryptocell312: crypto@50845000 { - compatible = "arm,cryptocell-312"; - reg = <0x50845000 0x1000>; - interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; - }; + compatible = "nordic,cryptocell", "arm,cryptocell-312"; + reg = <0x50844000 0x1000>, <0x50845000 0x1000>; + reg-names = "wrapper", "core"; + interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index d872680fb20..46024011166 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -47,16 +47,11 @@ /* Additional Secure peripherals */ cryptocell: crypto@50840000 { - compatible = "nordic,nrf-cc310"; - reg = <0x50840000 0x1000>; - status = "okay"; - #address-cells = <1>; - #size-cells = <1>; - cryptocell310: crypto@50841000 { - compatible = "arm,cryptocell-310"; - reg = <0x50841000 0x1000>; - interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; - }; + compatible = "nordic,cryptocell", "arm,cryptocell-310"; + reg = <0x50840000 0x1000>, <0x50841000 0x1000>; + reg-names = "wrapper", "core"; + interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; }; ctrlap: ctrlap@50006000 { diff --git a/dts/bindings/crypto/nordic,nrf-cc310.yaml b/dts/bindings/crypto/nordic,nrf-cc310.yaml deleted file mode 100644 index 8ab48636848..00000000000 --- a/dts/bindings/crypto/nordic,nrf-cc310.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2018, Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic Control Interface for ARM TrustZone CryptoCell 310 - -compatible: "nordic,nrf-cc310" - -include: base.yaml - -properties: - reg: - required: true diff --git a/dts/bindings/crypto/nordic,nrf-cc312.yaml b/dts/bindings/crypto/nordic,nrf-cc312.yaml deleted file mode 100644 index bc0b227e7e5..00000000000 --- a/dts/bindings/crypto/nordic,nrf-cc312.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2018, 2020 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic Control Interface for ARM TrustZone CryptoCell 312 - -compatible: "nordic,nrf-cc312" - -include: base.yaml - -properties: - reg: - required: true diff --git a/soc/arm/nordic_nrf/Kconfig.peripherals b/soc/arm/nordic_nrf/Kconfig.peripherals index c7bfb552409..9a4152a6d84 100644 --- a/soc/arm/nordic_nrf/Kconfig.peripherals +++ b/soc/arm/nordic_nrf/Kconfig.peripherals @@ -13,10 +13,10 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC310)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CC312)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM))