public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Varadarajan Narayanan <quic_varada@quicinc.com>
Cc: bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com,
	manivannan.sadhasivam@linaro.org, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, vkoul@kernel.org,
	kishon@kernel.org, andersson@kernel.org, konradybcio@kernel.org,
	p.zabel@pengutronix.de, quic_nsekar@quicinc.com,
	dmitry.baryshkov@linaro.org, linux-arm-msm@vger.kernel.org,
	linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
	Praveenkumar I <quic_ipkumar@quicinc.com>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: Re: [PATCH v5 4/5] arm64: dts: qcom: ipq5332: Add PCIe related nodes
Date: Fri, 17 Jan 2025 14:27:08 -0600	[thread overview]
Message-ID: <20250117202708.GA655559@bhelgaas> (raw)
In-Reply-To: <Z4dqnr9+MTue3VbX@hu-varada-blr.qualcomm.com>

On Wed, Jan 15, 2025 at 01:28:22PM +0530, Varadarajan Narayanan wrote:
> On Wed, Jan 08, 2025 at 12:32:35PM -0600, Bjorn Helgaas wrote:
> > On Thu, Jan 02, 2025 at 05:00:18PM +0530, Varadarajan Narayanan wrote:
> > > From: Praveenkumar I <quic_ipkumar@quicinc.com>
> > >
> > > Add phy and controller nodes for pcie0_x1 and pcie1_x2.

> > > +		pcie1: pcie@18000000 {
> > > +			compatible = "qcom,pcie-ipq5332", "qcom,pcie-ipq9574";
> > > +			reg = <0x00088000 0x3000>,
> > > +			      <0x18000000 0xf1d>,
> > > +			      <0x18000f20 0xa8>,
> > > +			      <0x18001000 0x1000>,
> > > +			      <0x18100000 0x1000>,
> > > +			      <0x0008b000 0x1000>;
> > > +			reg-names = "parf",
> > > +				    "dbi",
> > > +				    "elbi",
> > > +				    "atu",
> > > +				    "config",
> > > +				    "mhi";
> > > +			device_type = "pci";
> > > +			linux,pci-domain = <1>;
> > > +			bus-range = <0x00 0xff>;

> > > +			num-lanes = <2>;
> > > +			phys = <&pcie1_phy>;
> > > +			phy-names = "pciephy";
> >
> > I think num-lanes and PHY info are per-Root Port properties, not a
> > host controller properties, aren't they?  Some of the clock and reset
> > properties might also be per-Root Port.
> >
> > Ideally, I think per-Root Port properties should be in a child device
> > as they are here:
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/pci/mvebu-pci.txt?id=v6.12#n137
> > but it looks like the num-lanes parsing is done in
> > dw_pcie_get_resources(), which can only handle a single num-lanes per
> > DWC controller, so maybe it's impractical to add a child device here.
> >
> > But I wonder if it would be useful to at least group the per-Root Port
> > things together in the binding to help us start thinking about the
> > difference between the controller and the Root Port(s).
> 
> This looks like a big change and might impact the existing
> SoCs/platforms. To minimize the impact, should we continue
> supporting the legacy method in addition to the new per-Root port
> approach. Should we take this up separately? Kindly advice.

I just meant to change the order they're listed in the binding, not
add any new device stanzas.

E.g., maybe it could be arranged like this, where things that apply to
the Root Complex as a whole (bus-range, #address-cells, #size-cells,
ranges, etc) are listed first, and the Root Port-related things
(num-lanes, phys, etc) are listed later:

+               pcie1: pcie@18000000 {
+                       compatible = "qcom,pcie-ipq5332", "qcom,pcie-ipq9574";
+                       device_type = "pci";
+                       linux,pci-domain = <1>;
+                       bus-range = <0x00 0xff>;
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       ranges = <0x01000000 0 0x18200000 0x18200000 0 0x00100000>,
+                                <0x02000000 0 0x18300000 0x18300000 0 0x07d00000>;
+                       interrupts = <GIC_SPI 403 IRQ_TYPE_LEVEL_HIGH>, ...
+                       clocks = <&gcc GCC_PCIE3X2_AXI_M_CLK>, ...
+                       resets = <&gcc GCC_PCIE3X2_PIPE_ARES>, ...
+                       interconnects = <&gcc MASTER_SNOC_PCIE3_2_M ...

Everything above is potentially shared; everything below applies to a
single (the only one in this case) Root Port.

+                       num-lanes = <2>;
+                       phys = <&pcie1_phy>;
+
+                       status = "disabled";
+               };

I want people to think about which things belong to the Root Port and
which are shared for the whole Root Complex.

For new drivers, I think we should actually add "pcie@1,0" stanzas for
each Root Port, even if there is only one.

But for existing drivers that would have to be modified to comprehend
new stanzas, collecting the Root Port things so they are together in
the PCI controller stanza would be a good start (unless the order of
properties in the DT makes a functional difference, of course).

Bjorn

  reply	other threads:[~2025-01-17 20:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 11:30 [PATCH v5 0/5] Add PCIe support for Qualcomm IPQ5332 Varadarajan Narayanan
2025-01-02 11:30 ` [PATCH v5 1/5] dt-bindings: phy: qcom,uniphy-pcie: Document PCIe uniphy Varadarajan Narayanan
2025-01-03  7:42   ` Krzysztof Kozlowski
2025-01-02 11:30 ` [PATCH v5 2/5] phy: qcom: Introduce PCIe UNIPHY 28LP driver Varadarajan Narayanan
2025-01-03  5:48   ` Dmitry Baryshkov
2025-01-03  7:43     ` Krzysztof Kozlowski
2025-01-02 11:30 ` [PATCH v5 3/5] dt-bindings: PCI: qcom: Document the IPQ5332 PCIe controller Varadarajan Narayanan
2025-01-03  7:45   ` Krzysztof Kozlowski
2025-01-07 11:05     ` Varadarajan Narayanan
2025-01-08  7:19       ` Krzysztof Kozlowski
2025-01-08  7:40         ` Varadarajan Narayanan
2025-01-08 10:10           ` Krzysztof Kozlowski
2025-01-02 11:30 ` [PATCH v5 4/5] arm64: dts: qcom: ipq5332: Add PCIe related nodes Varadarajan Narayanan
2025-01-08 13:22   ` Manivannan Sadhasivam
2025-01-10  4:36     ` Varadarajan Narayanan
2025-01-22  5:05       ` Varadarajan Narayanan
2025-01-08 18:32   ` Bjorn Helgaas
2025-01-15  7:58     ` Varadarajan Narayanan
2025-01-17 20:27       ` Bjorn Helgaas [this message]
2025-01-02 11:30 ` [PATCH v5 5/5] arm64: dts: qcom: ipq5332-rdp441: Enable PCIe phys and controllers Varadarajan Narayanan

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=20250117202708.GA655559@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_ipkumar@quicinc.com \
    --cc=quic_nsekar@quicinc.com \
    --cc=quic_varada@quicinc.com \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.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