From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Bjorn Helgaas <helgaas-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Alexandre Courbot
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v4 1/2] dt-bindings: pci: tegra: Update for per-lane PHYs
Date: Mon, 11 Apr 2016 13:26:54 +0200 [thread overview]
Message-ID: <20160411112654.GC17743@ulmo.ba.sec> (raw)
In-Reply-To: <20160408191142.GD15034@localhost>
[-- Attachment #1: Type: text/plain, Size: 6043 bytes --]
On Fri, Apr 08, 2016 at 02:11:42PM -0500, Bjorn Helgaas wrote:
> Hi Thierry,
>
> I have a couple more questions, probably just because I'm
> DT-illiterate.
>
> On Fri, Apr 08, 2016 at 06:13:13PM +0200, Thierry Reding wrote:
> > From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> >
> > Changes to the pad controller device tree binding have required that
> > each lane be associated with a separate PHY. Update the PCI host bridge
> > device tree binding to allow each root port to define the list of PHYs
> > required to drive the lanes associated with it.
> >
> > Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> > ---
> > Changes in v4:
> > - add additional lanes subnode when dereferencing PHYs from the XUSB pad
> > controller to reflect changes in its binding
> >
> > .../devicetree/bindings/pci/nvidia,tegra20-pcie.txt | 18 +++++++++++++++++-
> > 1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt b/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt
> > index 75321ae23c08..f5364084b494 100644
> > --- a/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt
> > +++ b/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt
> > @@ -60,11 +60,14 @@ Required properties:
> > - afi
> > - pcie_x
> >
> > -Required properties on Tegra124 and later:
> > +Required properties on Tegra124 and later (deprecated):
> > - phys: Must contain an entry for each entry in phy-names.
> > - phy-names: Must include the following entries:
> > - pcie
> >
> > +These properties are deprecated in favour of per-lane PHYs define in each of
> > +the root ports (see below).
> > +
> > Power supplies for Tegra20:
> > - avdd-pex-supply: Power supply for analog PCIe logic. Must supply 1.05 V.
> > - vdd-pex-supply: Power supply for digital PCIe I/O. Must supply 1.05 V.
> > @@ -122,6 +125,13 @@ Required properties:
> > - Root port 0 uses 4 lanes, root port 1 is unused.
> > - Both root ports use 2 lanes.
> >
> > +Required properties for Tegra124 and later:
>
> I had a little trouble disambiguating this from the "Required
> properties on Tegra124 and later (deprecated)" line above. It might
> help if they said:
>
> Required PCIe controller properties on Tegra124 and later (deprecated):
> Required PCIe Root Port properties for Tegra124 and later:
That's kind of implied by the structure of the binding. The first is in
the section dedicated to the description of the host bridge controller,
whereas the second in in the section for root port properties. Granted,
the format for device tree bindings isn't very rich, so this isn't very
easy to spot. Perhaps something like this could help:
NVIDIA Tegra PCIe controller
The top-level device tree node describes the host bridge
controller and properties listed therein apply to the controller
as a whole.
Required properties:
...
Root Ports:
-----------
Root ports are defined as subnodes of the PCIe controller node.
Required properties:
...
Would that help clarify?
> I'm not sure how to interpret the "deprecated" part. Assume I'm
> writing a DTS. What am I supposed to include?
>
> - "phys" and "phy-names" under the PCIe controller *and*
> "phys" and "phy-names" under the Root Port?
>
> - "phys" and "phy-names" under the PCIe controller only if I don't
> supply "phys" and "phy-names" under the Root Port?
>
> My guess is that a board with more than one PHY for PCIe should omit
> "phys" and "phy-names" under the PCIe controller and include them
> under each Root Port. And a board with only one PHY could conceivably
> supply these properties either under the controller or the Root Port
> or both.
Whatever is marked as deprecated should not be used in new bindings at
all. That is, new board files should move to per-lane PHYs, no matter
how many lanes they enable.
The XUSB pad controller that provides these PHYs can be driven by two
different drivers: a pinctrl driver that exposes a single PHY for all
PCI lanes (it uses per-lane nvidia,iddq properties to enable or disable
each of the lanes) or a PHY driver that exposes one PHY per lane. Each
PHY can separately be powered on.
Perhaps a better approach would be to simply remove the deprecated
properties to avoid any possible confusion. It does have the drawback
that old device trees won't have a documentation counterpart.
> > +- phys: Must contain an phandle to a PHY for each entry in phy-names.
> > +- phy-names: Must include an entry for each active lane. Note that the number
> > + of entries does not have to (though usually will) be equal to the specified
> > + number of lanes in the nvidia,num-lanes property. Entries are of the form
> > + "pcie-N": where N ranges from 0 to the value specified in nvidia,num-lanes.
> > +
> > Example:
> >
> > SoC DTSI:
> > @@ -169,6 +179,9 @@ SoC DTSI:
> > ranges;
> >
> > nvidia,num-lanes = <2>;
> > +
> > + phys = <&{/padctl@0,7009f000/pads/pcie/lanes/pcie-4}>;
> > + phy-names = "pcie-0";
>
> I'm also a little confused here because it looks like this root port
> supports two lanes, but there's only one entry in phy-names. I
> thought you needed one entry for each lane.
Not necessarily. I'm not sure if the wording in the description makes it
clear, but there are a limited number of configurations that the root
ports support. However the ports may not want (or need) to drive all of
the lanes that they support. Consider for example one possible
configuration on Tegra124, which is to have one root port operate in x1
mode and the other in x2 mode. The x2 port may have a fixed card wired
to it (onboard) that is x1. Enabling the second lane would be wasting
power because it is never used.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-04-11 11:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 16:13 [PATCH v4 1/2] dt-bindings: pci: tegra: Update for per-lane PHYs Thierry Reding
[not found] ` <1460131994-24493-1-git-send-email-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-08 16:13 ` [PATCH v4 2/2] PCI: tegra: Support " Thierry Reding
[not found] ` <1460131994-24493-2-git-send-email-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-08 18:05 ` Bjorn Helgaas
2016-04-11 11:11 ` Thierry Reding
2016-04-11 17:41 ` Stephen Warren
2016-04-08 16:48 ` [PATCH v4 1/2] dt-bindings: pci: tegra: Update for " Bjorn Helgaas
2016-04-11 10:23 ` Thierry Reding
2016-04-08 19:11 ` Bjorn Helgaas
2016-04-11 11:26 ` Thierry Reding [this message]
[not found] ` <20160411112654.GC17743-EkSeR96xj6Pcmrwk2tT4+A@public.gmane.org>
2016-04-11 16:55 ` Stephen Warren
2016-04-11 17:38 ` Stephen Warren
[not found] ` <570BE129.40907-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2016-04-13 16:23 ` Thierry Reding
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=20160411112654.GC17743@ulmo.ba.sec \
--to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=helgaas-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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).