linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Richard Zhu <hongxing.zhu@nxp.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	PCI <linux-pci@vger.kernel.org>,
	devicetree@vger.kernel.org, Sascha Hauer <kernel@pengutronix.de>,
	patchwork-lst@pengutronix.de
Subject: Re: [PATCH 3/7] PCI: imx6: Rework PHY search and mapping
Date: Tue, 11 May 2021 10:22:48 -0500	[thread overview]
Message-ID: <CAL_JsqKa2AFm6kESB8R=9pn4=_x80kpRd90THgGEkBbymOU6kA@mail.gmail.com> (raw)
In-Reply-To: <2ea9546c7dc1644376576db2cb01005fb041f349.camel@pengutronix.de>

On Tue, May 11, 2021 at 9:54 AM Lucas Stach <l.stach@pengutronix.de> wrote:
>
> Am Dienstag, dem 11.05.2021 um 09:21 -0500 schrieb Rob Herring:
> > On Tue, May 11, 2021 at 3:11 AM Lucas Stach <l.stach@pengutronix.de> wrote:
> > >
> > > Am Montag, dem 10.05.2021 um 12:05 -0500 schrieb Rob Herring:
> > > > On Mon, May 10, 2021 at 04:15:05PM +0200, Lucas Stach wrote:
> > > > > We don't need to have a phandle of the PHY, as we know the compatible
> > > > > of the node we are looking for. This will make it easier to put add
> > > > > more PHY handling for new generations later on, where the
> > > > > "fsl,imx7d-pcie-phy" phandle would be a misnomer.
> > > > >
> > > > > Also we can use a helper function to get the resource for us,
> > > > > simplifying out driver code a bit.
> > > >
> > > > Better yes, but really all the phy handling should be split out to
> > > > its own driver even in the older h/w with shared phy registers.
> > > >
> > > That would be a quite massive DT binding changing break, possibly even
> > > a separate driver. Maybe it's time to do this for i.MX8MM, as the
> > > current driver just kept piling on special cases for "almost the same"
> > > hardware that by now looks quite different to the original i.MX6 PCIe
> > > integration this driver was supposed to handle.
> >
> > No, you don't need to change DT, and a DT change adding a phy node
> > wouldn't even be correct modeling of the h/w IMO. For the i.MX6 phy, a
> > separate PHY driver would have to create its own platform device in
> > its initcall (if the iMX6 PCI compatible is found). Then the PCI
> > driver would need to use a non-DT based phy_get() lookup. For the
> > cases with a phandle to the phy, I'd assume a phy driver could be
> > instantiated for that node. You'll again need a non-DT phy_get() if
> > not using the phy binding.
>
> The original i.MX6 PCIe with the internal PHY is the easy case, as you
> laid out above.
>
> What I'm more concerned about is the i.MX7 and i.MX8MQ, where we have a
> MMIO mapped PHY and quite a bit of the clocks/reset/GPR handling would
> need to move from the controller to the PHY driver. Without a binding
> change I fear that we end up in a worst of both worlds situation, where
> we have lots of code in the driver to separate resources that are
> currently all attached to the PCIe controller node in the DT, without a
> real gain in making the driver any simpler or easier to maintain.

One option for handling compatibility is making an overlay for old DTs
instead of coding the old DT handling. There's an example of this for
rcar-du in drivers/gpu/drm/rcar-du/rcar_du_of_lvds_*.dts.

Rob

  reply	other threads:[~2021-05-11 15:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 14:15 [PATCH 1/7] PCI: imx6: Move i.MX8MQ controller instance check to correct case statement Lucas Stach
2021-05-10 14:15 ` [PATCH 2/7] PCI: imx6: Initialize ATU unroll offset Lucas Stach
2021-05-11 20:03   ` Rob Herring
2021-05-10 14:15 ` [PATCH 3/7] PCI: imx6: Rework PHY search and mapping Lucas Stach
2021-05-10 17:05   ` Rob Herring
2021-05-11  8:11     ` Lucas Stach
2021-05-11 14:21       ` Rob Herring
2021-05-11 14:54         ` Lucas Stach
2021-05-11 15:22           ` Rob Herring [this message]
2021-08-04 11:55           ` Lorenzo Pieralisi
2021-05-10 14:15 ` [PATCH 4/7] dt-bindings: imx6q-pcie: add a property configure refclk pad usage mode Lucas Stach
2021-05-11 19:55   ` Rob Herring
2021-05-10 14:15 ` [PATCH 5/7] PCI: imx6: Configure PHY refclock according to DT property Lucas Stach
2021-05-10 14:15 ` [PATCH 6/7] dt-bindings: imx6q-pcie: add compatibles for i.MX8MM PCIe Lucas Stach
2021-05-10 14:15 ` [PATCH 7/7] PCI: imx6: Add i.MX8MM support Lucas Stach
2021-06-23 13:46 ` [PATCH 1/7] PCI: imx6: Move i.MX8MQ controller instance check to correct case statement Lorenzo Pieralisi

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='CAL_JsqKa2AFm6kESB8R=9pn4=_x80kpRd90THgGEkBbymOU6kA@mail.gmail.com' \
    --to=robh@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hongxing.zhu@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=patchwork-lst@pengutronix.de \
    --subject='Re: [PATCH 3/7] PCI: imx6: Rework PHY search and mapping' \
    /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

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).