linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v7 usb-next 4/4] dt-bindings: usb: xhci: include the roothub and a device in the example
Date: Mon, 30 Oct 2017 15:08:07 +0100	[thread overview]
Message-ID: <CAK8P3a1xdUy7g991MbtrSTYFsM864MQDc61=sLZmfSMwrokCBg@mail.gmail.com> (raw)
In-Reply-To: <CAFBinCBocmr6fywO9vqWu+ngfrbG=FBFqdEvYEBWR84VgMANpw@mail.gmail.com>

On Sat, Oct 28, 2017 at 3:33 PM, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
> On Fri, Oct 27, 2017 at 9:55 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
>> On Fri, 27 Oct 2017, Martin Blumenstingl wrote:
>>> >> diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt
>>> >> index 5b49ba9f2f9a..20e5ce2b016a 100644
>>> >> --- a/Documentation/devicetree/bindings/usb/usb-xhci.txt
>>> >> +++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt
>>> >> @@ -42,4 +42,27 @@ Example:
>>> >>               compatible = "generic-xhci";
>>> >>               reg = <0xf0931000 0x8c8>;
>>> >>               interrupts = <0x0 0x4e 0x0>;
>>> >> +
>>> >> +             #address-cells = <1>;
>>> >> +             #size-cells = <0>;
>>> >> +
>>> >> +             /* see usb-roothub.txt */
>>> >> +             roothub at 0 {
>>> >> +                     compatible = "usb1d6b,3", "usb1d6b,2";
>>> >> +                     #address-cells = <1>;
>>> >> +                     #size-cells = <0>;
>>> >> +                     reg = <0>;
>>> >> +
>>> >> +                     port at 1 {
>>> >> +                             reg = <1>;
>>> >> +                             phys = <&usb2_phy1>, <&usb3_phy1>;
>>> >> +                             phy-names = "usb2-phy", "usb3-phy";
>>> >> +                     };
>>> >> +             };
>>> >> +
>>> >> +             /* see usb-device.txt */
>>> >> +             hub: genesys at 1 {

>> Two things to be aware of:
>>
>>     1.  /sys/kernel/debug/usb/devices has an off-by-one error in the
>>         "Port=" field.  Every value you see should actually be one
>>         higher than it is.  It has been this way for many, many years
>>         so we can't fix it now.
> here's the output of "lsusb -t" (which is easier to read I guess):
> # lsusb -t
> /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/0p, 5000M
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
>    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
>        |__ Port 3: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M

I see two possible problems here:

* Linux does show the root hub as a parent of the external hub,
  while the DT shows them as two unrelated children of the host
  controller. This clearly doesn't reflect the reality, and may come
  to bite us again later when we try to extend it in some other way.

* Listing the root hub as compatible="usb1d6b,3" encodes a Linux
  implementation detail into the OS-independent DT ABI: The
  root hub does not actually have this vendor/device ID, it's
  just something we make up in Linux.

I think you mentioned that an earlier version of the patch set
did not have the root hub at all but instead listed the PHYs directly
under the host controller. Can you summarize what the problem
with that approach was?

Is it correct that roothub at 0/port at 1 corresponds to the same
connector that genesys at 1 is connected to?

      Arnd

  reply	other threads:[~2017-10-30 14:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 21:57 [PATCH v7 usb-next 0/4] initialize (multiple) PHYs on the roothub Martin Blumenstingl
2017-10-23 21:57 ` [PATCH v7 usb-next 1/4] dt-bindings: usb: add the documentation for USB root-hub Martin Blumenstingl
2017-10-23 21:57 ` [PATCH v7 usb-next 2/4] usb: core: add a wrapper for the USB PHYs on the root-hub Martin Blumenstingl
2017-10-24  0:06   ` Chunfeng Yun
2017-10-23 21:57 ` [PATCH v7 usb-next 3/4] usb: core: hcd: integrate the PHY roothub wrapper Martin Blumenstingl
2017-10-24  0:07   ` Chunfeng Yun
2017-10-26  5:42   ` Manu Gautam
2017-10-30 23:10     ` Martin Blumenstingl
2017-10-31 11:30       ` Chunfeng Yun
2017-10-23 21:57 ` [PATCH v7 usb-next 4/4] dt-bindings: usb: xhci: include the roothub and a device in the example Martin Blumenstingl
2017-10-27  3:29   ` Rob Herring
2017-10-27 19:20     ` Martin Blumenstingl
2017-10-27 19:55       ` Alan Stern
2017-10-28 13:33         ` Martin Blumenstingl
2017-10-30 14:08           ` Arnd Bergmann [this message]
2017-10-30 22:59             ` Martin Blumenstingl
2017-11-12 20:48               ` Martin Blumenstingl

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='CAK8P3a1xdUy7g991MbtrSTYFsM864MQDc61=sLZmfSMwrokCBg@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=linus-amlogic@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: 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).