From c2a40a8c669fcdb777e72d4e2db6541a83da8fbf Mon Sep 17 00:00:00 2001 From: Mahesh Mahadevan Date: Tue, 25 Aug 2020 16:15:03 -0500 Subject: [PATCH] dts: Clock control for RT600, LPC54xxx, LPC55xxx Use the clock control driver to get flexcomm clock frequency Signed-off-by: Mahesh Mahadevan --- dts/arm/nxp/nxp_lpc54xxx.dtsi | 20 ++++++++++++++++++-- dts/arm/nxp/nxp_lpc55S1x_common.dtsi | 17 +++++++++++++++++ dts/arm/nxp/nxp_lpc55S6x_common.dtsi | 17 +++++++++++++++++ dts/arm/nxp/nxp_rt6xx_common.dtsi | 24 ++++++++++++++++++++++++ dts/bindings/clock/nxp,lpc-syscon.yaml | 21 +++++++++++++++++++++ 5 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 dts/bindings/clock/nxp,lpc-syscon.yaml diff --git a/dts/arm/nxp/nxp_lpc54xxx.dtsi b/dts/arm/nxp/nxp_lpc54xxx.dtsi index e751d49221f..e30a193e948 100644 --- a/dts/arm/nxp/nxp_lpc54xxx.dtsi +++ b/dts/arm/nxp/nxp_lpc54xxx.dtsi @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include @@ -30,6 +31,13 @@ }; soc { + syscon: syscon@40000000 { + compatible = "nxp,lpc-syscon"; + reg = <0x40000000 0x4000>; + label = "SYSCON"; + #clock-cells = <1>; + }; + sram0:memory@20000000 { compatible = "mmio-sram"; reg = <0x20000000 0x10000>; @@ -45,9 +53,9 @@ reg = <0x20020000 0x8000>; }; - sramx:memory@40000000{ + sramx:memory@4000000{ compatible = "mmio-sram"; - reg = <0x40000000 0x8000>; + reg = <0x4000000 0x8000>; }; flash0:flash@0 { @@ -85,6 +93,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x40086000 0x1000>; interrupts = <14 0>; + clocks = <&syscon MCUX_FLEXCOMM0_CLK>; label = "FLEXCOMM_0"; status = "disabled"; }; @@ -93,6 +102,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x40087000 0x1000>; interrupts = <15 0>; + clocks = <&syscon MCUX_FLEXCOMM1_CLK>; label = "FLEXCOMM_1"; status = "disabled"; }; @@ -101,6 +111,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x40088000 0x1000>; interrupts = <16 0>; + clocks = <&syscon MCUX_FLEXCOMM2_CLK>; label = "FLEXCOMM_2"; status = "disabled"; }; @@ -109,6 +120,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x40089000 0x1000>; interrupts = <17 0>; + clocks = <&syscon MCUX_FLEXCOMM3_CLK>; label = "FLEXCOMM_3"; status = "disabled"; }; @@ -117,6 +129,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x4008a000 0x1000>; interrupts = <18 0>; + clocks = <&syscon MCUX_FLEXCOMM4_CLK>; label = "FLEXCOMM_4"; status = "disabled"; }; @@ -125,6 +138,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x40096000 0x1000>; interrupts = <19 0>; + clocks = <&syscon MCUX_FLEXCOMM5_CLK>; label = "FLEXCOMM_5"; status = "disabled"; }; @@ -133,6 +147,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x40097000 0x1000>; interrupts = <20 0>; + clocks = <&syscon MCUX_FLEXCOMM6_CLK>; label = "FLEXCOMM_6"; status = "disabled"; }; @@ -141,6 +156,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x40098000 0x1000>; interrupts = <21 0>; + clocks = <&syscon MCUX_FLEXCOMM7_CLK>; label = "FLEXCOMM_7"; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_lpc55S1x_common.dtsi b/dts/arm/nxp/nxp_lpc55S1x_common.dtsi index b2713bf2c9b..feea9102c6a 100644 --- a/dts/arm/nxp/nxp_lpc55S1x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S1x_common.dtsi @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -69,6 +70,13 @@ #address-cells = <1>; #size-cells = <1>; + syscon: syscon@0 { + compatible = "nxp,lpc-syscon"; + reg = <0x0 0x4000>; + label = "SYSCON"; + #clock-cells = <1>; + }; + iap: flash-controller@34000 { compatible = "nxp,lpc-iap"; label = "FLASH_IAP"; @@ -118,6 +126,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x86000 0x1000>; interrupts = <14 0>; + clocks = <&syscon MCUX_FLEXCOMM0_CLK>; label = "FLEXCOMM_0"; status = "disabled"; }; @@ -126,6 +135,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x87000 0x1000>; interrupts = <15 0>; + clocks = <&syscon MCUX_FLEXCOMM1_CLK>; label = "FLEXCOMM_1"; status = "disabled"; }; @@ -134,6 +144,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x88000 0x1000>; interrupts = <16 0>; + clocks = <&syscon MCUX_FLEXCOMM2_CLK>; label = "FLEXCOMM_2"; status = "disabled"; }; @@ -142,6 +153,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x89000 0x1000>; interrupts = <17 0>; + clocks = <&syscon MCUX_FLEXCOMM3_CLK>; label = "FLEXCOMM_3"; status = "disabled"; }; @@ -150,6 +162,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x8a000 0x1000>; interrupts = <18 0>; + clocks = <&syscon MCUX_FLEXCOMM4_CLK>; label = "FLEXCOMM_4"; status = "disabled"; }; @@ -158,6 +171,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x96000 0x1000>; interrupts = <19 0>; + clocks = <&syscon MCUX_FLEXCOMM5_CLK>; label = "FLEXCOMM_5"; status = "disabled"; }; @@ -166,6 +180,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x97000 0x1000>; interrupts = <20 0>; + clocks = <&syscon MCUX_FLEXCOMM6_CLK>; label = "FLEXCOMM_6"; status = "disabled"; }; @@ -174,6 +189,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x98000 0x1000>; interrupts = <21 0>; + clocks = <&syscon MCUX_FLEXCOMM7_CLK>; label = "FLEXCOMM_7"; status = "disabled"; }; @@ -182,6 +198,7 @@ compatible = "nxp,lpc-spi"; reg = <0x9f000 0x1000>; interrupts = <59 0>; + clocks = <&syscon MCUX_HS_SPI_CLK>; label = "HS_LSPI"; status = "disabled"; #address-cells = <1>; diff --git a/dts/arm/nxp/nxp_lpc55S6x_common.dtsi b/dts/arm/nxp/nxp_lpc55S6x_common.dtsi index 90abcbdd5cc..300fc33572e 100644 --- a/dts/arm/nxp/nxp_lpc55S6x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S6x_common.dtsi @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -83,6 +84,13 @@ #address-cells = <1>; #size-cells = <1>; + syscon: syscon@0 { + compatible = "nxp,lpc-syscon"; + reg = <0x0 0x4000>; + label = "SYSCON"; + #clock-cells = <1>; + }; + iap: flash-controller@34000 { compatible = "nxp,lpc-iap"; label = "FLASH_IAP"; @@ -131,6 +139,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x86000 0x1000>; interrupts = <14 0>; + clocks = <&syscon MCUX_FLEXCOMM0_CLK>; label = "FLEXCOMM_0"; status = "disabled"; }; @@ -139,6 +148,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x87000 0x1000>; interrupts = <15 0>; + clocks = <&syscon MCUX_FLEXCOMM1_CLK>; label = "FLEXCOMM_1"; status = "disabled"; }; @@ -147,6 +157,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x88000 0x1000>; interrupts = <16 0>; + clocks = <&syscon MCUX_FLEXCOMM2_CLK>; label = "FLEXCOMM_2"; status = "disabled"; }; @@ -155,6 +166,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x89000 0x1000>; interrupts = <17 0>; + clocks = <&syscon MCUX_FLEXCOMM3_CLK>; label = "FLEXCOMM_3"; status = "disabled"; }; @@ -163,6 +175,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x8a000 0x1000>; interrupts = <18 0>; + clocks = <&syscon MCUX_FLEXCOMM4_CLK>; label = "FLEXCOMM_4"; status = "disabled"; }; @@ -171,6 +184,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x96000 0x1000>; interrupts = <19 0>; + clocks = <&syscon MCUX_FLEXCOMM5_CLK>; label = "FLEXCOMM_5"; status = "disabled"; }; @@ -179,6 +193,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x97000 0x1000>; interrupts = <20 0>; + clocks = <&syscon MCUX_FLEXCOMM6_CLK>; label = "FLEXCOMM_6"; status = "disabled"; }; @@ -187,6 +202,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x98000 0x1000>; interrupts = <21 0>; + clocks = <&syscon MCUX_FLEXCOMM7_CLK>; label = "FLEXCOMM_7"; status = "disabled"; }; @@ -201,6 +217,7 @@ <&gpio1 26 GPIO_ACTIVE_LOW>; */ reg = <0x9f000 0x1000>; interrupts = <59 0>; + clocks = <&syscon MCUX_HS_SPI_CLK>; label = "HS_LSPI"; status = "disabled"; #address-cells = <1>; diff --git a/dts/arm/nxp/nxp_rt6xx_common.dtsi b/dts/arm/nxp/nxp_rt6xx_common.dtsi index cb91b0c8ad2..f02935974b4 100644 --- a/dts/arm/nxp/nxp_rt6xx_common.dtsi +++ b/dts/arm/nxp/nxp_rt6xx_common.dtsi @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -48,6 +49,20 @@ #address-cells = <1>; #size-cells = <1>; + clkctl0: clkctl@1000 { + compatible = "nxp,lpc-syscon"; + reg = <0x1000 0x4000>; + label = "CLKCTL_0"; + #clock-cells = <1>; + }; + + clkctl1: clkctl@21000 { + compatible = "nxp,lpc-syscon"; + reg = <0x21000 0x4000>; + label = "CLKCTL_1"; + #clock-cells = <1>; + }; + gpio0: gpio@0 { compatible = "nxp,lpc-gpio"; reg = <0x100000 0x4000>; @@ -79,6 +94,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x106000 0x1000>; interrupts = <14 0>; + clocks = <&clkctl1 MCUX_FLEXCOMM0_CLK>; label = "FLEXCOMM_0"; status = "disabled"; }; @@ -87,6 +103,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x107000 0x1000>; interrupts = <15 0>; + clocks = <&clkctl1 MCUX_FLEXCOMM1_CLK>; label = "FLEXCOMM_1"; status = "disabled"; }; @@ -95,6 +112,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x108000 0x1000>; interrupts = <16 0>; + clocks = <&clkctl1 MCUX_FLEXCOMM2_CLK>; label = "FLEXCOMM_2"; status = "disabled"; }; @@ -103,6 +121,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x109000 0x1000>; interrupts = <17 0>; + clocks = <&clkctl1 MCUX_FLEXCOMM3_CLK>; label = "FLEXCOMM_3"; status = "disabled"; }; @@ -111,6 +130,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x122000 0x1000>; interrupts = <18 0>; + clocks = <&clkctl1 MCUX_FLEXCOMM4_CLK>; label = "FLEXCOMM_4"; status = "disabled"; }; @@ -119,6 +139,7 @@ compatible = "nxp,lpc-flexcomm"; reg = <0x123000 0x1000>; interrupts = <19 0>; + clocks = <&clkctl1 MCUX_FLEXCOMM5_CLK>; label = "FLEXCOMM_5"; status = "disabled"; }; @@ -128,6 +149,7 @@ reg = <0x124000 0x1000>; interrupts = <43 0>; label = "FLEXCOMM_6"; + clocks = <&clkctl1 MCUX_FLEXCOMM6_CLK>; status = "disabled"; }; @@ -136,6 +158,7 @@ reg = <0x125000 0x1000>; interrupts = <44 0>; label = "FLEXCOMM_7"; + clocks = <&clkctl1 MCUX_FLEXCOMM7_CLK>; status = "disabled"; }; @@ -149,6 +172,7 @@ <&gpio1 17 GPIO_ACTIVE_LOW>; */ reg = <0x126000 0x1000>; interrupts = <20 0>; + clocks = <&clkctl1 MCUX_HS_SPI_CLK>; label = "HS_LSPI"; status = "disabled"; #address-cells = <1>; diff --git a/dts/bindings/clock/nxp,lpc-syscon.yaml b/dts/bindings/clock/nxp,lpc-syscon.yaml new file mode 100644 index 00000000000..0d5b40164b5 --- /dev/null +++ b/dts/bindings/clock/nxp,lpc-syscon.yaml @@ -0,0 +1,21 @@ +# Copyright (c) 2020, NXP +# SPDX-License-Identifier: Apache-2.0 + +description: LPC SYSCON & CLKCTL IP node + +compatible: "nxp,lpc-syscon" + +include: [clock-controller.yaml, base.yaml] + +properties: + reg: + required: true + + label: + required: true + + "#clock-cells": + const: 1 + +clock-cells: + - name