Message ID | 20230315072902.9298-9-ychuang570808@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2189045wrd; Wed, 15 Mar 2023 00:43:40 -0700 (PDT) X-Google-Smtp-Source: AK7set/VJ2DUNnTcs2+SevL4cvQiabQB++BTNfU+uH2nXaJ66Iz4kk0s0febTUIUkspRYMvHtTWb X-Received: by 2002:a05:6a00:1912:b0:594:1f1c:3d3a with SMTP id y18-20020a056a00191200b005941f1c3d3amr18390417pfi.15.1678866220414; Wed, 15 Mar 2023 00:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678866220; cv=none; d=google.com; s=arc-20160816; b=HLz+2kE8EvcNAZD1nUz9cAbtUS5cvSkVJneYcOQJ5Cb9waUlx95ezw/CBuc+Lb7iXV dBoIpJKGQQtRGRb5gybmEL27uSR84GWAYWO4z7AFAJXjRacZhngJ+lHlmF9UIznasT9x DSJh6ACBFLUnLhioSgFAES+JSyeJq6nG9POXuTOi7cGg1h1vaOW6TW8id4XZDTZFY/cS QP+vl56QCvT26ZEk9pZ11mPoIxo/1qB64thtf6TKB9eLcm27jlnpNeA4Zabh4wi1eneI n18j9g7ahXY7vKFmBz+4bIJUB7tSvDOMN3S04JRk2A6j1P8V/oCylvBPauj0+/ktbvNS SUDQ== 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 :dkim-signature; bh=FPFgK3X39dXISj3hHbLpDm92COtr7gUeJ96GRH4aaGI=; b=jhAjHfeATzYqcfG8o32GfFnk7v2+iZLMWsfTbRWFxuCBnH+DMJFjEpvADzy4P0cI6y Q2Ud0PuHv9mrT+VpUkJPv73PYouHkuTjx0Wtx+fHzXfNljOGVUg2V4k8XPZb/8v01FEI vCVZENkNklN5s/NvGe71V5Whn0S5mmSbYRfaNGf+2dkvwz645qVUqgyWaujFlJJ0HaFI xcwQgMfJpHBBiYMUcmOKXKbq2INl++TQkf8FNrhe4PLw1UGHWKijB7MSpAYOtAdUFixl 0oyp1El1LiIU57gF2qzkKePsCsbJ4aXGs8XTfsH9vm6L2yV8uXwU/M80CNFc7icGTDvB VfDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dqmoNOyo; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a056a00178c00b006257ed5354bsi2869183pfg.195.2023.03.15.00.43.27; Wed, 15 Mar 2023 00:43:40 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dqmoNOyo; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231775AbjCOHbk (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Wed, 15 Mar 2023 03:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231664AbjCOHa2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Mar 2023 03:30:28 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EBD0222E2; Wed, 15 Mar 2023 00:29:35 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id v21so8986843ple.9; Wed, 15 Mar 2023 00:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678865369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FPFgK3X39dXISj3hHbLpDm92COtr7gUeJ96GRH4aaGI=; b=dqmoNOyoISBXej1LzyLk9c0SV7voNOz6xI5VYdwXghfpDb+7NY7367qwlzCD8T5DnK pRJAjbGHPsnoPCyUWw5ud/p+X6MT3PNO74Bo+dkX14sywhikAGVeh7KT6TQkY+HfwRaA ODnoQs087B5BDuXRk/0xVHv5zXmZrGlo2yWaacweoc+Ns7jHJ24VshckqbBr1xYrRUcp pqo9/JGuej454709jck82NMtsalxfQ9f1oVVsL6RbAhxY+sWiEpImfLokFqHRB6gx9sH 5cmcFOuZh0Fo4ET9jI7tuIa84REuwnw4IglHhdyKfMVaJIz5pvIuzaJg1Xr31PKovObC ZcFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678865369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FPFgK3X39dXISj3hHbLpDm92COtr7gUeJ96GRH4aaGI=; b=LUxy89qZE/FXNwYSFwrZnoNfY4pJc4BY3rf5IXoAAdVLjq73itNkOEbCUoLawu4Rkf MwhR5A/AGRWTiShXDrVaRgu1M/fngcfQ2g5zJAYSGRxuT+AQW4Q0GH1FughsQyqDXhG8 1McUwYplmYnJL1pKMV/vPS1D5nqBLOmcdT/udLW6BzxjNPuvV0XlpROGKPTWskv6X6SS bcH4ibaJ94cXGBH91qmmtgCfvmG+mMI4pEwFPTPDflN5htu8/QoDErrWA2sqMyZDIS7G jIoAaqIHJOLsywiETL+sbwsBv2jkkW8B4cXXFblR+NRClrb5sVE5oR4B2WEBGYz+4lSW f9QA== X-Gm-Message-State: AO0yUKVO9cUyjfVdBVvzg319LJR1ew2M+GTOU/XyWN4L8gP1mklCcRM7 7MISga8Yfbqfgq0pLIvK/3X+kiK/xearaQ== X-Received: by 2002:a17:903:2310:b0:19a:b588:6fe2 with SMTP id d16-20020a170903231000b0019ab5886fe2mr1453175plh.13.1678865368810; Wed, 15 Mar 2023 00:29:28 -0700 (PDT) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id kz11-20020a170902f9cb00b001a0667822c8sm2740003plb.94.2023.03.15.00.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 00:29:28 -0700 (PDT) From: Jacky Huang <ychuang570808@gmail.com> To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, schung@nuvoton.com, Jacky Huang <ychuang3@nuvoton.com> Subject: [PATCH 08/15] dt-bindings: clock: Document ma35d1 clock controller bindings Date: Wed, 15 Mar 2023 07:28:55 +0000 Message-Id: <20230315072902.9298-9-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230315072902.9298-1-ychuang570808@gmail.com> References: <20230315072902.9298-1-ychuang570808@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760418825742147667?= X-GMAIL-MSGID: =?utf-8?q?1760418825742147667?= |
Series |
Introduce Nuvoton ma35d1 SoC
|
|
Commit Message
Jacky Huang
March 15, 2023, 7:28 a.m. UTC
From: Jacky Huang <ychuang3@nuvoton.com> Add documentation to describe nuvoton ma35d1 clock driver bindings. Signed-off-by: Jacky Huang <ychuang3@nuvoton.com> --- .../bindings/clock/nuvoton,ma35d1-clk.yaml | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml
Comments
Quoting Jacky Huang (2023-03-15 00:28:55) > diff --git a/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml > new file mode 100644 > index 000000000000..5c2dea071b38 > --- /dev/null > +++ b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml > @@ -0,0 +1,83 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/clock/nuvoton,ma35d1-clk.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Nuvoton MA35D1 Clock Controller Module Binding Binding is redundant. > + > +maintainers: > + - Chi-Fang Li <cfli0@nuvoton.com> > + - Jacky Huang <ychuang3@nuvoton.com> > + > +description: | > + The MA35D1 clock controller generates clocks for the whole chip, > + including system clocks and all peripheral clocks. > + > + See also: > + include/dt-bindings/clock/ma35d1-clk.h > + > +properties: > + compatible: > + items: > + - const: nuvoton,ma35d1-clk > + - const: syscon Does it really need to be a syscon? > + > + reg: > + maxItems: 1 > + > + "#clock-cells": > + const: 1 > + > + clocks: > + maxItems: 1 > + > + clock-names: > + const: clk_hxt > + > + assigned-clocks: > + maxItems: 5 > + > + assigned-clock-rates: > + maxItems: 5 I hope the assigned clocks properties can be left out of this doc. > + > + nuvoton,pll-mode: > + description: > + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, > + EPLL, and VPLL in sequential. The operation mode value 0 is for > + integer mode, 1 is for fractional mode, and 2 is for spread > + spectrum mode. > + $ref: /schemas/types.yaml#/definitions/uint32-array > + maxItems: 5 > + items: > + minimum: 0 > + maximum: 2 Why not use a string? > + > + nuvoton,sys: > + description: > + Phandle to the system management controller. > + $ref: "/schemas/types.yaml#/definitions/phandle-array" > + > +required: > + - compatible > + - reg > + - "#clock-cells" > + - clocks > + - clock-names > + - nuvoton,sys > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/clock/nuvoton,ma35d1-clk.h> No need to include this header right? > + > + clk: clock-controller@40460200 { Drop the label? > + compatible = "nuvoton,ma35d1-clk", "syscon"; > + reg = <0x40460200 0x100>; > + #clock-cells = <1>; > + clocks = <&clk_hxt>; > + clock-names = "clk_hxt"; > + nuvoton,sys = <&sys>; > + };
Dear Stephen, Thanks for your review. On 2023/3/16 上午 05:59, Stephen Boyd wrote: > Quoting Jacky Huang (2023-03-15 00:28:55) >> diff --git a/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml >> new file mode 100644 >> index 000000000000..5c2dea071b38 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml >> @@ -0,0 +1,83 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/clock/nuvoton,ma35d1-clk.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Nuvoton MA35D1 Clock Controller Module Binding > Binding is redundant. I will remove this word. >> + >> +maintainers: >> + - Chi-Fang Li <cfli0@nuvoton.com> >> + - Jacky Huang <ychuang3@nuvoton.com> >> + >> +description: | >> + The MA35D1 clock controller generates clocks for the whole chip, >> + including system clocks and all peripheral clocks. >> + >> + See also: >> + include/dt-bindings/clock/ma35d1-clk.h >> + >> +properties: >> + compatible: >> + items: >> + - const: nuvoton,ma35d1-clk >> + - const: syscon > Does it really need to be a syscon? Some registers of the clock controller are locked against writing. Before writing, the lock must be unlocked through the system controller. So syscon is needed. >> + >> + reg: >> + maxItems: 1 >> + >> + "#clock-cells": >> + const: 1 >> + >> + clocks: >> + maxItems: 1 >> + >> + clock-names: >> + const: clk_hxt >> + >> + assigned-clocks: >> + maxItems: 5 >> + >> + assigned-clock-rates: >> + maxItems: 5 > I hope the assigned clocks properties can be left out of this doc. Sure, we will remove it. >> + >> + nuvoton,pll-mode: >> + description: >> + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, >> + EPLL, and VPLL in sequential. The operation mode value 0 is for >> + integer mode, 1 is for fractional mode, and 2 is for spread >> + spectrum mode. >> + $ref: /schemas/types.yaml#/definitions/uint32-array >> + maxItems: 5 >> + items: >> + minimum: 0 >> + maximum: 2 > Why not use a string? OK, we'll use strings instead. >> + >> + nuvoton,sys: >> + description: >> + Phandle to the system management controller. >> + $ref: "/schemas/types.yaml#/definitions/phandle-array" >> + >> +required: >> + - compatible >> + - reg >> + - "#clock-cells" >> + - clocks >> + - clock-names >> + - nuvoton,sys >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/clock/nuvoton,ma35d1-clk.h> > No need to include this header right? Yes, I will remove this header in the next version. > >> + >> + clk: clock-controller@40460200 { > Drop the label? OK, I will drop this label in the next version. > >> + compatible = "nuvoton,ma35d1-clk", "syscon"; >> + reg = <0x40460200 0x100>; >> + #clock-cells = <1>; >> + clocks = <&clk_hxt>; >> + clock-names = "clk_hxt"; >> + nuvoton,sys = <&sys>; >> + }; Best Regards, Jacky Huang
On 15/03/2023 08:28, Jacky Huang wrote: > From: Jacky Huang <ychuang3@nuvoton.com> > > Add documentation to describe nuvoton ma35d1 clock driver bindings. Subject: drop second/last, redundant "bindings". The "dt-bindings" prefix is already stating that these are bindings. > > Signed-off-by: Jacky Huang <ychuang3@nuvoton.com> > --- > .../bindings/clock/nuvoton,ma35d1-clk.yaml | 83 +++++++++++++++++++ > 1 file changed, 83 insertions(+) > create mode 100644 Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml > > diff --git a/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml > new file mode 100644 > index 000000000000..5c2dea071b38 > --- /dev/null > +++ b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml > @@ -0,0 +1,83 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/clock/nuvoton,ma35d1-clk.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Nuvoton MA35D1 Clock Controller Module Binding > + > +maintainers: > + - Chi-Fang Li <cfli0@nuvoton.com> > + - Jacky Huang <ychuang3@nuvoton.com> > + > +description: | > + The MA35D1 clock controller generates clocks for the whole chip, > + including system clocks and all peripheral clocks. > + > + See also: > + include/dt-bindings/clock/ma35d1-clk.h > + > +properties: > + compatible: > + items: > + - const: nuvoton,ma35d1-clk > + - const: syscon > + > + reg: > + maxItems: 1 > + > + "#clock-cells": > + const: 1 > + > + clocks: > + maxItems: 1 > + > + clock-names: > + const: clk_hxt Drop clock-names. You do not need it for one clock. > + > + assigned-clocks: > + maxItems: 5 > + > + assigned-clock-rates: > + maxItems: 5 Drop both properties, you do not need them in the binding. > + > + nuvoton,pll-mode: > + description: > + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, > + EPLL, and VPLL in sequential. The operation mode value 0 is for > + integer mode, 1 is for fractional mode, and 2 is for spread > + spectrum mode. > + $ref: /schemas/types.yaml#/definitions/uint32-array > + maxItems: 5 > + items: > + minimum: 0 > + maximum: 2 Why exactly this is suitable for DT? > + > + nuvoton,sys: > + description: > + Phandle to the system management controller. > + $ref: "/schemas/types.yaml#/definitions/phandle-array" Drop quotes. You need here constraints, look for existing examples. Best regards, Krzysztof
Dear Krzysztof, Thanks for your advice. On 2023/3/16 下午 03:35, Krzysztof Kozlowski wrote: > On 15/03/2023 08:28, Jacky Huang wrote: >> From: Jacky Huang <ychuang3@nuvoton.com> >> >> Add documentation to describe nuvoton ma35d1 clock driver bindings. > Subject: drop second/last, redundant "bindings". The "dt-bindings" > prefix is already stating that these are bindings. Got it, thanks. >> Signed-off-by: Jacky Huang <ychuang3@nuvoton.com> >> --- >> .../bindings/clock/nuvoton,ma35d1-clk.yaml | 83 +++++++++++++++++++ >> 1 file changed, 83 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml >> >> diff --git a/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml >> new file mode 100644 >> index 000000000000..5c2dea071b38 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml >> @@ -0,0 +1,83 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/clock/nuvoton,ma35d1-clk.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Nuvoton MA35D1 Clock Controller Module Binding >> + >> +maintainers: >> + - Chi-Fang Li <cfli0@nuvoton.com> >> + - Jacky Huang <ychuang3@nuvoton.com> >> + >> +description: | >> + The MA35D1 clock controller generates clocks for the whole chip, >> + including system clocks and all peripheral clocks. >> + >> + See also: >> + include/dt-bindings/clock/ma35d1-clk.h >> + >> +properties: >> + compatible: >> + items: >> + - const: nuvoton,ma35d1-clk >> + - const: syscon >> + >> + reg: >> + maxItems: 1 >> + >> + "#clock-cells": >> + const: 1 >> + >> + clocks: >> + maxItems: 1 >> + >> + clock-names: >> + const: clk_hxt > Drop clock-names. You do not need it for one clock. I will remove it. > > >> + >> + assigned-clocks: >> + maxItems: 5 >> + >> + assigned-clock-rates: >> + maxItems: 5 > Drop both properties, you do not need them in the binding. I will drop them. > >> + >> + nuvoton,pll-mode: >> + description: >> + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, >> + EPLL, and VPLL in sequential. The operation mode value 0 is for >> + integer mode, 1 is for fractional mode, and 2 is for spread >> + spectrum mode. >> + $ref: /schemas/types.yaml#/definitions/uint32-array >> + maxItems: 5 >> + items: >> + minimum: 0 >> + maximum: 2 > Why exactly this is suitable for DT? I will use strings instead. > >> + >> + nuvoton,sys: >> + description: >> + Phandle to the system management controller. >> + $ref: "/schemas/types.yaml#/definitions/phandle-array" > Drop quotes. > > You need here constraints, look for existing examples. > I would like to modify this as: nuvoton,sys: description: Use to unlock and lock some clock controller registers. The lock control register is in system controller. $ref: /schemas/types.yaml#/definitions/phandle-array items: - items: - description: phandle to the system controller. > > Best regards, > Krzysztof > Best regards, Jacky Huang
On 17/03/2023 04:47, Jacky Huang wrote: > >> >>> + >>> + nuvoton,pll-mode: >>> + description: >>> + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, >>> + EPLL, and VPLL in sequential. The operation mode value 0 is for >>> + integer mode, 1 is for fractional mode, and 2 is for spread >>> + spectrum mode. >>> + $ref: /schemas/types.yaml#/definitions/uint32-array >>> + maxItems: 5 >>> + items: >>> + minimum: 0 >>> + maximum: 2 >> Why exactly this is suitable for DT? > > I will use strings instead. I have doubts why PLL mode is a property of DT. Is this a board-specific property? > >> >>> + >>> + nuvoton,sys: >>> + description: >>> + Phandle to the system management controller. >>> + $ref: "/schemas/types.yaml#/definitions/phandle-array" >> Drop quotes. >> >> You need here constraints, look for existing examples. >> > > I would like to modify this as: > > > nuvoton,sys: > description: > Use to unlock and lock some clock controller registers. The lock > control register is in system controller. > $ref: /schemas/types.yaml#/definitions/phandle-array > items: > - items: > - description: phandle to the system controller. In such case you do not have array. Just make it phandle and drop the items. Best regards, Krzysztof
Dear Krzysztof, Thanks for your advice. On 2023/3/17 下午 05:13, Krzysztof Kozlowski wrote: > On 17/03/2023 04:47, Jacky Huang wrote: >>>> + >>>> + nuvoton,pll-mode: >>>> + description: >>>> + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, >>>> + EPLL, and VPLL in sequential. The operation mode value 0 is for >>>> + integer mode, 1 is for fractional mode, and 2 is for spread >>>> + spectrum mode. >>>> + $ref: /schemas/types.yaml#/definitions/uint32-array >>>> + maxItems: 5 >>>> + items: >>>> + minimum: 0 >>>> + maximum: 2 >>> Why exactly this is suitable for DT? >> I will use strings instead. > I have doubts why PLL mode is a property of DT. Is this a board-specific > property? CA-PLL has mode 0 only. DDRPLL, APLL, EPLL, and VPLL have the same PLL design that supports integer mode, fractional mode, and spread spctrum mode. The PLL mode is controlled by clock controller register. I think it's not board-specific. >>>> + >>>> + nuvoton,sys: >>>> + description: >>>> + Phandle to the system management controller. >>>> + $ref: "/schemas/types.yaml#/definitions/phandle-array" >>> Drop quotes. >>> >>> You need here constraints, look for existing examples. >>> >> I would like to modify this as: >> >> >> nuvoton,sys: >> description: >> Use to unlock and lock some clock controller registers. The lock >> control register is in system controller. >> $ref: /schemas/types.yaml#/definitions/phandle-array >> items: >> - items: >> - description: phandle to the system controller. > In such case you do not have array. Just make it phandle and drop the items. > Thank you. So, I will rewrite it as nuvoton,sys: description: Use to unlock and lock some clock controller registers. The lock control register is in system controller. $ref: /schemas/types.yaml#/definitions/phandle > > Best regards, > Krzysztof > Best regards, Jacky Huang
On 17/03/2023 10:52, Jacky Huang wrote: > Dear Krzysztof, > > Thanks for your advice. > > On 2023/3/17 下午 05:13, Krzysztof Kozlowski wrote: >> On 17/03/2023 04:47, Jacky Huang wrote: >>>>> + >>>>> + nuvoton,pll-mode: >>>>> + description: >>>>> + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, >>>>> + EPLL, and VPLL in sequential. The operation mode value 0 is for >>>>> + integer mode, 1 is for fractional mode, and 2 is for spread >>>>> + spectrum mode. >>>>> + $ref: /schemas/types.yaml#/definitions/uint32-array >>>>> + maxItems: 5 >>>>> + items: >>>>> + minimum: 0 >>>>> + maximum: 2 >>>> Why exactly this is suitable for DT? >>> I will use strings instead. >> I have doubts why PLL mode is a property of DT. Is this a board-specific >> property? > > CA-PLL has mode 0 only. > DDRPLL, APLL, EPLL, and VPLL have the same PLL design that supports > integer mode, fractional mode, and spread spctrum mode. The PLL mode > is controlled by clock controller register. I think it's not board-specific. You described the feature but that does not answer why this is suitable in DT. If this is not board-specific, then it is implied by compatible, right? Or it does not have to be in DT at all. Best regards, Krzysztof
Dear Krzysztof, Thanks for your advice. On 2023/3/18 上午 12:03, Krzysztof Kozlowski wrote: > On 17/03/2023 10:52, Jacky Huang wrote: >> Dear Krzysztof, >> >> Thanks for your advice. >> >> On 2023/3/17 下午 05:13, Krzysztof Kozlowski wrote: >>> On 17/03/2023 04:47, Jacky Huang wrote: >>>>>> + >>>>>> + nuvoton,pll-mode: >>>>>> + description: >>>>>> + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, >>>>>> + EPLL, and VPLL in sequential. The operation mode value 0 is for >>>>>> + integer mode, 1 is for fractional mode, and 2 is for spread >>>>>> + spectrum mode. >>>>>> + $ref: /schemas/types.yaml#/definitions/uint32-array >>>>>> + maxItems: 5 >>>>>> + items: >>>>>> + minimum: 0 >>>>>> + maximum: 2 >>>>> Why exactly this is suitable for DT? >>>> I will use strings instead. >>> I have doubts why PLL mode is a property of DT. Is this a board-specific >>> property? >> CA-PLL has mode 0 only. >> DDRPLL, APLL, EPLL, and VPLL have the same PLL design that supports >> integer mode, fractional mode, and spread spctrum mode. The PLL mode >> is controlled by clock controller register. I think it's not board-specific. > You described the feature but that does not answer why this is suitable > in DT. If this is not board-specific, then it is implied by compatible, > right? Or it does not have to be in DT at all. > > > Best regards, > Krzysztof I got it now. Yes, at least DDR PLL and VPLL (video pixel clock) can be different on different boards. You're right, it should be board specific. Thank you. In the next version, I will move PLL property to board dts. Best regards, Jacky Huang
diff --git a/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml new file mode 100644 index 000000000000..5c2dea071b38 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml @@ -0,0 +1,83 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/nuvoton,ma35d1-clk.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Nuvoton MA35D1 Clock Controller Module Binding + +maintainers: + - Chi-Fang Li <cfli0@nuvoton.com> + - Jacky Huang <ychuang3@nuvoton.com> + +description: | + The MA35D1 clock controller generates clocks for the whole chip, + including system clocks and all peripheral clocks. + + See also: + include/dt-bindings/clock/ma35d1-clk.h + +properties: + compatible: + items: + - const: nuvoton,ma35d1-clk + - const: syscon + + reg: + maxItems: 1 + + "#clock-cells": + const: 1 + + clocks: + maxItems: 1 + + clock-names: + const: clk_hxt + + assigned-clocks: + maxItems: 5 + + assigned-clock-rates: + maxItems: 5 + + nuvoton,pll-mode: + description: + A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL, + EPLL, and VPLL in sequential. The operation mode value 0 is for + integer mode, 1 is for fractional mode, and 2 is for spread + spectrum mode. + $ref: /schemas/types.yaml#/definitions/uint32-array + maxItems: 5 + items: + minimum: 0 + maximum: 2 + + nuvoton,sys: + description: + Phandle to the system management controller. + $ref: "/schemas/types.yaml#/definitions/phandle-array" + +required: + - compatible + - reg + - "#clock-cells" + - clocks + - clock-names + - nuvoton,sys + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/nuvoton,ma35d1-clk.h> + + clk: clock-controller@40460200 { + compatible = "nuvoton,ma35d1-clk", "syscon"; + reg = <0x40460200 0x100>; + #clock-cells = <1>; + clocks = <&clk_hxt>; + clock-names = "clk_hxt"; + nuvoton,sys = <&sys>; + }; +...