From nobody Fri Apr 10 20:19:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1CD5C32771 for ; Fri, 19 Aug 2022 12:28:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348927AbiHSM2R (ORCPT ); Fri, 19 Aug 2022 08:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230513AbiHSM2M (ORCPT ); Fri, 19 Aug 2022 08:28:12 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AD45243; Fri, 19 Aug 2022 05:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1660912090; x=1692448090; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qCodOvHAAWV9jjEol1BPCacoYzYl6MK5PiY5naSU1RI=; b=zLSA7ppsB2z7Xsfslg9bagwvFm7rn1HKnKTTnObFdAGT8PBz4H7wFlem BSp2Q4ZNJd5wJlWzjRUJYrZ9jq/2qtaLjgmeqbgleZ1vMtnlfOA1Zm9cZ 9xewXI7VFghgP+D0alic2OZ7LvqCxr86znifJxJYN/VF4JsX28tNvJafn mQeHtGnYitYqOUm4Oc3zCBYKgDwHgYoJ3R0mcK74+zYYwI9DUXS7xgAUd 7zXi2P5VLArfPH1YeX30gxJSnKJEtpizEjTlDuHIKmSVmCkgj6SOc3KQx xl2EWgv1jvhg8RlZXmlb4l6Cjk/0wG/tvbyNE6U11N0/7AM5FtR8IU9Yy A==; X-IronPort-AV: E=Sophos;i="5.93,247,1654585200"; d="scan'208";a="176919046" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 19 Aug 2022 05:28:10 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 19 Aug 2022 05:28:08 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 19 Aug 2022 05:28:06 -0700 From: Conor Dooley To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Conor Dooley , Daire McNamara CC: Paul Walmsley , Albert Ou , , , , Subject: [PATCH 1/6] dt-bindings: clk: rename mpfs-clkcfg binding Date: Fri, 19 Aug 2022 13:22:55 +0100 Message-ID: <20220819122259.183600-2-conor.dooley@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220819122259.183600-1-conor.dooley@microchip.com> References: <20220819122259.183600-1-conor.dooley@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The filename for a binding is supposed to match the first compatible, but the mpfs-clkcfg file did not follow this policy. Rename it to match so that when other mpfs clock bindings are added things make more sense. Signed-off-by: Conor Dooley Acked-by: Krzysztof Kozlowski --- .../clock/{microchip,mpfs.yaml =3D> microchip,mpfs-clkcfg.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Documentation/devicetree/bindings/clock/{microchip,mpfs.yaml =3D> m= icrochip,mpfs-clkcfg.yaml} (96%) diff --git a/Documentation/devicetree/bindings/clock/microchip,mpfs.yaml b/= Documentation/devicetree/bindings/clock/microchip,mpfs-clkcfg.yaml similarity index 96% rename from Documentation/devicetree/bindings/clock/microchip,mpfs.yaml rename to Documentation/devicetree/bindings/clock/microchip,mpfs-clkcfg.yaml index 016a4f378b9b..212228734ffd 100644 --- a/Documentation/devicetree/bindings/clock/microchip,mpfs.yaml +++ b/Documentation/devicetree/bindings/clock/microchip,mpfs-clkcfg.yaml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- -$id: http://devicetree.org/schemas/clock/microchip,mpfs.yaml# +$id: http://devicetree.org/schemas/clock/microchip,mpfs-clkcfg.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# =20 title: Microchip PolarFire Clock Control Module Binding --=20 2.36.1 From nobody Fri Apr 10 20:19:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 560C5C32774 for ; Fri, 19 Aug 2022 12:28:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348946AbiHSM2W (ORCPT ); Fri, 19 Aug 2022 08:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348916AbiHSM2P (ORCPT ); Fri, 19 Aug 2022 08:28:15 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680D0F22; Fri, 19 Aug 2022 05:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1660912092; x=1692448092; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ach2N8GdKLooCCnRn+72TzbqVJ3JiMP82BY8K90mlao=; b=j9kfmyfn2pjUlHtbj3+vPAgXOzDyYvmRnRFAL29FmpWjpdMs1C50e/2y ybJefsNKg/R/Lzv2FIJWCRRgy4jjP73et4vGslQMNZ2z+RJBoP7O2Ech2 3eQmgCW6cG9HD8zHvDHr3ZSi5k3czO57HtY4M3m5vfrpEuoUDZzUcezYT gbTn0uU29C6awSxCcRnKybQgG5BH1Y5WmAHwbnmyxdULfIfAStX7EjO9p kKn9EWwXY1C75XzzOT7YAMXopM6rg+jtBWwtndsm1/zj5RlTLnkTow5xk kSJecOA3fyGruehaiAg9w/k2vCUkNjvPGA+f4XNaO6Q10FEZrVrd/Iao3 Q==; X-IronPort-AV: E=Sophos;i="5.93,247,1654585200"; d="scan'208";a="187188539" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 19 Aug 2022 05:28:11 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 19 Aug 2022 05:28:11 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 19 Aug 2022 05:28:09 -0700 From: Conor Dooley To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Conor Dooley , Daire McNamara CC: Paul Walmsley , Albert Ou , , , , Subject: [PATCH 2/6] dt-bindings: clk: document PolarFire SoC fabric clocks Date: Fri, 19 Aug 2022 13:22:56 +0100 Message-ID: <20220819122259.183600-3-conor.dooley@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220819122259.183600-1-conor.dooley@microchip.com> References: <20220819122259.183600-1-conor.dooley@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On PolarFire SoC there are 4 PLL/DLL blocks, located in each of the ordinal corners of the chip, which our documentation refers to as "Clock Conditioning Circuitry". PolarFire SoC is an FPGA, these are highly configurable & many of the input clocks are optional. Signed-off-by: Conor Dooley --- .../bindings/clock/microchip,mpfs-ccc.yaml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/microchip,mpfs-= ccc.yaml diff --git a/Documentation/devicetree/bindings/clock/microchip,mpfs-ccc.yam= l b/Documentation/devicetree/bindings/clock/microchip,mpfs-ccc.yaml new file mode 100644 index 000000000000..2e78aa15dbe0 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/microchip,mpfs-ccc.yaml @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/microchip,mpfs-ccc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip PolarFire SoC Fabric Clock Conditioning Circuitry + +maintainers: + - Conor Dooley + +description: | + Microchip PolarFire SoC has 4 Clock Conditioning Circuitry blocks. Each = of + these blocks contains two PLLs and 2 DLLs & are located in the four corn= ers of + the FPGA. For more information see "PolarFire SoC FPGA Clocking Resource= s" at: + https://onlinedocs.microchip.com/pr/GUID-8F0CC4C0-0317-4262-89CA-CE7773E= D1931-en-US-1/index.html + +properties: + compatible: + const: microchip,mpfs-ccc + + reg: + items: + - description: PLL0's control registers + - description: PLL1's control registers + - description: DLL0's control registers + - description: DLL1's control registers + + clocks: + description: + The CCC PLL's have two input clocks. It is required that even if the= input + clocks are identical that both are provided. + minItems: 2 + items: + - description: PLL0's refclk0 + - description: PLL0's refclk1 + - description: PLL1's refclk0 + - description: PLL1's refclk1 + - description: DLL0's refclk + - description: DLL1's refclk + + clock-names: + minItems: 2 + items: + - const: pll0_ref0 + - const: pll0_ref1 + - const: pll1_ref0 + - const: pll1_ref1 + - const: dll0_ref + - const: dll1_ref + + '#clock-cells': + const: 1 + description: | + The clock consumer should specify the desired clock by having the cl= ock + ID in its "clocks" phandle cell. + See include/dt-bindings/clock/microchip,mpfs-clock.h for the full li= st of + PolarFire clock IDs. + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + +additionalProperties: false + +examples: + - | + ccc_nw: cccnwclk@38100000 { + compatible =3D "microchip,mpfs-ccc"; + reg =3D <0x38010000 0x1000>, <0x38020000 0x1000>, + <0x39010000 0x1000>, <0x39020000 0x1000>; + #clock-cells =3D <1>; + clocks =3D <&refclk_ccc>, <&refclk_ccc>, <&refclk_ccc>, <&refclk_c= cc>, + <&refclk_ccc>, <&refclk_ccc>; + clock-names =3D "pll0_ref0", "pll0_ref1", "pll1_ref0", "pll1_ref1", + "dll0_ref", "dll1_ref"; + }; --=20 2.36.1 From nobody Fri Apr 10 20:19:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 143CFC32773 for ; Fri, 19 Aug 2022 12:28:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348953AbiHSM20 (ORCPT ); Fri, 19 Aug 2022 08:28:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348928AbiHSM2R (ORCPT ); Fri, 19 Aug 2022 08:28:17 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B12AD109; Fri, 19 Aug 2022 05:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1660912096; x=1692448096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nt4enKj/zKJO+UzKjfd+XwU+/3h6xQS/zb1SP36Ro6M=; b=KhP2ogmS9UVFEmPn+GE4ozRZbYi6Xiyb5+fz2VF1opwAxG3qOqSp/80O V7luDh7PjFw/yrKYwekmo8o0WPv97QJWJqNDCENke5sgSxDyXFis960PY OWSSLizGJhUyK7VS7z2Cx6RnAm5iykX+9QVOdeb25Mbl0Ma9n3RzcZmeF x1vFTG52sghynoqpzQayhCd5w4Q7MASEiHqe5/TAt9s5Xx7CoZFGhe21U OkDqYH6591/i1QHsN/3EZ1e7pNVlQhLx789nzSqMcrAY6qMX4OORamwu5 SkpIi2scvImp2fO6uXKqu3gE8cNj2gzPWDfHresmUd8wBFd4ejzLBcKOH Q==; X-IronPort-AV: E=Sophos;i="5.93,247,1654585200"; d="scan'208";a="176919058" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 19 Aug 2022 05:28:15 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 19 Aug 2022 05:28:14 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 19 Aug 2022 05:28:11 -0700 From: Conor Dooley To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Conor Dooley , Daire McNamara CC: Paul Walmsley , Albert Ou , , , , Subject: [PATCH 3/6] dt-bindings: clk: add PolarFire SoC fabric clock ids Date: Fri, 19 Aug 2022 13:22:57 +0100 Message-ID: <20220819122259.183600-4-conor.dooley@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220819122259.183600-1-conor.dooley@microchip.com> References: <20220819122259.183600-1-conor.dooley@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Each Clock Conditioning Circuitry block contains 2 PLLs and 2 DLLs. The PLLs have 4 outputs each and the DLLs 2. Add 16 new IDs covering these clocks. For more information on the CCC hardware, see the "PolarFire SoC FPGA Clocking Resources" document at the link below. Link: https://onlinedocs.microchip.com/pr/GUID-8F0CC4C0-0317-4262-89CA-CE77= 73ED1931-en-US-1/index.html Signed-off-by: Conor Dooley Acked-by: Krzysztof Kozlowski --- .../dt-bindings/clock/microchip,mpfs-clock.h | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/dt-bindings/clock/microchip,mpfs-clock.h b/include/dt-= bindings/clock/microchip,mpfs-clock.h index 4048669bf756..79775a5134ca 100644 --- a/include/dt-bindings/clock/microchip,mpfs-clock.h +++ b/include/dt-bindings/clock/microchip,mpfs-clock.h @@ -45,4 +45,27 @@ #define CLK_RTCREF 33 #define CLK_MSSPLL 34 =20 +/* Clock Conditioning Circuitry Clock IDs */ + +#define CLK_CCC_PLL0 0 +#define CLK_CCC_PLL1 1 +#define CLK_CCC_DLL0 2 +#define CLK_CCC_DLL1 3 + +#define CLK_CCC_PLL0_OUT0 4 +#define CLK_CCC_PLL0_OUT1 5 +#define CLK_CCC_PLL0_OUT2 6 +#define CLK_CCC_PLL0_OUT3 7 + +#define CLK_CCC_PLL1_OUT0 8 +#define CLK_CCC_PLL1_OUT1 9 +#define CLK_CCC_PLL1_OUT2 10 +#define CLK_CCC_PLL1_OUT3 11 + +#define CLK_CCC_DLL0_OUT0 12 +#define CLK_CCC_DLL0_OUT1 13 + +#define CLK_CCC_DLL1_OUT0 14 +#define CLK_CCC_DLL1_OUT1 15 + #endif /* _DT_BINDINGS_CLK_MICROCHIP_MPFS_H_ */ --=20 2.36.1 From nobody Fri Apr 10 20:19:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AB52C32771 for ; Fri, 19 Aug 2022 12:28:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348962AbiHSM23 (ORCPT ); Fri, 19 Aug 2022 08:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348935AbiHSM2U (ORCPT ); Fri, 19 Aug 2022 08:28:20 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAAC437FAD; Fri, 19 Aug 2022 05:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1660912098; x=1692448098; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eJrWMvZV3yT76UldKtJmotcSxx4q47UGVot8PEf4K3Y=; b=cs8GLG1P8UL4r5rdmyio/r9j6wB87Mr/CcoCefgBtQ6R9sjx0+wioBJU WgZR3rmrnQNBSoiZ68Rx0NVQEXLtl5/GnZ3TsfgWuGsNgicgW8Ln4MSIl xKuXI9nP3NwqmtPm+bWy24apBIX5P4Cm/hdUZUePITfnMrni3iaMwpyCo n0CjLnMFM94ZtQNstqZirGjRfl5XUeUbTuMm+5tSnRasvJFmfQ8/aGsdw L7omHQ6xHghEYauxiigvKlOcOGnrJBMVOCL55JBSXT7DA6ZL7ezcrfHaN DVUC6eO22lShfJC5kVgnyz+pNQ/qMqimqfH7yRu6hTn5M1oe4wPpQ5pBZ w==; X-IronPort-AV: E=Sophos;i="5.93,247,1654585200"; d="scan'208";a="187188546" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 19 Aug 2022 05:28:17 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 19 Aug 2022 05:28:16 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 19 Aug 2022 05:28:14 -0700 From: Conor Dooley To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Conor Dooley , Daire McNamara CC: Paul Walmsley , Albert Ou , , , , Subject: [PATCH 4/6] clk: microchip: add PolarFire SoC fabric clock support Date: Fri, 19 Aug 2022 13:22:58 +0100 Message-ID: <20220819122259.183600-5-conor.dooley@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220819122259.183600-1-conor.dooley@microchip.com> References: <20220819122259.183600-1-conor.dooley@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a driver to support the PLLs in PolarFire SoC's Clock Conditioning Circuitry, an instance of which is located in each ordinal corner of the FPGA. Only get_rate() is supported as these clocks are intended to be statically configured by the FPGA design. Currently, the DLLs are not supported by this driver. For more information on the hardware, see "PolarFire SoC FPGA Clocking Resources" in the link below. Link: https://onlinedocs.microchip.com/pr/GUID-8F0CC4C0-0317-4262-89CA-CE77= 73ED1931-en-US-1/index.html Signed-off-by: Conor Dooley --- drivers/clk/microchip/Makefile | 1 + drivers/clk/microchip/clk-mpfs-ccc.c | 294 +++++++++++++++++++++++++++ 2 files changed, 295 insertions(+) create mode 100644 drivers/clk/microchip/clk-mpfs-ccc.c diff --git a/drivers/clk/microchip/Makefile b/drivers/clk/microchip/Makefile index 5fa6dcf30a9a..13250e04e46c 100644 --- a/drivers/clk/microchip/Makefile +++ b/drivers/clk/microchip/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_COMMON_CLK_PIC32) +=3D clk-core.o obj-$(CONFIG_PIC32MZDA) +=3D clk-pic32mzda.o obj-$(CONFIG_MCHP_CLK_MPFS) +=3D clk-mpfs.o +obj-$(CONFIG_MCHP_CLK_MPFS) +=3D clk-mpfs-ccc.o diff --git a/drivers/clk/microchip/clk-mpfs-ccc.c b/drivers/clk/microchip/c= lk-mpfs-ccc.c new file mode 100644 index 000000000000..d6a1777c428c --- /dev/null +++ b/drivers/clk/microchip/clk-mpfs-ccc.c @@ -0,0 +1,294 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Author: Conor Dooley + * + * Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries + */ +#include +#include +#include +#include +#include + +/* address offset of control registers */ +#define MPFS_CCC_PLL_CR 0x04u +#define MPFS_CCC_REF_CR 0x08u +#define MPFS_CCC_SSCG_2_CR 0x2Cu +#define MPFS_CCC_POSTDIV01_CR 0x10u +#define MPFS_CCC_POSTDIV23_CR 0x14u + +#define MPFS_CCC_FBDIV_SHIFT 0x00u +#define MPFS_CCC_FBDIV_WIDTH 0x0Cu +#define MPFS_CCC_POSTDIV0_SHIFT 0x08u +#define MPFS_CCC_POSTDIV1_SHIFT 0x18u +#define MPFS_CCC_POSTDIV2_SHIFT MPFS_CCC_POSTDIV0_SHIFT +#define MPFS_CCC_POSTDIV3_SHIFT MPFS_CCC_POSTDIV1_SHIFT +#define MPFS_CCC_POSTDIV_WIDTH 0x06u +#define MPFS_CCC_REFCLK_SEL BIT(6) +#define MPFS_CCC_REFDIV_SHIFT 0x08u +#define MPFS_CCC_REFDIV_WIDTH 0x06u + +#define MPFS_CCC_FIXED_DIV 4 +#define MPFS_CCC_OUTPUTS_PER_PLL 4 +#define MPFS_CCC_REFS_PER_PLL 2 + +struct mpfs_ccc_data { + void __iomem **pll_base; + struct device *dev; + const char *location; + struct clk_hw_onecell_data hw_data; +}; + +struct mpfs_ccc_pll_hw_clock { + void __iomem *base; + const char *name; + const struct clk_parent_data *parents; + unsigned int id; + u32 reg_offset; + u32 shift; + u32 width; + u32 flags; + struct clk_hw hw; + struct clk_init_data init; +}; + +#define to_mpfs_ccc_clk(_hw) container_of(_hw, struct mpfs_ccc_pll_hw_cloc= k, hw) + +/* + * mpfs_ccc_lock prevents anything else from writing to a fabric ccc + * while a software locked register is being written. + */ +static DEFINE_SPINLOCK(mpfs_ccc_lock); + +static const struct clk_parent_data mpfs_ccc_pll0_refs[] =3D { + { .fw_name =3D "pll0_ref0" }, + { .fw_name =3D "pll0_ref1" }, +}; + +static const struct clk_parent_data mpfs_ccc_pll1_refs[] =3D { + { .fw_name =3D "pll1_ref0" }, + { .fw_name =3D "pll1_ref1" }, +}; + +static unsigned long mpfs_ccc_pll_recalc_rate(struct clk_hw *hw, unsigned = long prate) +{ + struct mpfs_ccc_pll_hw_clock *ccc_hw =3D to_mpfs_ccc_clk(hw); + void __iomem *mult_addr =3D ccc_hw->base + ccc_hw->reg_offset; + void __iomem *ref_div_addr =3D ccc_hw->base + MPFS_CCC_REF_CR; + u32 mult, ref_div; + + mult =3D readl_relaxed(mult_addr) >> MPFS_CCC_FBDIV_SHIFT; + mult &=3D clk_div_mask(MPFS_CCC_FBDIV_WIDTH); + ref_div =3D readl_relaxed(ref_div_addr) >> MPFS_CCC_REFDIV_SHIFT; + ref_div &=3D clk_div_mask(MPFS_CCC_REFDIV_WIDTH); + + return prate * mult / (ref_div * MPFS_CCC_FIXED_DIV); +} + +static u8 mpfs_ccc_pll_get_parent(struct clk_hw *hw) +{ + struct mpfs_ccc_pll_hw_clock *ccc_hw =3D to_mpfs_ccc_clk(hw); + void __iomem *pll_cr_addr =3D ccc_hw->base + MPFS_CCC_PLL_CR; + + return !!(readl_relaxed(pll_cr_addr) & MPFS_CCC_REFCLK_SEL); +} + +static const struct clk_ops mpfs_ccc_pll_ops =3D { + .recalc_rate =3D mpfs_ccc_pll_recalc_rate, + .get_parent =3D mpfs_ccc_pll_get_parent, +}; + +#define CLK_CCC_PLL(_id, _parents, _shift, _width, _flags, _offset) { \ + .id =3D _id, \ + .shift =3D _shift, \ + .width =3D _width, \ + .reg_offset =3D _offset, \ + .flags =3D _flags, \ + .parents =3D _parents,\ +} + +static struct mpfs_ccc_pll_hw_clock mpfs_ccc_pll_clks[] =3D { + CLK_CCC_PLL(CLK_CCC_PLL0, mpfs_ccc_pll0_refs, MPFS_CCC_FBDIV_SHIFT, + MPFS_CCC_FBDIV_WIDTH, 0, MPFS_CCC_SSCG_2_CR), + CLK_CCC_PLL(CLK_CCC_PLL1, mpfs_ccc_pll1_refs, MPFS_CCC_FBDIV_SHIFT, + MPFS_CCC_FBDIV_WIDTH, 0, MPFS_CCC_SSCG_2_CR), +}; + +struct mpfs_ccc_out_hw_clock { + struct clk_divider divider; + struct clk_init_data init; + unsigned int id; + u32 reg_offset; +}; + +#define CLK_CCC_OUT(_id, _shift, _width, _flags, _offset) { \ + .id =3D _id, \ + .divider.shift =3D _shift, \ + .divider.width =3D _width, \ + .reg_offset =3D _offset, \ + .divider.flags =3D _flags, \ + .divider.lock =3D &mpfs_ccc_lock, \ +} + +static struct mpfs_ccc_out_hw_clock mpfs_ccc_pll0out_clks[] =3D { + CLK_CCC_OUT(CLK_CCC_PLL0_OUT0, MPFS_CCC_POSTDIV0_SHIFT, MPFS_CCC_POSTDIV_= WIDTH, + CLK_DIVIDER_ONE_BASED, MPFS_CCC_POSTDIV01_CR), + CLK_CCC_OUT(CLK_CCC_PLL0_OUT1, MPFS_CCC_POSTDIV1_SHIFT, MPFS_CCC_POSTDIV_= WIDTH, + CLK_DIVIDER_ONE_BASED, MPFS_CCC_POSTDIV01_CR), + CLK_CCC_OUT(CLK_CCC_PLL0_OUT2, MPFS_CCC_POSTDIV2_SHIFT, MPFS_CCC_POSTDIV_= WIDTH, + CLK_DIVIDER_ONE_BASED, MPFS_CCC_POSTDIV23_CR), + CLK_CCC_OUT(CLK_CCC_PLL0_OUT3, MPFS_CCC_POSTDIV3_SHIFT, MPFS_CCC_POSTDIV_= WIDTH, + CLK_DIVIDER_ONE_BASED, MPFS_CCC_POSTDIV23_CR), +}; + +static struct mpfs_ccc_out_hw_clock mpfs_ccc_pll1out_clks[] =3D { + CLK_CCC_OUT(CLK_CCC_PLL1_OUT0, MPFS_CCC_POSTDIV0_SHIFT, MPFS_CCC_POSTDIV_= WIDTH, 0, + MPFS_CCC_POSTDIV01_CR), + CLK_CCC_OUT(CLK_CCC_PLL1_OUT1, MPFS_CCC_POSTDIV1_SHIFT, MPFS_CCC_POSTDIV_= WIDTH, 0, + MPFS_CCC_POSTDIV01_CR), + CLK_CCC_OUT(CLK_CCC_PLL1_OUT2, MPFS_CCC_POSTDIV2_SHIFT, MPFS_CCC_POSTDIV_= WIDTH, 0, + MPFS_CCC_POSTDIV23_CR), + CLK_CCC_OUT(CLK_CCC_PLL1_OUT3, MPFS_CCC_POSTDIV3_SHIFT, MPFS_CCC_POSTDIV_= WIDTH, 0, + MPFS_CCC_POSTDIV23_CR), +}; + +static struct mpfs_ccc_out_hw_clock *mpfs_ccc_pllout_clks[] =3D { + mpfs_ccc_pll0out_clks, mpfs_ccc_pll1out_clks +}; + +static int mpfs_ccc_register_outputs(struct device *dev, struct mpfs_ccc_o= ut_hw_clock *out_hws, + unsigned int num_clks, struct mpfs_ccc_data *data, + struct mpfs_ccc_pll_hw_clock *parent) +{ + int ret; + + for (unsigned int i =3D 0; i < num_clks; i++) { + struct mpfs_ccc_out_hw_clock *out_hw =3D &out_hws[i]; + char *name =3D devm_kzalloc(dev, 13, GFP_KERNEL); + + snprintf(name, 19, "%s_out%u", parent->name, i); + out_hw->divider.hw.init =3D CLK_HW_INIT_HW(name, &parent->hw, &clk_divid= er_ops, 0); + out_hw->divider.reg =3D data->pll_base[i / MPFS_CCC_OUTPUTS_PER_PLL] + + out_hw->reg_offset; + + ret =3D devm_clk_hw_register(dev, &out_hw->divider.hw); + if (ret) + return dev_err_probe(dev, ret, "failed to register clock id: %d\n", + out_hw->id); + + data->hw_data.hws[out_hw->id] =3D &out_hw->divider.hw; + } + + return 0; +} + +#define CLK_HW_INIT_PARENTS_DATA_FIXED_SIZE(_name, _parents, _ops, _flags)= \ + (&(struct clk_init_data) { \ + .flags =3D _flags, \ + .name =3D _name, \ + .parent_data =3D _parents, \ + .num_parents =3D MPFS_CCC_REFS_PER_PLL, \ + .ops =3D _ops, \ + }) + +static int mpfs_ccc_register_plls(struct device *dev, struct mpfs_ccc_pll_= hw_clock *pll_hws, + unsigned int num_clks, struct mpfs_ccc_data *data) +{ + int ret; + + for (unsigned int i =3D 0; i < num_clks; i++) { + struct mpfs_ccc_pll_hw_clock *pll_hw =3D &pll_hws[i]; + char *name =3D devm_kzalloc(dev, 8, GFP_KERNEL); + + snprintf(name, 14, "%s_pll%u", dev->of_node->name, i); + pll_hw->name =3D (const char *)name; + pll_hw->base =3D data->pll_base[i]; + pll_hw->hw.init =3D CLK_HW_INIT_PARENTS_DATA_FIXED_SIZE(pll_hw->name, + pll_hw->parents, + &mpfs_ccc_pll_ops, 0); + + ret =3D devm_clk_hw_register(dev, &pll_hw->hw); + if (ret) + return dev_err_probe(dev, ret, "failed to register ccc id: %d\n", + pll_hw->id); + + data->hw_data.hws[pll_hw->id] =3D &pll_hw->hw; + + ret =3D mpfs_ccc_register_outputs(dev, mpfs_ccc_pllout_clks[i], + MPFS_CCC_OUTPUTS_PER_PLL, data, pll_hw); + if (ret) + return ret; + } + + return 0; +} + +static int mpfs_ccc_probe(struct platform_device *pdev) +{ + struct mpfs_ccc_data *clk_data; + void __iomem *pll_base[ARRAY_SIZE(mpfs_ccc_pll_clks)]; + unsigned int num_clks; + int ret; + + num_clks =3D ARRAY_SIZE(mpfs_ccc_pll_clks) + ARRAY_SIZE(mpfs_ccc_pll0out_= clks) + + ARRAY_SIZE(mpfs_ccc_pll1out_clks); + + clk_data =3D devm_kzalloc(&pdev->dev, struct_size(clk_data, hw_data.hws, = num_clks), + GFP_KERNEL); + if (!clk_data) + return -ENOMEM; + + pll_base[0] =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(pll_base[0])) + return PTR_ERR(pll_base[0]); + + pll_base[1] =3D devm_platform_ioremap_resource(pdev, 1); + if (IS_ERR(pll_base[1])) + return PTR_ERR(pll_base[1]); + + clk_data->pll_base =3D pll_base; + + clk_data->dev =3D &pdev->dev; + + ret =3D mpfs_ccc_register_plls(clk_data->dev, mpfs_ccc_pll_clks, + ARRAY_SIZE(mpfs_ccc_pll_clks), clk_data); + if (ret) + return ret; + + ret =3D devm_of_clk_add_hw_provider(clk_data->dev, of_clk_hw_onecell_get, + &clk_data->hw_data); + if (ret) + return ret; + + return ret; +} + +static const struct of_device_id mpfs_ccc_of_match_table[] =3D { + { .compatible =3D "microchip,mpfs-ccc", }, + {} +}; +MODULE_DEVICE_TABLE(of, mpfs_ccc_of_match_table); + +static struct platform_driver mpfs_ccc_driver =3D { + .probe =3D mpfs_ccc_probe, + .driver =3D { + .name =3D "microchip-mpfs-ccc", + .of_match_table =3D mpfs_ccc_of_match_table, + }, +}; + +static int __init clk_ccc_init(void) +{ + return platform_driver_register(&mpfs_ccc_driver); +} +core_initcall(clk_ccc_init); + +static void __exit clk_ccc_exit(void) +{ + platform_driver_unregister(&mpfs_ccc_driver); +} +module_exit(clk_ccc_exit); + +MODULE_DESCRIPTION("Microchip PolarFire SoC Clock Conditioning Circuitry D= river"); +MODULE_AUTHOR("Conor Dooley "); +MODULE_LICENSE("GPL"); --=20 2.36.1 From nobody Fri Apr 10 20:19:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96475C32772 for ; Fri, 19 Aug 2022 12:28:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348971AbiHSM2d (ORCPT ); Fri, 19 Aug 2022 08:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348952AbiHSM2Z (ORCPT ); Fri, 19 Aug 2022 08:28:25 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E26DC45063; Fri, 19 Aug 2022 05:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1660912102; x=1692448102; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FUtbXHH8kiRaqk1zOS5U2LUqUUmJtpAwGyEnqH6QJxI=; b=ZqjkwrltXse2QUPWLY2WWUAUAg0UCsd5JE0KR3zO4g5NnxJfXqIAPNL2 jF1AMld0gnOn52cdJYLG76R1ZdahQH/yQ1P5AgAsaRH/FznKdPMISeb7A mVcUiCx7zKtbkcc7MB7pROzRV7iPs51qhnlZO0d96zY5XZXMtnWziwpLh EA3xWjbKhnzKGUEWlIiYwa08vs17a2meXUU2DtUdXHgI2c2V5czjEQHck INVmK0RxbF/CmeHZe77RqI162kj5zIpVWSWlkCi93ktqiBGiPCtsz7Jq9 nX3AYiuDyV26h4sUwAO8vdn73xI/UFR2hr4qOxtbxQwxafEqcUGvzcVf1 A==; X-IronPort-AV: E=Sophos;i="5.93,247,1654585200"; d="scan'208";a="109780591" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 19 Aug 2022 05:28:21 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 19 Aug 2022 05:28:19 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 19 Aug 2022 05:28:17 -0700 From: Conor Dooley To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Conor Dooley , Daire McNamara CC: Paul Walmsley , Albert Ou , , , , Subject: [PATCH 5/6] dt-bindings: riscv: microchip: document icicle reference design Date: Fri, 19 Aug 2022 13:22:59 +0100 Message-ID: <20220819122259.183600-6-conor.dooley@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220819122259.183600-1-conor.dooley@microchip.com> References: <20220819122259.183600-1-conor.dooley@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a new compatible for the icicle kit reference design's 22.09 release, which made some changes to the memory map - including adding the ability to read the CCCs via the system controller bus. Technically that was always possible, but the specific CC chosen could vary per run of the synthesis tool. Hopefully this is the last reference design version impacting the memory map. Signed-off-by: Conor Dooley Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/riscv/microchip.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/riscv/microchip.yaml b/Docum= entation/devicetree/bindings/riscv/microchip.yaml index 1aa7336a9672..928ce4d4e087 100644 --- a/Documentation/devicetree/bindings/riscv/microchip.yaml +++ b/Documentation/devicetree/bindings/riscv/microchip.yaml @@ -21,6 +21,7 @@ properties: - enum: - microchip,mpfs-icicle-kit - microchip,mpfs-icicle-reference-rtlv2203 + - microchip,mpfs-icicle-reference-rtlv2209 - sundance,polarberry - const: microchip,mpfs =20 --=20 2.36.1 From nobody Fri Apr 10 20:19:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FBA5C32774 for ; Fri, 19 Aug 2022 12:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348978AbiHSM2m (ORCPT ); Fri, 19 Aug 2022 08:28:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348970AbiHSM2d (ORCPT ); Fri, 19 Aug 2022 08:28:33 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4577572B5F; Fri, 19 Aug 2022 05:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1660912112; x=1692448112; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2Nm7jyxD/fyaId3huaPt8VqEfpZF+UJyBdpgKFruHqQ=; b=loX+dJESavnViRL0Bx4NFslIsfo2A+B18Q3wHhF3cIZdt6H9rtUzvs5z pVL6EfjaJVOYlIrd7y0UwVbSGxrWyaWkWBBpjxINbqa0nHgBNzlxdiiag vYSjw+UMikmWF6JeyhUovrYN/GRdbsBtF6ZEmoAFrasfx5WQZb3W2K1+4 bYGieZUBMeFagjXoUkFg1w+9NQIIjBLi4RTUix/uNckLDUip7obKdztM8 Mahz31JcVWPyemZvHkWRAIswhtLSBny/jK2BftIIOPdmRn2l42MWdjbUp dXkTEGyLDxw32EYfJINKOYqVKPgilhfg3MNH/Q6GDoC58QP7P6O+OHxHu w==; X-IronPort-AV: E=Sophos;i="5.93,247,1654585200"; d="scan'208";a="109780604" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 19 Aug 2022 05:28:31 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 19 Aug 2022 05:28:22 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 19 Aug 2022 05:28:20 -0700 From: Conor Dooley To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Conor Dooley , Daire McNamara CC: Paul Walmsley , Albert Ou , , , , Subject: [PATCH 6/6] riscv: dts: microchip: add the mpfs' fabric clock control Date: Fri, 19 Aug 2022 13:23:00 +0100 Message-ID: <20220819122259.183600-7-conor.dooley@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220819122259.183600-1-conor.dooley@microchip.com> References: <20220819122259.183600-1-conor.dooley@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The "fabric clocks" in current PolarFire SoC device trees are not really fixed clocks. Their frequency is set by the bitstream, so having them located in -fabric.dtsi is not a problem - they're just as "fixed" as the IP blocks etc used in the FPGA fabric. However, their configuration can be read at runtime (and to an extent they can be controlled, although the intended usage is static configurations set by the bitstream) through the system controller bus. In the v2209 reference design a single CCC (north-west corner) is enabled, using a 50 MHz off-chip oscillator as its reference. Updating to the v2209 reference design is required. Signed-off-by: Conor Dooley --- .../dts/microchip/mpfs-icicle-kit-fabric.dtsi | 27 +++++++++------ .../boot/dts/microchip/mpfs-icicle-kit.dts | 4 +++ .../dts/microchip/mpfs-polarberry-fabric.dtsi | 5 +++ arch/riscv/boot/dts/microchip/mpfs.dtsi | 34 +++++++++++++++++-- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi b/ar= ch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi index 0d28858b83f2..f17cb00df467 100644 --- a/arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi +++ b/arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi @@ -2,14 +2,14 @@ /* Copyright (c) 2020-2021 Microchip Technology Inc */ =20 / { - compatible =3D "microchip,mpfs-icicle-reference-rtlv2203", "microchip,mpf= s"; + compatible =3D "microchip,mpfs-icicle-reference-rtlv2209", "microchip,mpf= s"; =20 core_pwm0: pwm@41000000 { compatible =3D "microchip,corepwm-rtl-v4"; reg =3D <0x0 0x41000000 0x0 0xF0>; microchip,sync-update-mask =3D /bits/ 32 <0>; #pwm-cells =3D <2>; - clocks =3D <&fabric_clk3>; + clocks =3D <&ccc_nw CLK_CCC_PLL0_OUT0>; status =3D "disabled"; }; =20 @@ -18,22 +18,29 @@ i2c2: i2c@44000000 { reg =3D <0x0 0x44000000 0x0 0x1000>; #address-cells =3D <1>; #size-cells =3D <0>; - clocks =3D <&fabric_clk3>; + clocks =3D <&ccc_nw CLK_CCC_PLL0_OUT3>; interrupt-parent =3D <&plic>; interrupts =3D <122>; clock-frequency =3D <100000>; status =3D "disabled"; }; =20 - fabric_clk3: fabric-clk3 { + refclk_ccc: cccrefclk { compatible =3D "fixed-clock"; #clock-cells =3D <0>; - clock-frequency =3D <62500000>; }; +}; =20 - fabric_clk1: fabric-clk1 { - compatible =3D "fixed-clock"; - #clock-cells =3D <0>; - clock-frequency =3D <125000000>; - }; +&ccc_nw { + clocks =3D <&refclk_ccc>, <&refclk_ccc>, <&refclk_ccc>, <&refclk_ccc>, + <&refclk_ccc>, <&refclk_ccc>; + clock-names =3D "pll0_ref0", "pll0_ref1", "pll1_ref0", "pll1_ref1", + "dll0_ref", "dll1_ref"; + status =3D "okay"; +}; + +&pcie { + clocks =3D <&ccc_nw CLK_CCC_PLL0_OUT0>, <&ccc_nw CLK_CCC_PLL0_OUT1>, + <&ccc_nw CLK_CCC_PLL0_OUT3>; + clock-names =3D "fic0", "fic1", "fic3"; }; diff --git a/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts b/arch/riscv= /boot/dts/microchip/mpfs-icicle-kit.dts index 044982a11df5..d361d1e38b16 100644 --- a/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts +++ b/arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts @@ -140,6 +140,10 @@ &refclk { clock-frequency =3D <125000000>; }; =20 +&refclk_ccc { + clock-frequency =3D <50000000>; +}; + &rtc { status =3D "okay"; }; diff --git a/arch/riscv/boot/dts/microchip/mpfs-polarberry-fabric.dtsi b/ar= ch/riscv/boot/dts/microchip/mpfs-polarberry-fabric.dtsi index 49380c428ec9..3beb450b4259 100644 --- a/arch/riscv/boot/dts/microchip/mpfs-polarberry-fabric.dtsi +++ b/arch/riscv/boot/dts/microchip/mpfs-polarberry-fabric.dtsi @@ -14,3 +14,8 @@ fabric_clk1: fabric-clk1 { clock-frequency =3D <125000000>; }; }; + +&pcie { + clocks =3D <&fabric_clk1>, <&fabric_clk1>, <&fabric_clk3>; + clock-names =3D "fic0", "fic1", "fic3"; +}; diff --git a/arch/riscv/boot/dts/microchip/mpfs.dtsi b/arch/riscv/boot/dts/= microchip/mpfs.dtsi index 499c2e63ad35..dd15b6d1a3c9 100644 --- a/arch/riscv/boot/dts/microchip/mpfs.dtsi +++ b/arch/riscv/boot/dts/microchip/mpfs.dtsi @@ -236,6 +236,38 @@ clkcfg: clkcfg@20002000 { #clock-cells =3D <1>; }; =20 + ccc_se: cccseclk@38010000 { + compatible =3D "microchip,mpfs-ccc"; + reg =3D <0x0 0x38010000 0x0 0x1000>, <0x0 0x38020000 0x0 0x1000>, + <0x0 0x39010000 0x0 0x1000>, <0x0 0x39020000 0x0 0x1000>; + #clock-cells =3D <1>; + status =3D "disabled"; + }; + + ccc_ne: cccneclk@38040000 { + compatible =3D "microchip,mpfs-ccc"; + reg =3D <0x0 0x38040000 0x0 0x1000>, <0x0 0x38080000 0x0 0x1000>, + <0x0 0x39040000 0x0 0x1000>, <0x0 0x39080000 0x0 0x1000>; + #clock-cells =3D <1>; + status =3D "disabled"; + }; + + ccc_nw: cccnwclk@38100000 { + compatible =3D "microchip,mpfs-ccc"; + reg =3D <0x0 0x38100000 0x0 0x1000>, <0x0 0x38200000 0x0 0x1000>, + <0x0 0x39100000 0x0 0x1000>, <0x0 0x39200000 0x0 0x1000>; + #clock-cells =3D <1>; + status =3D "disabled"; + }; + + ccc_sw: cccswclk@38400000 { + compatible =3D "microchip,mpfs-ccc"; + reg =3D <0x0 0x38400000 0x0 0x1000>, <0x0 0x38800000 0x0 0x1000>, + <0x0 0x39400000 0x0 0x1000>, <0x0 0x39800000 0x0 0x1000>; + #clock-cells =3D <1>; + status =3D "disabled"; + }; + mmuart0: serial@20000000 { compatible =3D "ns16550a"; reg =3D <0x0 0x20000000 0x0 0x400>; @@ -480,8 +512,6 @@ pcie: pcie@2000000000 { <0 0 0 3 &pcie_intc 2>, <0 0 0 4 &pcie_intc 3>; interrupt-map-mask =3D <0 0 0 7>; - clocks =3D <&fabric_clk1>, <&fabric_clk1>, <&fabric_clk3>; - clock-names =3D "fic0", "fic1", "fic3"; ranges =3D <0x3000000 0x0 0x8000000 0x20 0x8000000 0x0 0x80000000>; msi-parent =3D <&pcie>; msi-controller; --=20 2.36.1