From patchwork Thu Mar 16 03:05:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xingyu Wu X-Patchwork-Id: 70552 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp257435wrt; Wed, 15 Mar 2023 20:10:39 -0700 (PDT) X-Google-Smtp-Source: AK7set/FzgwhOchAH8nFtKL4ODnAPXNja9knbYSwBB0G/BkPTWd15ezjT4Wkf+8FPEJZFA75sh0v X-Received: by 2002:a17:90b:4b84:b0:23d:3c7b:8684 with SMTP id lr4-20020a17090b4b8400b0023d3c7b8684mr2193096pjb.41.1678936239586; Wed, 15 Mar 2023 20:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678936239; cv=none; d=google.com; s=arc-20160816; b=Tswgx7WjOV336DbT1Pp6GH6L65pwt4LEYGWtljcXQ2s59Ln2FNw9Tgo3Ur0awUbPnA KOH+Uqk5B434vduBv41gG62n6asF+gFipQzheETWTyF48sE0vDtbIRovBAwIviz7o9k6 xgPX426DqJS3YTYe7BUTCiI38WjKOmUdnJAlm3G0QEj+LWwVdT9MiN0UHjVKWoW6FgYH CtsKFR8KAqcQ5b+HsMFX9Yd/YIrYZFiz0ezuI3/G90IFMw3OcJlVdCXxLNs9Dq+KIlL6 D7rJ+4gEDKimNj7hCCoHGcwuCjke1L1j7SOyTkHjfnNOSDfB3mQJbKZW5WBnARrYmSfA 661A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=E9bThVpg+mLWnONwxd8bQaHmZUZNWq/8h5NfZf80Iw8=; b=yw/0ZaYZdu0jyViN/dbsgdyC2uthc+MUxOMbeMC6E0IjtyTmAeNj6uzYqn8KtUnypp n1TvFEhBmomSLxTPGAVU36kzXNqwdIE4JY1KM7S3s9G3maCR/S3l9IiTEQ8TJ7uN+KC4 mNCbTLRbIPcSJbo7tzr19/j1PEqIuKVecbT5hyRG2RwaquReMHSo1FJRbPZA0HW4htoZ xWmqoBthw9yee/u5t9iKg9qena2mNngvjA7BuxPlXfgJGHN/bf5opqiTVl1lzDACGJJA lRqEMnOaqNwJ2KgQu/LUDfGYeQjV1AY2haqhZmCLYPGhaMGl8Am+vlcb2rUByjGiGipY 73Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a17090a9dc500b0023b4e4bc44asi3332720pjv.149.2023.03.15.20.10.24; Wed, 15 Mar 2023 20:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229691AbjCPDFj convert rfc822-to-8bit (ORCPT + 99 others); Wed, 15 Mar 2023 23:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229827AbjCPDFX (ORCPT ); Wed, 15 Mar 2023 23:05:23 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88429422A; Wed, 15 Mar 2023 20:05:21 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id D7FF924E292; Thu, 16 Mar 2023 11:05:18 +0800 (CST) Received: from EXMBX061.cuchost.com (172.16.6.61) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 16 Mar 2023 11:05:17 +0800 Received: from localhost.localdomain (113.72.145.194) by EXMBX061.cuchost.com (172.16.6.61) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 16 Mar 2023 11:05:15 +0800 From: Xingyu Wu To: , , "Michael Turquette" , Stephen Boyd , Krzysztof Kozlowski , Philipp Zabel , Conor Dooley , "Emil Renner Berthing" CC: Rob Herring , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Xingyu Wu , William Qiu , , Subject: [PATCH v2 1/6] dt-bindings: clock: Add StarFive JH7110 PLL clock generator Date: Thu, 16 Mar 2023 11:05:09 +0800 Message-ID: <20230316030514.137427-2-xingyu.wu@starfivetech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230316030514.137427-1-xingyu.wu@starfivetech.com> References: <20230316030514.137427-1-xingyu.wu@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [113.72.145.194] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX061.cuchost.com (172.16.6.61) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760492245870170939?= X-GMAIL-MSGID: =?utf-8?q?1760492245870170939?= Add bindings for the PLL clock generator on the JH7110 RISC-V SoC. Signed-off-by: Xingyu Wu Reviewed-by: Krzysztof Kozlowski --- .../bindings/clock/starfive,jh7110-pll.yaml | 46 +++++++++++++++++++ .../dt-bindings/clock/starfive,jh7110-crg.h | 6 +++ 2 files changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh7110-pll.yaml diff --git a/Documentation/devicetree/bindings/clock/starfive,jh7110-pll.yaml b/Documentation/devicetree/bindings/clock/starfive,jh7110-pll.yaml new file mode 100644 index 000000000000..9397516f60ba --- /dev/null +++ b/Documentation/devicetree/bindings/clock/starfive,jh7110-pll.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/starfive,jh7110-pll.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 PLL Clock Generator + +description: + This PLL are high speed, low jitter frequency synthesizers in JH7110. + Each PLL clocks work in integer mode or fraction mode by some dividers, + and the configuration registers and dividers are set in several syscon + registers. So pll node should be a child of SYS-SYSCON node. + The formula for calculating frequency is that, + Fvco = Fref * (NI + NF) / M / Q1 + +maintainers: + - Xingyu Wu + +properties: + compatible: + const: starfive,jh7110-pll + + clocks: + maxItems: 1 + description: Main Oscillator (24 MHz) + + '#clock-cells': + const: 1 + description: + See for valid indices. + +required: + - compatible + - clocks + - '#clock-cells' + +additionalProperties: false + +examples: + - | + pllclk: pll-clock-controller { + compatible = "starfive,jh7110-pll"; + clocks = <&osc>; + #clock-cells = <1>; + }; diff --git a/include/dt-bindings/clock/starfive,jh7110-crg.h b/include/dt-bindings/clock/starfive,jh7110-crg.h index 06257bfd9ac1..086a6ddcf380 100644 --- a/include/dt-bindings/clock/starfive,jh7110-crg.h +++ b/include/dt-bindings/clock/starfive,jh7110-crg.h @@ -6,6 +6,12 @@ #ifndef __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__ #define __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__ +/* PLL clocks */ +#define JH7110_CLK_PLL0_OUT 0 +#define JH7110_CLK_PLL1_OUT 1 +#define JH7110_CLK_PLL2_OUT 2 +#define JH7110_PLLCLK_END 3 + /* SYSCRG clocks */ #define JH7110_SYSCLK_CPU_ROOT 0 #define JH7110_SYSCLK_CPU_CORE 1