From: atish.patra@wdc.com (Atish Patra) To: linux-riscv@lists.infradead.org Subject: [RFC 1/4] pwm: sifive: Add DT documentation for SiFive PWM Controller. Date: Mon, 15 Oct 2018 15:57:35 -0700 [thread overview] Message-ID: <25758ab9-eb36-741b-6264-42412b3ddd8e@wdc.com> (raw) In-Reply-To: <20181010134926.GD21134@ulmo> On 10/10/18 6:49 AM, Thierry Reding wrote: > On Tue, Oct 09, 2018 at 11:51:22AM -0700, Atish Patra wrote: >> From: "Wesley W. Terpstra" <wesley@sifive.com> >> >> DT documentation for PWM controller added with updated compatible >> string. >> >> Signed-off-by: Wesley W. Terpstra <wesley@sifive.com> >> [Atish: Compatible string update] >> Signed-off-by: Atish Patra <atish.patra@wdc.com> >> --- >> .../devicetree/bindings/pwm/pwm-sifive.txt | 32 ++++++++++++++++++++++ >> 1 file changed, 32 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/pwm/pwm-sifive.txt >> >> diff --git a/Documentation/devicetree/bindings/pwm/pwm-sifive.txt b/Documentation/devicetree/bindings/pwm/pwm-sifive.txt >> new file mode 100644 >> index 00000000..532b10fc >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pwm/pwm-sifive.txt >> @@ -0,0 +1,32 @@ >> +SiFive PWM controller >> + >> +Unlike most other PWM controllers, the SiFive PWM controller currently only >> +supports one period for all channels in the PWM. This is set globally in DTS. >> +The period also has significant restrictions on the values it can achieve, >> +which the driver rounds to the nearest achievable frequency. > > What restrictions are these? If "nearest achievable" is too far off the > target period it might be preferable to error out. > @Wes: Any comments? >> +Required properties: >> +- compatible: should be one of >> + "sifive,fu540-c000-pwm0","sifive,pwm0". > > What's the '0' in here? A version number? > I think yes. Since fu540 is the first Linux capable RISC-V core, SiFive Guys decided mark it as version 0. @Wesly: Please correct me if I am wrong. >> + PWM controller is HiFive Unleashed specific chip which warrants a >> + specific compatible string. The second string is kept for backward >> + compatibility until a firmware update with latest compatible string. >> +- reg: physical base address and length of the controller's registers >> +- clocks: The frequency the controller runs at >> +- #pwm-cells: Should be 2. >> + The first cell is the PWM channel number >> + The second cell is the PWM polarity >> +- sifive,approx-period: the driver will get as close to this period as it can > > Given the above comment, maybe "sifive,period"? > ok. In Unleashed board, the DT is loaded by FSBL (first stage boot loader). Thus, changing device tree entries requires a FSBL update. If we update this string, we need to update the driver to parse both properties so that existing devices with older firmware continue to work. This is probably ok as we anyways do that for compatible strings. Just wanted to update that here for the record. Regards, Atish > Thierry >
WARNING: multiple messages have this Message-ID (diff)
From: Atish Patra <atish.patra@wdc.com> To: Thierry Reding <thierry.reding@gmail.com>, Wesley Terpstra <wesley@sifive.com> Cc: mark.rutland@arm.com, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linus.walleij@linaro.org, palmer@sifive.com, linux-kernel@vger.kernel.org, hch@infradead.org, linux-gpio@vger.kernel.org, robh+dt@kernel.org, linux-riscv@lists.infradead.org Subject: Re: [RFC 1/4] pwm: sifive: Add DT documentation for SiFive PWM Controller. Date: Mon, 15 Oct 2018 15:57:35 -0700 [thread overview] Message-ID: <25758ab9-eb36-741b-6264-42412b3ddd8e@wdc.com> (raw) Message-ID: <20181015225735.JHH6CgAfNDS6xhGTwTQh-09s2x6kZrhWtZVcwn_LnQk@z> (raw) In-Reply-To: <20181010134926.GD21134@ulmo> On 10/10/18 6:49 AM, Thierry Reding wrote: > On Tue, Oct 09, 2018 at 11:51:22AM -0700, Atish Patra wrote: >> From: "Wesley W. Terpstra" <wesley@sifive.com> >> >> DT documentation for PWM controller added with updated compatible >> string. >> >> Signed-off-by: Wesley W. Terpstra <wesley@sifive.com> >> [Atish: Compatible string update] >> Signed-off-by: Atish Patra <atish.patra@wdc.com> >> --- >> .../devicetree/bindings/pwm/pwm-sifive.txt | 32 ++++++++++++++++++++++ >> 1 file changed, 32 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/pwm/pwm-sifive.txt >> >> diff --git a/Documentation/devicetree/bindings/pwm/pwm-sifive.txt b/Documentation/devicetree/bindings/pwm/pwm-sifive.txt >> new file mode 100644 >> index 00000000..532b10fc >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pwm/pwm-sifive.txt >> @@ -0,0 +1,32 @@ >> +SiFive PWM controller >> + >> +Unlike most other PWM controllers, the SiFive PWM controller currently only >> +supports one period for all channels in the PWM. This is set globally in DTS. >> +The period also has significant restrictions on the values it can achieve, >> +which the driver rounds to the nearest achievable frequency. > > What restrictions are these? If "nearest achievable" is too far off the > target period it might be preferable to error out. > @Wes: Any comments? >> +Required properties: >> +- compatible: should be one of >> + "sifive,fu540-c000-pwm0","sifive,pwm0". > > What's the '0' in here? A version number? > I think yes. Since fu540 is the first Linux capable RISC-V core, SiFive Guys decided mark it as version 0. @Wesly: Please correct me if I am wrong. >> + PWM controller is HiFive Unleashed specific chip which warrants a >> + specific compatible string. The second string is kept for backward >> + compatibility until a firmware update with latest compatible string. >> +- reg: physical base address and length of the controller's registers >> +- clocks: The frequency the controller runs at >> +- #pwm-cells: Should be 2. >> + The first cell is the PWM channel number >> + The second cell is the PWM polarity >> +- sifive,approx-period: the driver will get as close to this period as it can > > Given the above comment, maybe "sifive,period"? > ok. In Unleashed board, the DT is loaded by FSBL (first stage boot loader). Thus, changing device tree entries requires a FSBL update. If we update this string, we need to update the driver to parse both properties so that existing devices with older firmware continue to work. This is probably ok as we anyways do that for compatible strings. Just wanted to update that here for the record. Regards, Atish > Thierry > _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2018-10-15 22:57 UTC|newest] Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-10-09 18:51 [RFC 0/4] GPIO & PWM support for HiFive Unleashed Atish Patra 2018-10-09 18:51 ` Atish Patra 2018-10-09 18:51 ` [RFC 1/4] pwm: sifive: Add DT documentation for SiFive PWM Controller Atish Patra 2018-10-09 18:51 ` Atish Patra 2018-10-10 13:49 ` Thierry Reding 2018-10-10 13:49 ` Thierry Reding 2018-10-15 22:57 ` Atish Patra [this message] 2018-10-15 22:57 ` Atish Patra 2018-10-15 23:19 ` Wesley Terpstra 2018-10-15 23:19 ` Wesley Terpstra 2018-10-16 11:13 ` Thierry Reding 2018-10-16 11:13 ` Thierry Reding 2018-10-16 11:01 ` Thierry Reding 2018-10-16 11:01 ` Thierry Reding 2018-10-16 17:31 ` Paul Walmsley 2018-10-16 17:31 ` Paul Walmsley 2018-10-16 22:04 ` Thierry Reding 2018-10-16 22:04 ` Thierry Reding 2018-10-16 22:20 ` Atish Patra 2018-10-16 22:20 ` Atish Patra 2018-10-17 15:58 ` Rob Herring 2018-10-17 15:58 ` Rob Herring 2018-10-17 21:45 ` Atish Patra 2018-10-17 21:45 ` Atish Patra 2018-11-10 5:38 ` Paul Walmsley 2018-11-10 5:38 ` Paul Walmsley 2018-10-10 13:51 ` Thierry Reding 2018-10-10 13:51 ` Thierry Reding 2018-10-15 22:45 ` Atish Patra 2018-10-15 22:45 ` Atish Patra 2018-10-16 10:51 ` Thierry Reding 2018-10-16 10:51 ` Thierry Reding 2018-10-16 22:42 ` Atish Patra 2018-10-16 22:42 ` Atish Patra 2018-10-09 18:51 ` [RFC 2/4] pwm: sifive: Add a driver for SiFive SoC PWM Atish Patra 2018-10-09 18:51 ` Atish Patra 2018-10-10 13:11 ` Christoph Hellwig 2018-10-10 13:11 ` Christoph Hellwig 2018-10-10 13:44 ` Thierry Reding 2018-10-10 13:44 ` Thierry Reding 2018-10-16 6:28 ` Atish Patra 2018-10-16 6:28 ` Atish Patra 2018-10-10 14:13 ` Thierry Reding 2018-10-10 14:13 ` Thierry Reding 2018-10-16 6:24 ` Atish Patra 2018-10-16 6:24 ` Atish Patra 2018-10-09 18:51 ` [RFC 3/4] gpio: sifive: Add DT documentation for SiFive GPIO Atish Patra 2018-10-09 18:51 ` Atish Patra 2018-10-09 18:51 ` [RFC 4/4] gpio: sifive: Add GPIO driver for SiFive SoCs Atish Patra 2018-10-09 18:51 ` Atish Patra 2018-10-10 12:35 ` Linus Walleij 2018-10-10 12:35 ` Linus Walleij 2018-10-17 1:01 ` Atish Patra 2018-10-17 1:01 ` Atish Patra 2019-09-18 7:32 ` Bin Meng 2018-10-10 13:01 ` Andreas Schwab 2018-10-10 13:01 ` Andreas Schwab 2018-10-10 13:12 ` Christoph Hellwig 2018-10-10 13:12 ` Christoph Hellwig 2018-10-10 13:28 ` Andreas Schwab 2018-10-10 13:28 ` Andreas Schwab
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=25758ab9-eb36-741b-6264-42412b3ddd8e@wdc.com \ --to=atish.patra@wdc.com \ --cc=linux-riscv@lists.infradead.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).