Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Rokosov <ddrokosov@sberdevices.ru>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: <gregkh@linuxfoundation.org>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <neil.armstrong@linaro.org>,
	<khilman@baylibre.com>, <jbrunet@baylibre.com>,
	<mturquette@baylibre.com>, <vkoul@kernel.org>,
	<kishon@kernel.org>, <hminas@synopsys.com>,
	<Thinh.Nguyen@synopsys.com>, <yue.wang@amlogic.com>,
	<hanjie.lin@amlogic.com>, <kernel@sberdevices.ru>,
	<rockosov@gmail.com>, <linux-usb@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-amlogic@lists.infradead.org>,
	<linux-phy@lists.infradead.org>
Subject: Re: [PATCH v2 5/5] arm64: dts: meson: a1: support USB controller in OTG mode
Date: Tue, 25 Apr 2023 14:06:10 +0300	[thread overview]
Message-ID: <20230425110610.ezhhz2vauc6o4nu2@CAB-WSD-L081021> (raw)
In-Reply-To: <CAFBinCDvyweC-m=nKw+FZFYvASDE2x3e-Vt=JkSzBifu87cnNw@mail.gmail.com>

On Sun, Apr 23, 2023 at 07:51:31PM +0200, Martin Blumenstingl wrote:
> On Tue, Apr 18, 2023 at 1:16 PM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote:
> [...]
> > +                       usb2_phy1: phy@4000 {
> > +                               compatible = "amlogic,a1-usb2-phy";
> > +                               clocks = <&clkc CLKID_USB_PHY_IN>;
> > +                               clock-names = "xtal";
> Out of curiosity since there's also a CLKID_USB_PHY clock (which is
> used for the dwc3 controller below):
> Do we know that this part of the clock hierarchy is correct? I have no
> way to check this myself, so I'm curious if you could verify this
> somehow.
> 
> [...]

I've developed a clock driver for A1 and verified it against the Amlogic
custom driver and datasheet. As you pointed out, there are indeed two
USB phy clocks.
They are labeled as follows in my clock driver:
    * CLKID_USB_PHY_IN (xtal -> usb_phy gated clock) - the phy input clock
    * CLKID_USB_PHY (SYS_CLK_EN based gate) - the synopsys IP gated clock

The current representation of the USB phy clocks is solely based on
my technical opinion, as the datasheet does not provide any detailed
information about them.

Clock driver:
https://lore.kernel.org/all/20230405195927.13487-1-ddrokosov@sberdevices.ru/

> > +                       dwc2: usb@ff500000 {
> > +                               compatible = "amlogic,meson-a1-usb", "snps,dwc2";
> > +                               reg = <0x0 0xff500000 0x0 0x40000>;
> > +                               interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
> > +                               phys = <&usb2_phy1>;
> > +                               phy-names = "usb2_phy";
> Documentation/devicetree/bindings/usb/dwc2.yaml only allows a
> "usb2-phy" (dash instead of underscore).
> 
> [...]

Ah, my fault..

> > +                       dwc3: usb@ff400000 {
> > +                               compatible = "snps,dwc3";
> > +                               reg = <0x0 0xff400000 0x0 0x100000>;
> Note to self: interesting that Amlogic swapped the register location
> of the dwc2 and dwc3 controllers since the G12 generation.

Indeed, during the bringup process, I was surprised to discover that
the dwc2 engine wasn't starting properly. It was quite unexpected, but
also admittedly intriguing as I delved into the issue and tried to
understand the root cause.

-- 
Thank you,
Dmitry

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

      reply	other threads:[~2023-04-25 11:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 11:16 [PATCH v2 0/5] arm64: meson: support Amlogic A1 USB OTG controller Dmitry Rokosov
2023-04-18 11:16 ` [PATCH v2 1/5] phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit Dmitry Rokosov
2023-04-18 11:42   ` neil.armstrong
2023-04-23 17:42   ` Martin Blumenstingl
2023-04-25 10:29     ` Dmitry Rokosov
2023-04-18 11:16 ` [PATCH v2 2/5] usb: dwc2: support dwc2 IP for Amlogic A1 SoC family Dmitry Rokosov
2023-04-18 11:42   ` neil.armstrong
2023-04-21  4:51   ` Minas Harutyunyan
2023-04-18 11:16 ` [PATCH v2 3/5] dt-bindings: usb: dwc2: add support for Amlogic A1 SoC USB peripheral Dmitry Rokosov
2023-04-21 18:01   ` Rob Herring
2023-04-23 17:43   ` Martin Blumenstingl
2023-04-18 11:16 ` [PATCH v2 4/5] usb: dwc3-meson-g12a: support OTG switch for all IP versions Dmitry Rokosov
2023-04-18 11:42   ` neil.armstrong
2023-04-23 17:44   ` Martin Blumenstingl
2023-04-18 11:16 ` [PATCH v2 5/5] arm64: dts: meson: a1: support USB controller in OTG mode Dmitry Rokosov
2023-04-23 17:51   ` Martin Blumenstingl
2023-04-25 11:06     ` Dmitry Rokosov [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=20230425110610.ezhhz2vauc6o4nu2@CAB-WSD-L081021 \
    --to=ddrokosov@sberdevices.ru \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hanjie.lin@amlogic.com \
    --cc=hminas@synopsys.com \
    --cc=jbrunet@baylibre.com \
    --cc=kernel@sberdevices.ru \
    --cc=khilman@baylibre.com \
    --cc=kishon@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=rockosov@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=yue.wang@amlogic.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