Message ID | 20231110062039.103339-2-william.qiu@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1335940vqs; Fri, 10 Nov 2023 11:29:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOwnpTrNP1V/1hevX6m0XFJjjC7yt42SZyKZ32WMz3oxTNDfpDEJR7DpLQtYBsM+dcb5hO X-Received: by 2002:a05:6808:1450:b0:3b5:68a4:d4a5 with SMTP id x16-20020a056808145000b003b568a4d4a5mr322672oiv.20.1699644540853; Fri, 10 Nov 2023 11:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699644540; cv=none; d=google.com; s=arc-20160816; b=R4pZPR8z+IIz1KbVqcpGUOg6vn0B733cvLhmW1GuVzIL0J1+Ux/lyBsSUuG1AavBwi SHGNEGmzjg+tJMCdGq0kYHg0ONAjaYCvPRRsOnuysIxOcKrbbZxmG2X8276ES6jSmQcN 4fKuYs9Kgmuyls7eluaDlylm82k6cvXZcSZKOdwZB12XEBcHhLHDYWLxREjXDsQiFBfq mkXzdw65cMrDSpPLfulqDPAze9DyVOoY5nR3YZEjrCTUonykEynObzy0noH5L6r0oJSm TjREx2ZvdWZtHgoKMCH7fqRUlhMWT1ebtKyL1Breu11ZzAVb1H6lh7yJqhgSf2lG3sPY 1Vqw== 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=K3jaQSTmb2ecqAuAgzP6vtNygt+2dNM3hNrSK0osDec=; fh=T4gzk7+hgrXGjSNvKGZTlbuKXCiuDaGkxvCBgfgONjs=; b=DiWItGHCCR24qPkelFb+E8lIhSEfrVxpnkQDIeBRNaUWKivlen2v7DFFFpGzgIBj2f B5yTz1w6j+Ux7wninoxcqNWz3d8+9QSWL1glIlm92hv8IU/pHWkPRdpae8f1WjZ3KoJr BEhvlQ1k5qQVnd3FUfiQS5jFjP5bAs+5qAUVKfy8RHud1A9/4UQfJbv3AX2+Ok1dfjsr FXFMjQqf+ECTyn9lNkQPovcPNseA/2OsoOi0mdbSD4z2NAoyi0w1hOlDi5JbEjdR5Cki k9u656os09+wfxFTA0Z2T6z8UtYqDJr8PwTAp5y0saYoYDewqKcmVOvr4liILoa9SM5m H4xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bq4-20020a056a02044400b00589fcc39ef1si70260pgb.365.2023.11.10.11.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 11:29:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9492A83CAC7E; Fri, 10 Nov 2023 11:28:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345692AbjKJT25 convert rfc822-to-8bit (ORCPT <rfc822;heyuhang3455@gmail.com> + 29 others); Fri, 10 Nov 2023 14:28:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344862AbjKJT2Z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Nov 2023 14:28:25 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D9796A59; Thu, 9 Nov 2023 22:20:51 -0800 (PST) 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 BEFAF24E0B4; Fri, 10 Nov 2023 14:20:42 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 10 Nov 2023 14:20:42 +0800 Received: from williamqiu-virtual-machine.starfivetech.com (171.223.208.138) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 10 Nov 2023 14:20:41 +0800 From: William Qiu <william.qiu@starfivetech.com> To: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-riscv@lists.infradead.org>, <linux-pwm@vger.kernel.org> CC: Emil Renner Berthing <kernel@esmil.dk>, Rob Herring <robh+dt@kernel.org>, Thierry Reding <thierry.reding@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, "Hal Feng" <hal.feng@starfivetech.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, William Qiu <william.qiu@starfivetech.com> Subject: [PATCH v7 1/4] dt-bindings: pwm: Add OpenCores PWM module Date: Fri, 10 Nov 2023 14:20:36 +0800 Message-ID: <20231110062039.103339-2-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231110062039.103339-1-william.qiu@starfivetech.com> References: <20231110062039.103339-1-william.qiu@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 10 Nov 2023 11:28:59 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782200484583129676 X-GMAIL-MSGID: 1782206474147517124 |
Series |
StarFive's Pulse Width Modulation driver support
|
|
Commit Message
William Qiu
Nov. 10, 2023, 6:20 a.m. UTC
Add documentation to describe OpenCores Pulse Width Modulation controller driver. Signed-off-by: William Qiu <william.qiu@starfivetech.com> Reviewed-by: Hal Feng <hal.feng@starfivetech.com> --- .../bindings/pwm/opencores,pwm.yaml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/opencores,pwm.yaml
Comments
On 2023/11/10 20:24, Krzysztof Kozlowski wrote: > On 10/11/2023 07:20, William Qiu wrote: >> Add documentation to describe OpenCores Pulse Width Modulation >> controller driver. >> >> Signed-off-by: William Qiu <william.qiu@starfivetech.com> >> Reviewed-by: Hal Feng <hal.feng@starfivetech.com> >> --- >> .../bindings/pwm/opencores,pwm.yaml | 56 +++++++++++++++++++ >> 1 file changed, 56 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/pwm/opencores,pwm.yaml >> >> diff --git a/Documentation/devicetree/bindings/pwm/opencores,pwm.yaml b/Documentation/devicetree/bindings/pwm/opencores,pwm.yaml >> new file mode 100644 >> index 000000000000..8f776bbc1112 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pwm/opencores,pwm.yaml >> @@ -0,0 +1,56 @@ >> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/pwm/opencores,pwm.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: OpenCores PWM controller >> + >> +maintainers: >> + - William Qiu <william.qiu@starfivetech.com> >> + >> +description: >> + OpenCores PTC ip core contains a PWM controller. When operating in PWM mode, the PTC core >> + generates binary signal with user-programmable low and high periods. All PTC counters and >> + registers are 32-bit. > > Wrap at 80 (as Coding Style asks) > Will update. >> + >> +allOf: >> + - $ref: pwm.yaml# >> + >> +properties: >> + compatible: >> + oneOf: >> + - items: >> + - enum: >> + - starfive,jh7100-pwm >> + - starfive,jh7110-pwm >> + - const: opencores,pwm > > That's a very, very generic compatible. Are you sure, 100% sure, that > all designs from OpenCores from now till next 100 years will be 100% > compatible? > My description is not accurate enough, this is OpenCores PTC IP, and PWM is one of those modes, so it might be better to replace compatible with "opencores, ptc-pwm" What do you think? Best Regrads, William > > Best regards, > Krzysztof >
On 2023/11/10 20:24, Krzysztof Kozlowski wrote: > On 10/11/2023 07:20, William Qiu wrote: >> Add documentation to describe OpenCores Pulse Width Modulation >> controller driver. > > Please describe the hardware, not the driver. > Will modify the description. Thanks. Best Regards, William > Best regards, > Krzysztof >
On 13/11/2023 10:42, William Qiu wrote: > Will update. >>> + >>> +allOf: >>> + - $ref: pwm.yaml# >>> + >>> +properties: >>> + compatible: >>> + oneOf: >>> + - items: >>> + - enum: >>> + - starfive,jh7100-pwm >>> + - starfive,jh7110-pwm >>> + - const: opencores,pwm >> >> That's a very, very generic compatible. Are you sure, 100% sure, that >> all designs from OpenCores from now till next 100 years will be 100% >> compatible? >> > My description is not accurate enough, this is OpenCores PTC IP, and PWM > is one of those modes, so it might be better to replace compatible with > "opencores, ptc-pwm" > > What do you think? Sorry, maybe this answers maybe doesn't. What is "PTC"? Best regards, Krzysztof
On Mon, Nov 13, 2023 at 09:07:15PM +0100, Krzysztof Kozlowski wrote: > On 13/11/2023 10:42, William Qiu wrote: > > Will update. > >>> + > >>> +allOf: > >>> + - $ref: pwm.yaml# > >>> + > >>> +properties: > >>> + compatible: > >>> + oneOf: > >>> + - items: > >>> + - enum: > >>> + - starfive,jh7100-pwm > >>> + - starfive,jh7110-pwm > >>> + - const: opencores,pwm > >> > >> That's a very, very generic compatible. Are you sure, 100% sure, that > >> all designs from OpenCores from now till next 100 years will be 100% > >> compatible? > >> > > My description is not accurate enough, this is OpenCores PTC IP, and PWM > > is one of those modes, so it might be better to replace compatible with > > "opencores, ptc-pwm" > > > > What do you think? > > Sorry, maybe this answers maybe doesn't. What is "PTC"? "pwm timer counter". AFAIU, the IP can be configured to provide all 3. I think that William pointed out on an earlier revision that they have only implemented the pwm on their hardware. I don't think putting in "ptc" is a sufficient differentiator though, as clearly there could be several different versions of "ptc-pwm" that have the same concern about "all designs from OpenCores for now till the next 100 years" being compatible. Cheers. Conor.
On 2023/11/14 4:17, Conor Dooley wrote: > On Mon, Nov 13, 2023 at 09:07:15PM +0100, Krzysztof Kozlowski wrote: >> On 13/11/2023 10:42, William Qiu wrote: >> > Will update. >> >>> + >> >>> +allOf: >> >>> + - $ref: pwm.yaml# >> >>> + >> >>> +properties: >> >>> + compatible: >> >>> + oneOf: >> >>> + - items: >> >>> + - enum: >> >>> + - starfive,jh7100-pwm >> >>> + - starfive,jh7110-pwm >> >>> + - const: opencores,pwm >> >> >> >> That's a very, very generic compatible. Are you sure, 100% sure, that >> >> all designs from OpenCores from now till next 100 years will be 100% >> >> compatible? >> >> >> > My description is not accurate enough, this is OpenCores PTC IP, and PWM >> > is one of those modes, so it might be better to replace compatible with >> > "opencores, ptc-pwm" >> > >> > What do you think? >> >> Sorry, maybe this answers maybe doesn't. What is "PTC"? > > "pwm timer counter". AFAIU, the IP can be configured to provide all 3. > I think that William pointed out on an earlier revision that they have > only implemented the pwm on their hardware. > I don't think putting in "ptc" is a sufficient differentiator though, as > clearly there could be several different versions of "ptc-pwm" that have > the same concern about "all designs from OpenCores for now till the next > 100 years" being compatible. > > Cheers. > Conor. Hiļ¼Conor and Krzysztof, After discussion and review of materials, we plan to use "opencores,ptc-pwm-v1" as this version of compatible, so that it can also be compatible in the future. What do you think? Best regards, William
On Wed, Nov 22, 2023 at 03:03:36PM +0800, William Qiu wrote: > > > On 2023/11/14 4:17, Conor Dooley wrote: > > On Mon, Nov 13, 2023 at 09:07:15PM +0100, Krzysztof Kozlowski wrote: > >> On 13/11/2023 10:42, William Qiu wrote: > >> > Will update. > >> >>> + > >> >>> +allOf: > >> >>> + - $ref: pwm.yaml# > >> >>> + > >> >>> +properties: > >> >>> + compatible: > >> >>> + oneOf: > >> >>> + - items: > >> >>> + - enum: > >> >>> + - starfive,jh7100-pwm > >> >>> + - starfive,jh7110-pwm > >> >>> + - const: opencores,pwm > >> >> > >> >> That's a very, very generic compatible. Are you sure, 100% sure, that > >> >> all designs from OpenCores from now till next 100 years will be 100% > >> >> compatible? > >> >> > >> > My description is not accurate enough, this is OpenCores PTC IP, and PWM > >> > is one of those modes, so it might be better to replace compatible with > >> > "opencores, ptc-pwm" > >> > > >> > What do you think? > >> > >> Sorry, maybe this answers maybe doesn't. What is "PTC"? > > > > "pwm timer counter". AFAIU, the IP can be configured to provide all 3. > > I think that William pointed out on an earlier revision that they have > > only implemented the pwm on their hardware. > > I don't think putting in "ptc" is a sufficient differentiator though, as > > clearly there could be several different versions of "ptc-pwm" that have > > the same concern about "all designs from OpenCores for now till the next > > 100 years" being compatible. Perhaps noting what "ptc" stands for in the description field would be a good idea. > After discussion and review of materials, we plan to use "opencores,ptc-pwm-v1" > as this version of compatible, so that it can also be compatible in the future. > > What do you think? Do we know that it is actually "v1" of the IP? I would suggest using the version that actually matches the version of the IP that you are using in your SoC. Thanks, Conor.
On 2023/11/23 1:36, Conor Dooley wrote: > On Wed, Nov 22, 2023 at 03:03:36PM +0800, William Qiu wrote: >> >> >> On 2023/11/14 4:17, Conor Dooley wrote: >> > On Mon, Nov 13, 2023 at 09:07:15PM +0100, Krzysztof Kozlowski wrote: >> >> On 13/11/2023 10:42, William Qiu wrote: >> >> > Will update. >> >> >>> + >> >> >>> +allOf: >> >> >>> + - $ref: pwm.yaml# >> >> >>> + >> >> >>> +properties: >> >> >>> + compatible: >> >> >>> + oneOf: >> >> >>> + - items: >> >> >>> + - enum: >> >> >>> + - starfive,jh7100-pwm >> >> >>> + - starfive,jh7110-pwm >> >> >>> + - const: opencores,pwm >> >> >> >> >> >> That's a very, very generic compatible. Are you sure, 100% sure, that >> >> >> all designs from OpenCores from now till next 100 years will be 100% >> >> >> compatible? >> >> >> >> >> > My description is not accurate enough, this is OpenCores PTC IP, and PWM >> >> > is one of those modes, so it might be better to replace compatible with >> >> > "opencores, ptc-pwm" >> >> > >> >> > What do you think? >> >> >> >> Sorry, maybe this answers maybe doesn't. What is "PTC"? >> > >> > "pwm timer counter". AFAIU, the IP can be configured to provide all 3. >> > I think that William pointed out on an earlier revision that they have >> > only implemented the pwm on their hardware. >> > I don't think putting in "ptc" is a sufficient differentiator though, as >> > clearly there could be several different versions of "ptc-pwm" that have >> > the same concern about "all designs from OpenCores for now till the next >> > 100 years" being compatible. > > Perhaps noting what "ptc" stands for in the description field would be a > good idea. > I will add. >> After discussion and review of materials, we plan to use "opencores,ptc-pwm-v1" >> as this version of compatible, so that it can also be compatible in the future. >> >> What do you think? > > Do we know that it is actually "v1" of the IP? I would suggest using the > version that actually matches the version of the IP that you are using > in your SoC. > > Thanks, > Conor. There is no version list on their official website, so it is not certain whether it is v1, but at least the driver is the first version. What do you think is the best way? Thanks, William
On Fri, Nov 24, 2023 at 03:38:41PM +0800, William Qiu wrote: > > > On 2023/11/23 1:36, Conor Dooley wrote: > > On Wed, Nov 22, 2023 at 03:03:36PM +0800, William Qiu wrote: > >> > >> > >> On 2023/11/14 4:17, Conor Dooley wrote: > >> > On Mon, Nov 13, 2023 at 09:07:15PM +0100, Krzysztof Kozlowski wrote: > >> >> On 13/11/2023 10:42, William Qiu wrote: > >> >> > Will update. > >> >> >>> + > >> >> >>> +allOf: > >> >> >>> + - $ref: pwm.yaml# > >> >> >>> + > >> >> >>> +properties: > >> >> >>> + compatible: > >> >> >>> + oneOf: > >> >> >>> + - items: > >> >> >>> + - enum: > >> >> >>> + - starfive,jh7100-pwm > >> >> >>> + - starfive,jh7110-pwm > >> >> >>> + - const: opencores,pwm > >> >> >> > >> >> >> That's a very, very generic compatible. Are you sure, 100% sure, that > >> >> >> all designs from OpenCores from now till next 100 years will be 100% > >> >> >> compatible? > >> >> >> > >> >> > My description is not accurate enough, this is OpenCores PTC IP, and PWM > >> >> > is one of those modes, so it might be better to replace compatible with > >> >> > "opencores, ptc-pwm" > >> >> > > >> >> > What do you think? > >> >> > >> >> Sorry, maybe this answers maybe doesn't. What is "PTC"? > >> > > >> > "pwm timer counter". AFAIU, the IP can be configured to provide all 3. > >> > I think that William pointed out on an earlier revision that they have > >> > only implemented the pwm on their hardware. > >> > I don't think putting in "ptc" is a sufficient differentiator though, as > >> > clearly there could be several different versions of "ptc-pwm" that have > >> > the same concern about "all designs from OpenCores for now till the next > >> > 100 years" being compatible. > > > > Perhaps noting what "ptc" stands for in the description field would be a > > good idea. > > > I will add. > >> After discussion and review of materials, we plan to use "opencores,ptc-pwm-v1" > >> as this version of compatible, so that it can also be compatible in the future. > >> > >> What do you think? > > > > Do we know that it is actually "v1" of the IP? I would suggest using the > > version that actually matches the version of the IP that you are using > > in your SoC. > > > > Thanks, > > Conor. > > There is no version list on their official website, so it is not certain whether > it is v1, but at least the driver is the first version. > > What do you think is the best way? I don't have an account, so I cannot open the "ptc_spec.pdf at this link: https://opencores.org/projects/ptc/downloads but I would take whatever documentation you have for the spec and see what it says as the revision on the front cover.
diff --git a/Documentation/devicetree/bindings/pwm/opencores,pwm.yaml b/Documentation/devicetree/bindings/pwm/opencores,pwm.yaml new file mode 100644 index 000000000000..8f776bbc1112 --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/opencores,pwm.yaml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pwm/opencores,pwm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: OpenCores PWM controller + +maintainers: + - William Qiu <william.qiu@starfivetech.com> + +description: + OpenCores PTC ip core contains a PWM controller. When operating in PWM mode, the PTC core + generates binary signal with user-programmable low and high periods. All PTC counters and + registers are 32-bit. + +allOf: + - $ref: pwm.yaml# + +properties: + compatible: + oneOf: + - items: + - enum: + - starfive,jh7100-pwm + - starfive,jh7110-pwm + - const: opencores,pwm + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + "#pwm-cells": + const: 3 + +required: + - compatible + - reg + - clocks + +additionalProperties: false + +examples: + - | + pwm@12490000 { + compatible = "starfive,jh7110-pwm", "opencores,pwm"; + reg = <0x12490000 0x10000>; + clocks = <&clkgen 181>; + resets = <&rstgen 109>; + #pwm-cells = <3>; + };