linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Adam Ford-BE <aford@beaconembedded.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Luca Ceresoli <luca@lucaceresoli.net>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Charles Stevens <charles.stevens@logicpd.com>
Subject: Re: [PATCH 01/18] arm64: dts: renesas: beacon kit: Configure programmable clocks
Date: Wed, 5 May 2021 07:07:12 -0500	[thread overview]
Message-ID: <CAHCN7xLtYxQtY4NDo2UVdwbEJ5mKcL2jysack2yddCp6-+p95g@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdUDb8e3Vv3C3N74D2-VYgsyVEHG9iVcnuNESTX6NArkFA@mail.gmail.com>

On Mon, Dec 28, 2020 at 6:33 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Adam,
>
> On Thu, Dec 24, 2020 at 2:53 PM Adam Ford <aford173@gmail.com> wrote:
> > On Tue, Dec 22, 2020 at 2:03 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > On Tue, Dec 22, 2020 at 2:39 AM Adam Ford <aford173@gmail.com> wrote:
> > > > On Fri, Dec 18, 2020 at 7:16 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > > > On Thu, Dec 17, 2020 at 12:52 PM Adam Ford <aford173@gmail.com> wrote:
> > > > > > On Thu, Dec 17, 2020 at 2:16 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > > > > > On Wed, Dec 16, 2020 at 6:03 PM Adam Ford <aford173@gmail.com> wrote:
> > > > > > > > On Wed, Dec 16, 2020 at 8:55 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > > > > > > > On Sun, Dec 13, 2020 at 7:38 PM Adam Ford <aford173@gmail.com> wrote:
> > > > > > > > > > When the board was added, clock drivers were being updated done at
> > > > > > > > > > the same time to allow the versaclock driver to properly configure
> > > > > > > > > > the modes.  Unforutnately, the updates were not applied to the board
> > > > > > >
> > > > > > > > > > --- a/arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi
> > > > > > > > > > +++ b/arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi
> > > > > > > > > > @@ -5,6 +5,7 @@
> > > > > > > > > >
> > > > > > > > > >  #include <dt-bindings/gpio/gpio.h>
> > > > > > > > > >  #include <dt-bindings/input/input.h>
> > > > > > > > > > +#include <dt-bindings/clk/versaclock.h>
> > > > > > > > > >
> > > > > > > > > >  / {
> > > > > > > > > >         backlight_lvds: backlight-lvds {
> > > > > > > > > > @@ -294,12 +295,12 @@ &du_out_rgb {
> > > > > > > > > >  &ehci0 {
> > > > > > > > > >         dr_mode = "otg";
> > > > > > > > > >         status = "okay";
> > > > > > > > > > -       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
> > > > > > > > > > +       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&versaclock5 3>;
> > > > > > > > >
> > > > > > > > > Why this change? You said before you don't need this
> > > > > > > > > https://lore.kernel.org/linux-renesas-soc/CAHCN7xJWbP16SA-Ok-5syNnqOZAt8OFJo2_rtg5VrNVsN2-eiQ@mail.gmail.com/
> > > > > > > > >
> > > > > > > >
> > > > > > > > I had talked with the hardware guys about buy pre-programmed
> > > > > > > > versaclock chips which would have been pre-configured and pre-enabled.
> > > > > > > > I thought it was going to happen, but it didn't, so we need the
> > > > > > > > versaclock driver to enable the reference clock for the USB
> > > > > > > > controllers, ethernet controller and audio clocks.  Previously we were
> > > > > > > > manually configuring it or it was coincidentally working. Ideally,
> > > > > > > > we'd have the clock system intentionally enable/disable the clocks
> > > > > > > > when drivers are loaded/unloaded for for power management reasons.
> > > > > > >
> > > > > > > Can you tell me how exactly the Versaclock outputs are wired?
> > > > > >
> > > > > > The SoC is expecting a fixed external 50 MHz clock connected to
> > > > > > USB_EXTAL.  Instead of a fixed clock, we're using the Versaclock.
> > > > > > We're also using the Versaclock to drive the AVB TXCRefClk,
> > > > > > du_dotclkiun0 and du_dotclkin2 (also also called du_dotclkin3 on
> > > > > > RZ/G2N) instead of fixed clocks.
> > > > > >
> > > > > > > E.g. for USB, the bindings don't say anything about a third clock input,
> > > > > > > so I'd like to know where that clock is fed into USB.
> > > > > >
> > > > > > The way the driver is crafted, it can take in multiple clocks and it
> > > > > > goes through a list to enable them all, so I added the versaclock to
> > > > > > the array.  Without the versaclock reference, the clock doesn't get
> > > > > > turned on and the USB fails to operate.
> > > > >
> > > > > According to the Hardware User's Manual, USBL_EXTAL is used for USB3.0,
> > > > > while you added the clock references to the EHCI nodes.
> > > > > Are you sure EHCI is failing without this?
> >
> > I talked to a colleague about the USB_EXTAL.  He pointed me to table
> > 60.1 of the RZ/2 Series, 2nd Generate reference manual
> > (R01UH0808EJ0100 Rev.1.00),  which shows the USB EHCI needing the
> > 50MHz.  When I clear out the references from ehci0 and echi1, the USB
> > stops working, so it does appear that using the versaclock as the 3rd
> > clock is needed for operating.  The device tree bindings for the
> > generic-ehci provide for up to 4 clocks, so it seems like referencing
> > clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&versaclock5 3> are
> > not a violation of the bindings.
>
> Perhaps you need to use renesas,rcar-usb2-clock-sel?
> Documentation/devicetree/bindings/clock/renesas,rcar-usb2-clock-sel.yaml
>

Geert,

Sorry to resurrect an old thread, but I've been working with a
colleague on this, but we've had a lot of interruptions, and we're
just now getting back to this.

Based on our previous conversations, you didn’t want me to add a
reference clock to the EHCI node, because you wanted us to use the
rcar-usb2-clock-sel driver.
If I just add the node for the rcar-usb2-clock-sel  that references
the versaclock, the clock tree shows it’s present, but neither the
rcar-usb2-clock-sel nor the versaclock are actually enabled.  From
what we’re seeing, the rcar-usb2-clock-sel driver needs a consumer in
order for it to activate.

It seems like it makes sense to optionally associate the
rcar-usb2-clock-sel to all USB nodes, including the USB3 node. The
EHCI controller section in the UG calls out USB_XTAL/USB_EXTAL as
external pins as well as the USBHS module calling out the same pins in
its overview section.  The USB3 Phy section mentions
USB_XTAL/USB_EXTAL, but for some reason the USB3 controller overview
does not mention them as “external pins”

I’d like to propose that we add an optional reference clock for the
USB3 which can point to the rcar-usb2-clock-sel.
On the USB EHCI nodes where I previously wanted to reference the
versaclock, I’d like to reference the rcar-usb2-clock-sel.

The clock tree would look something like:
     Versaclock-> rcar-usb2-clock-sel->USB

The EHCI clocks would look like:
 clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>

If we do it this way, we’d need to modify the rcar-usb2-clock-sel to
enable the external versaclock and keep it enabled.  Currently, it
enables the clock, reads the clock speed and shuts down after
determining the clock speed.

An alternative to modifying the rcar-usb2-clock-sel code would be to
add both usb2_clksel and the versaclock reference to the EHCI nodes,
but I know you were not completely satisfied with that idea, but it
would likely not require any code changes.

Versaclock-> rcar-usb2-clock-sel->USB<-versaclock

The ECHI clocks would like:
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&versaclock5 3>,
<&usb2_clksel>

Before I move forward on writing this code, I'd like to make sure
you're OK with one of those options , since there are a few ways to do
it.  If you have another suggestion, I'm willing to do that instead.

adam
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

  parent reply	other threads:[~2021-05-05 12:10 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13 18:37 [PATCH 00/18] arm64: dts: renesas: Cleanup Beacon Kit and support more SoC's Adam Ford
2020-12-13 18:37 ` [PATCH 01/18] arm64: dts: renesas: beacon kit: Configure programmable clocks Adam Ford
2020-12-16 14:55   ` Geert Uytterhoeven
2020-12-16 17:03     ` Adam Ford
2020-12-17  8:16       ` Geert Uytterhoeven
2020-12-17 11:52         ` Adam Ford
2020-12-18 13:16           ` Geert Uytterhoeven
2020-12-22  1:39             ` Adam Ford
2020-12-22  8:03               ` Geert Uytterhoeven
2020-12-24 13:52                 ` Adam Ford
2020-12-28 12:33                   ` Geert Uytterhoeven
2020-12-28 14:38                     ` Adam Ford
2020-12-28 14:52                       ` Geert Uytterhoeven
2021-05-05 12:07                     ` Adam Ford [this message]
2020-12-13 18:37 ` [PATCH 02/18] arm64: dts: renesas: beacon kit: Fix choppy Bluetooth Audio Adam Ford
2020-12-17 10:41   ` Geert Uytterhoeven
2020-12-17 12:16     ` Adam Ford
2020-12-18 13:00       ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 03/18] arm64: dts: renesas: beacon kit: Remove unnecessary nodes Adam Ford
2020-12-17 10:43   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 04/18] arm64: dts: renesas: beacon kit: Fix Audio Clock sources Adam Ford
2020-12-17 10:54   ` Geert Uytterhoeven
2020-12-17 12:01     ` Adam Ford
2020-12-18 13:05       ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 05/18] arm64: dts: renesas: beacon: Fix audio-1.8V pin enable Adam Ford
2020-12-17 10:57   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 06/18] arm64: dts: renesas: beacon: Configure Audio CODEC clocks Adam Ford
2020-12-17 11:11   ` Geert Uytterhoeven
2020-12-17 13:33     ` Adam Ford
2020-12-17 17:58       ` Adam Ford
2020-12-18 12:57       ` Geert Uytterhoeven
2020-12-18 14:23         ` Adam Ford
2020-12-13 18:37 ` [PATCH 07/18] arm64: dts: renesas: beacon: Fix LVDS PWM Backlight Adam Ford
2020-12-17 11:14   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 08/18] arm64: dts: renesas: beacon: Enable SCIF4 Adam Ford
2020-12-17 11:20   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 09/18] arm64: dts: renesas: beacon: Fix RGB Display PWM Backlight Adam Ford
2020-12-17 11:24   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 10/18] arm64: dts: renesas: Don't make vccq_sdhi0 always on Adam Ford
2020-12-17 11:24   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 11/18] arm64: dts: renesas: beacon: Remove redundant audio code Adam Ford
2020-12-13 18:37 ` [PATCH 12/18] arm64: dts: renesas: beacon: Better describe keys Adam Ford
2020-12-17 11:31   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 13/18] arm64: dts: renesas: beacon: Enable SPI Adam Ford
2020-12-17 11:34   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 14/18] arm64: dts: renesas: beacon: Correct I2C bus speeds Adam Ford
2020-12-17 11:38   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 15/18] arm64: dts: renesas: beacon-rzg2m-kit: Rearange SoC unique functions Adam Ford
2020-12-17 11:41   ` Geert Uytterhoeven
2020-12-17 11:47     ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 16/18] dt-bindings: arm: renesas: Add Beacon RZ/G2N and RZ/G2H boards Adam Ford
2020-12-15 17:03   ` Rob Herring
2020-12-17 11:42   ` Geert Uytterhoeven
2020-12-13 18:37 ` [PATCH 17/18] arm64: dts: renesas: Introduce r8a774b1-beacon-rzg2n-kit Adam Ford
2020-12-17 11:49   ` Geert Uytterhoeven
2020-12-22 13:58     ` Adam Ford
2020-12-22 14:26       ` Biju Das
2020-12-13 18:37 ` [PATCH 18/18] arm64: dts: renesas: Introduce r8a774e1-beacon-rzg2h-kit Adam Ford
2020-12-17 11:51   ` Geert Uytterhoeven

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=CAHCN7xLtYxQtY4NDo2UVdwbEJ5mKcL2jysack2yddCp6-+p95g@mail.gmail.com \
    --to=aford173@gmail.com \
    --cc=aford@beaconembedded.com \
    --cc=charles.stevens@logicpd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=luca@lucaceresoli.net \
    --cc=magnus.damm@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.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 NNTP newsgroup(s).