linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Rob Herring <robh@kernel.org>
Cc: Matthias Kaehlcke <mka@chromium.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Frank Rowand <frowand.list@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux USB List <linux-usb@vger.kernel.org>,
	Bastien Nocera <hadess@hadess.net>,
	Stephen Boyd <swboyd@chromium.org>,
	Ravi Chandra Sadineni <ravisadineni@chromium.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>, Peter Chen <peter.chen@nxp.com>
Subject: Re: [PATCH v4 1/2] dt-bindings: usb: Add binding for discrete onboard USB hubs
Date: Fri, 2 Oct 2020 10:08:17 -0700	[thread overview]
Message-ID: <CAD=FV=WJrvWBLk3oLpv6Q3uY4w7YeQBXVdkpn+SAS5dnxp9-=Q@mail.gmail.com> (raw)
In-Reply-To: <CAL_Jsq+Zi+hCmUEiSmYw=pVK472=OW1ZjLnkH1NodWUm8FA5+g@mail.gmail.com>

Hi,

On Wed, Sep 30, 2020 at 1:20 PM Rob Herring <robh@kernel.org> wrote:
>
> > > > Datasheets from different manufacturers refer to these ICs as "USB hub
> > > > controller". Calling the node "usb-hub-controller" would indeed help to
> > > > distinguish it from the USB hub devices and represent existing hardware.
> > > > And the USB device could have a "hub-controller" property, which also
> > > > would be clearer than the current "hub" property.
> > >
> > > There aren't 2 (or 3) devices here. There's a single USB device (a
> > > hub) and the DT representation should reflect that.
> >
> > That's not completely true, though, is it?
>
> I was referring to the hub. I only see 1 datasheet, 1 IC and 1 block
> diagram... Lots of devices have more than one interface though usually
> not different speeds of the same thing.

Right, there is certainly more than one way to look at it and the way
to look at it is based on how it's most convenient, I guess.  I mean,
an SoC often has 1 (very long) datasheet, 1 IC, and 1 block diagram
too...

As a more similar example of single device that is listed in more than
one location in the device tree, we can also look at embedded SDIO
BT/WiFi combo cards.  This single device often provides WiFi under an
SDIO bus and BT under a serial / USB bus.  I'm not 100% sure there are
actually cases were the same board provides device tree data to both
at the same time, but "brcm,bcm43540-bt" is an example of providing
data to the Bluetooth (connected over serial port) and
"brcm,bcm4329-fmac" to the WiFi (connected over the SDIO bus).  Of
course WiFi/BT cheat in that the control logic is represented by the
SDIO power sequencing stuff...


Back to our case, though.  I guess the issue here is that we're the
child of more than one bus.  Let's first pretend that the i2c lines of
this hub are actually hooked up and establish how that would look
first.  Then we can think about how it looks if this same device isn't
hooked up via i2c.  In this case, it sounds as if you still don't want
the device split among two nodes.  So I guess you'd prefer something
like:

i2c {
  usb-hub@xx {
    reg = <xx>;
    compatible = "realtek,rts5411", "onboard-usb-hub";
    vdd-supply = <&pp3300_hub>;
    usb-devices = <&usb_controller 1>;
  };
};

...and then you wouldn't have anything under the USB controller
itself.  Is that correct?  So even though there are existing bindings
saying that a USB device should be listed via VID/PID, the desire to
represent this as a single node overrides that, right?  (NOTE: this is
similar to what Matthias proposed in his response except that I've
added an index so that we don't need _anything_ under the controller).

Having this primarily listed under the i2c bus makes sense because the
control logic for the hub is hooked up via i2c.  Having the power
supply associated with it also makes some amount of sense since it's a
control signal.  It's also convenient that i2c devices have their
probe called _before_ we try to detect if they're there because it's
common that i2c devices need power applied first.

Now, just because we don't have the i2c bus hooked up doesn't change
the fact that there is control logic.  We also certainly wouldn't want
two ways of describing this same hub: one way if the i2c is hooked up
and one way if it's not hooked up.  To me this means that the we
should be describing this hub as a top-level node if i2c isn't hooked
up, just like we do with "smsc,usb3503a"

Said another way, we have these points:

a) The control logic for this bus could be hooked up to an i2c bus.

b) If the control logic is hooked up to an i2c bus it feels like
that's where the device's primary node should be placed, not under the
USB controller.

c) To keep the i2c and non-i2c case as similar as possible, if the i2c
bus isn't hooked up the hub's primary node should be a top-level node,
not under the USB controller.


NOTE ALSO: the fact that we might want to list this hub under an i2c
controller also seems like it's a good argument against putting this
logic in the xhci-platform driver?


I _think_ the above representation would be OK with Rob (right?) and I
think it'd be pretty easy to adapt Matthias's existing code to work
with it.  We'd have to make sure we were careful that things worked in
either probe ordering (in case the firmware happened to leave the
power rail on sometimes and the USB devices started probing before the
hub driver did), but it feels like it should be possible, right?


 -Doug

  parent reply	other threads:[~2020-10-02 17:08 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 17:13 [PATCH v4 1/2] dt-bindings: usb: Add binding for discrete onboard USB hubs Matthias Kaehlcke
2020-09-28 17:13 ` [PATCH v4 2/2] USB: misc: Add onboard_usb_hub driver Matthias Kaehlcke
2020-09-28 18:47   ` Alan Stern
2020-09-29  1:43     ` Matthias Kaehlcke
2020-09-29 16:00       ` Alan Stern
2020-09-29 16:50         ` Matthias Kaehlcke
2020-09-28 22:03   ` Doug Anderson
2020-09-29  1:59     ` Matthias Kaehlcke
2020-09-28 22:13 ` [PATCH v4 1/2] dt-bindings: usb: Add binding for discrete onboard USB hubs Doug Anderson
2020-09-29  2:14   ` Matthias Kaehlcke
2020-09-29 20:17 ` Rob Herring
2020-09-29 22:09   ` Matthias Kaehlcke
2020-09-30  1:32     ` Alan Stern
2020-09-30 12:49       ` Matthias Kaehlcke
2020-09-30 14:44         ` Rob Herring
2020-09-30 15:28           ` Doug Anderson
2020-09-30 18:00             ` Doug Anderson
2020-09-30 19:19               ` Rob Herring
2020-10-01 21:39                 ` Matthias Kaehlcke
2020-09-30 19:19             ` Alan Stern
2020-09-30 20:20             ` Rob Herring
2020-10-01  1:24               ` Alan Stern
2020-10-01 21:54                 ` Matthias Kaehlcke
2020-10-02  1:21                   ` Alan Stern
2020-10-02 16:08                     ` Matthias Kaehlcke
2020-10-02 18:48                       ` Alan Stern
2020-10-02 17:08               ` Doug Anderson [this message]
2020-10-02 18:36                 ` Alan Stern
2020-10-02 22:58                   ` Rob Herring
2020-10-03 12:41                     ` Alan Stern
2020-10-05 16:06                       ` Matthias Kaehlcke
2020-10-05 16:15                         ` Alan Stern
2020-10-05 19:18                           ` Matthias Kaehlcke
2020-10-05 19:36                             ` Alan Stern
2020-10-05 19:59                               ` Rob Herring
2020-10-05 23:29                                 ` Matthias Kaehlcke
2020-10-05 19:36                             ` Rob Herring
2020-10-05 19:20                         ` Rob Herring
2020-10-02 22:28                 ` Rob Herring
2020-10-02 23:09                   ` Doug Anderson
2020-10-06  0:45                     ` Matthias Kaehlcke
2020-10-06 14:18                       ` Alan Stern
2020-10-06 16:59                         ` Matthias Kaehlcke
2020-10-06 17:15                           ` Alan Stern
2020-10-06 19:25                             ` Matthias Kaehlcke
2020-10-07  1:00                               ` Alan Stern
2020-10-07 16:03                                 ` Matthias Kaehlcke
2020-10-07 16:38                                   ` Alan Stern
2020-10-07 17:28                                     ` Matthias Kaehlcke
2020-10-07 19:25                                       ` Alan Stern
2020-10-07 19:42                                         ` Matthias Kaehlcke
2020-10-07 20:17                                           ` Alan Stern
2020-10-07 21:42                                             ` Matthias Kaehlcke
2020-10-08 14:09                                               ` Alan Stern
2020-10-09 23:13                                                 ` Matthias Kaehlcke

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='CAD=FV=WJrvWBLk3oLpv6Q3uY4w7YeQBXVdkpn+SAS5dnxp9-=Q@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hadess@hadess.net \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=peter.chen@nxp.com \
    --cc=ravisadineni@chromium.org \
    --cc=robh@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=swboyd@chromium.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).