linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Anand Moon <linux.amoon@gmail.com>
Cc: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	quentin.schulz@cherry.de, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH 0/6] Binding and driver for "dumb" clock generators
Date: Wed, 10 Jul 2024 09:50:59 +0200	[thread overview]
Message-ID: <4022386.ZaRXLXkqSa@diego> (raw)
In-Reply-To: <CANAwSgQGoeyy3V9hBNcxFynRgR-rUanUzVN41uFxu0-_OqKKZg@mail.gmail.com>

Hi Anand,

Am Mittwoch, 10. Juli 2024, 05:02:57 CEST schrieb Anand Moon:
> On Tue, 9 Jul 2024 at 18:02, Heiko Stuebner <heiko@sntech.de> wrote:
> >
> > Rockchip boards with PCIe3 controllers inside the soc (rk3568, rk3588) have
> > external clock generators on the board to generate the needed 100MHz
> > reference clock the PCIe3 controller needs.
> >
> > Often these clock generators need supplies to be enabled to run.
> >
> > Modelling this clock has taken a number of shapes:
> > - The rk3568 Rock-3a modelled the generator-regulator as "phy-supply" [0]
> >   &pcie30phy {
> >         phy-supply = <&vcc3v3_pi6c_03>;
> >         status = "okay";
> >   };
> >   which is of course not part of the binding
> >
> > - On the Rock-5-ITX the supply of the clock generator is controlled by
> >   the same gpio as the regulator supplying the the port connected to the
> >   pcie30x4 controller, so if this controller probes first, both
> >   controllers will just run. But if the pcie30x2 controller probes first
> >   (which has a different supply), the controller will stall at the first
> >   dbi read.
> >
> > - Recent Theobroma-Systems boards (Jaguar and Tiger) modelled their
> >   generator as a combination of fixed clock and gpio-gate, which works
> >   because the generator's vdd-supply is always on and only the output-
> >   enable pin needs to be toggled.
> >
> >
> > So this series attempts to improve the situation by allowing to model
> > these clock generators as actual entities in the devicetree, to not have
> > them just accidentially work or break bindings.
> >
> 
> I was wondering if these changes apply to Radxa Rock 5b SbC, it does not have
> pi6c557 clock generator but the schematic supports GEN_CLK_100MHZ is
> input to CLKin0 which is generated via the VCC3V3_PI6C_05 (100MHz,3.3V,3225)
> regulator.

yes, that is the same setup as on the Rock 5 ITX, see it's patch in
this series.

The difference being that for your Rock 5b it already works by accident,
as the pcie30x4 port-supply and the supply for the clock-generator are
controlled by the same gpio.

So it does make sense to model this correctly for correctness sake, but
there is no immediate need for action, as there is no fault happening
like on the Rock 5 ITX with its two separate ports.


Heiko


> > [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts#n605
> >
> > Heiko Stuebner (6):
> >   dt-bindings: clocks: add binding for generic clock-generators
> >   clk: add driver for generic clock generators
> >   arm64: dts: rockchip: fix the pcie clock generator on Rock 5 ITX
> >   arm64: dts: rockchip: use clock-generator for pcie-refclk on
> >     rk3588-jaguar
> >   arm64: dts: rockchip: use clock-generator for pcie-refclk on
> >     rk3588-tiger
> >   arm64: dts: rockchip: add pinctrl for clk-generator gpio on
> >     rk3588-tiger
> >
> >  .../bindings/clock/clock-generator.yaml       |  62 ++++++++
> >  .../arm64/boot/dts/rockchip/rk3588-jaguar.dts |  13 +-
> >  .../boot/dts/rockchip/rk3588-rock-5itx.dts    |  34 ++++-
> >  .../arm64/boot/dts/rockchip/rk3588-tiger.dtsi |  21 +--
> >  drivers/clk/Kconfig                           |   7 +
> >  drivers/clk/Makefile                          |   1 +
> >  drivers/clk/clk-generator.c                   | 133 ++++++++++++++++++
> >  7 files changed, 251 insertions(+), 20 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/clock/clock-generator.yaml
> >  create mode 100644 drivers/clk/clk-generator.c
> >
> > --
> > 2.39.2
> >
> >
> 






      reply	other threads:[~2024-07-10  7:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-09 12:31 [PATCH 0/6] Binding and driver for "dumb" clock generators Heiko Stuebner
2024-07-09 12:31 ` [PATCH 1/6] dt-bindings: clocks: add binding for generic clock-generators Heiko Stuebner
2024-07-09 21:45   ` Stephen Boyd
2024-07-10  8:02     ` Heiko Stübner
2024-07-10 23:56       ` Stephen Boyd
2024-07-10  7:02   ` Alexander Stein
2024-07-10  7:45     ` Heiko Stübner
2024-07-10 23:21       ` Stephen Boyd
2024-07-11  5:27         ` Alexander Stein
2024-07-15 10:59           ` Heiko Stübner
2024-07-09 12:31 ` [PATCH 2/6] clk: add driver for generic clock generators Heiko Stuebner
2024-07-09 12:31 ` [PATCH 3/6] arm64: dts: rockchip: fix the pcie clock generator on Rock 5 ITX Heiko Stuebner
2024-07-09 12:31 ` [PATCH 4/6] arm64: dts: rockchip: use clock-generator for pcie-refclk on rk3588-jaguar Heiko Stuebner
2024-07-09 12:31 ` [PATCH 5/6] arm64: dts: rockchip: use clock-generator for pcie-refclk on rk3588-tiger Heiko Stuebner
2024-07-09 12:31 ` [PATCH 6/6] arm64: dts: rockchip: add pinctrl for clk-generator gpio " Heiko Stuebner
2024-07-10  3:02 ` [PATCH 0/6] Binding and driver for "dumb" clock generators Anand Moon
2024-07-10  7:50   ` Heiko Stübner [this message]

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=4022386.ZaRXLXkqSa@diego \
    --to=heiko@sntech.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux.amoon@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=quentin.schulz@cherry.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.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: 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 NNTP newsgroup(s).