From: Conor Dooley <conor@kernel.org>
To: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Cc: Rob Herring <robh@kernel.org>,
andi.shyti@kernel.org, jszhang@kernel.org,
miquel.raynal@bootlin.com, linux-riscv@lists.infradead.org,
linux-i2c@vger.kernel.org, thomas.petazzoni@bootlin.com,
guoren@kernel.org, wefu@redhat.com, conor+dt@kernel.org,
devicetree@vger.kernel.org, aou@eecs.berkeley.edu,
krzk+dt@kernel.org, palmer@dabbelt.com, paul.walmsley@sifive.com
Subject: Re: [PATCH 0/4] Add I2C support on TH1520
Date: Fri, 26 Apr 2024 15:42:16 +0100 [thread overview]
Message-ID: <20240426-patchy-grievance-e7103a344c82@spud> (raw)
In-Reply-To: <3eb27570-4a53-47f6-8e36-e25fc1063124@bootlin.com>
[-- Attachment #1: Type: text/plain, Size: 3843 bytes --]
On Fri, Apr 26, 2024 at 04:12:00PM +0200, Thomas Bonnefille wrote:
>
>
> On 4/25/24 6:35 PM, Conor Dooley wrote:
> > On Thu, Apr 25, 2024 at 09:51:26AM -0500, Rob Herring wrote:
> > >
> > > On Thu, 25 Apr 2024 10:21:31 +0200, Thomas Bonnefille wrote:
> > > > This adds I2C support in the device tree of the T-Head TH1520 RISCV-SoC
> > > > and a default configuration for the BeagleV-Ahead. It appears that the
> > > > TH1520 I2C is already supported in the upstream kernel through the
> > > > Synopsis Designware I2C adapter driver.
> > > > As there is no clock driver for this board as of today, this patch
> > > > series uses a fixed-clock named i2c_ic_clk.
> > > > There is also no pinctrl driver yet so pinmux must be handled manually
> > > > for now.
> > > > It also fixes the order of the nodes in the device tree to comply with
> > > > device-tree coding-style.
> > > >
> > > > Thomas Bonnefille (4):
> > > > dt-bindings: i2c: dw: Document compatible thead,th1520-i2c
> > > > riscv: boot: dts: thead: Fix node ordering in TH1520 device tree
> > > > riscv: dts: thead: Add TH1520 I2C nodes
> > > > riscv: dts: thead: Enable I2C on the BeagleV-Ahead
> > > >
> > > > .../bindings/i2c/snps,designware-i2c.yaml | 12 ++
> > > > .../boot/dts/thead/th1520-beaglev-ahead.dts | 22 ++++
> > > > arch/riscv/boot/dts/thead/th1520.dtsi | 120 ++++++++++++++----
> > > > 3 files changed, 127 insertions(+), 27 deletions(-)
> > > >
> > > > --
> > > > 2.44.0
> > > >
> > > >
> > > >
> > >
> > >
> > > My bot found new DTB warnings on the .dts files added or changed in this
> > > series.
> > >
> > > Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
> > > are fixed by another series. Ultimately, it is up to the platform
> > > maintainer whether these warnings are acceptable or not. No need to reply
> > > unless the platform maintainer has comments.
> > >
> > > If you already ran DT checks and didn't see these error(s), then
> > > make sure dt-schema is up to date:
> > >
> > > pip3 install dtschema --upgrade
> > >
> > >
> > > New warnings running 'make CHECK_DTBS=y thead/th1520-beaglev-ahead.dtb' for 20240425082138.374445-1-thomas.bonnefille@bootlin.com:
> > >
> > > arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dtb: i2c-clock: clock-frequency:0:0: 50000000 is greater than the maximum of 5000000
> >
> > The bot is not freaking out here, 50 MHz is indeed more than 5 MHz :)
>
> 5MHz is the maximum clock-frequency, ie. the I2C bus frequency.
> This is actually set to 100kHz for I2C0 in the DT:
>
> &i2c0 {
> status = "okay";
> clock-frequency = <100000>; <----
> ...
> };
>
> 50MHz is the "fixed-clock" frequency, that is the clock feeding the I2C
> IP block:
>
> i2c_ic_clk: i2c-clock {
> compatible = "fixed-clock";
> clock-frequency = <50000000>; <-----
> #clock-cells = <0>;
> };
>
> My guess is that the bot confused the clock-frequency parameter for the bus
> clock (SCL) with the i2c-ic-clock value for the controller itself during the
> checks.
>
> Do you agree with this or am I misunderstanding the error ?
>
> If I lower the fixed-clock frequency to eg. 100kHz, the error is gone. But I
> guess the 5MHz limit should probably not apply to the input clock?
Heh, I know why that's happening - it's your node name.
The pattern for i2c controllers is "^i2c(@.*)?":
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/i2c/i2c-controller.yaml
Rob co-incidentally (or maybe not) put out a patch for fixed-frequency
clock names, suggesting using clock as a prefix:
https://lore.kernel.org/all/20240425183810.3079069-1-robh@kernel.org/
If we switched to that format, I believe your problem goes away.
Cheers,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-04-26 14:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-25 8:21 [PATCH 0/4] Add I2C support on TH1520 Thomas Bonnefille
2024-04-25 8:21 ` [PATCH 1/4] dt-bindings: i2c: dw: Document compatible thead,th1520-i2c Thomas Bonnefille
2024-04-25 9:48 ` Krzysztof Kozlowski
2024-04-25 8:21 ` [PATCH 2/4] riscv: boot: dts: thead: Fix node ordering in TH1520 device tree Thomas Bonnefille
2024-04-25 9:49 ` Krzysztof Kozlowski
2024-04-25 16:39 ` Conor Dooley
2024-04-25 8:21 ` [PATCH 3/4] riscv: dts: thead: Add TH1520 I2C nodes Thomas Bonnefille
2024-04-29 13:35 ` Emil Renner Berthing
2024-04-25 8:21 ` [PATCH 4/4] riscv: dts: thead: Enable I2C on the BeagleV-Ahead Thomas Bonnefille
2024-04-29 13:38 ` Emil Renner Berthing
2024-04-25 9:00 ` [PATCH 0/4] Add I2C support on TH1520 Conor Dooley
2024-04-25 9:42 ` Thomas Bonnefille
2024-04-25 15:10 ` Drew Fustini
2024-04-25 14:51 ` Rob Herring
2024-04-25 16:35 ` Conor Dooley
2024-04-26 14:12 ` Thomas Bonnefille
2024-04-26 14:42 ` Conor Dooley [this message]
2024-04-29 13:07 ` Thomas Bonnefille
2024-04-29 13:24 ` Conor Dooley
2024-04-25 16:37 ` (subset) " Conor Dooley
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=20240426-patchy-grievance-e7103a344c82@spud \
--to=conor@kernel.org \
--cc=andi.shyti@kernel.org \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=guoren@kernel.org \
--cc=jszhang@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=thomas.bonnefille@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=wefu@redhat.com \
/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: link
Be 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 read-only IMAP folder(s) and NNTP newsgroup(s).