devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: "Sven Peter" <sven@svenpeter.dev>
Cc: "Alyssa Rosenzweig" <alyssa@rosenzweig.io>,
	"Hector Martin" <marcan@marcan.st>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Mark Kettenis" <kettenis@openbsd.org>,
	"Stan Skowronek" <stan@corellium.com>,
	asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/7] PCI: apple: Add T602x PCIe support
Date: Fri, 14 Feb 2025 11:13:47 +0000	[thread overview]
Message-ID: <86o6z4srro.wl-maz@kernel.org> (raw)
In-Reply-To: <ae7bdc0c-c691-43a7-8cd7-b1c22c7623c0@app.fastmail.com>

On Thu, 13 Feb 2025 19:51:31 +0000,
"Sven Peter" <sven@svenpeter.dev> wrote:
> 
> Hi,
> 
> On Wed, Feb 12, 2025, at 10:55, Marc Zyngier wrote:
> > On Tue, 11 Feb 2025 19:54:32 +0000,
> > Alyssa Rosenzweig <alyssa@rosenzweig.io> wrote:
> >> 
> >> From: Hector Martin <marcan@marcan.st>
> >> 
> >> This version of the hardware moved around a bunch of registers, so we
> >> drop the old compatible for these and introduce register offset
> >> structures to handle the differences.
> >> 
> >> Signed-off-by: Hector Martin <marcan@marcan.st>
> >> Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
> >> ---
> >>  drivers/pci/controller/pcie-apple.c | 125 ++++++++++++++++++++++++++++++------
> >>  1 file changed, 105 insertions(+), 20 deletions(-)
> >> 
> >> diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c
> >> index 7f4839fb0a5b15a9ca87337f53c14a1ce08301fc..7c598334427cb56ca066890ac61143ae1d3ed744 100644
> ...
> >
> >> +	else
> >> +		rmw_set(PHY_LANE_CFG_REFCLKCGEN, port->phy + PHY_LANE_CFG);
> >> +	rmw_clear(PORT_APPCLK_CGDIS, port->base + PORT_APPCLK);
> >> +
> >
> > Can you elaborate on this particular change?
> >
> > I always assumed this was some clock-gating that needed to occur
> > *before* the link training was started. This is now taking place after
> > training, and the commit message doesn't say anything about it.
> 
> It's been a while but as far as I can tell APPCLK seems to be related
> to the IOMMUs attached to this controller. If it's disabled all reads
> from the respective IOMMU MMIO either came back as 0xffff.. or SError
> (don't remember which one it was) but pcie itself worked just fine
> (until any device tried DMA ofc).
> 
> At least on M1 this entire sequence only works because we already
> setup PORT_APPCLK_EN inside m1n1. If we didn't do this (like e.g
> for the thunderbolt pcie/dart) the DART probe would already fail.

OK, so the exact location of this particular write doesn't matter as
long as it happens before we start enabling a device on that port.

I'm still perplexed by this one though:

+	if (pcie->hw->port_refclk)
+		rmw_clear(PORT_REFCLK_CGDIS, port->base + PORT_REFCLK);
+	else
+		rmw_set(PHY_LANE_CFG_REFCLKCGEN, port->phy + PHY_LANE_CFG);

which looks like it switches on the reference clock for the port. I
have a very vague recollection that it was required early before
m1n1/u-boot grew some PCI initialisation (yes, a long while ago).

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2025-02-14 11:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 19:54 [PATCH 0/7] PCI: apple: support t6020 Alyssa Rosenzweig
2025-02-11 19:54 ` [PATCH 1/7] dt-bindings: pci: apple,pcie: Add t6020 support Alyssa Rosenzweig
2025-02-13  9:09   ` Krzysztof Kozlowski
2025-02-11 19:54 ` [PATCH 2/7] PCI: apple: Fix missing OF node reference in apple_pcie_setup_port Alyssa Rosenzweig
2025-02-11 19:54 ` [PATCH 3/7] PCI: apple: Set only available ports up Alyssa Rosenzweig
2025-02-11 20:33   ` Bjorn Helgaas
2025-02-11 19:54 ` [PATCH 4/7] PCI: apple: Move port PHY registers to their own reg items Alyssa Rosenzweig
2025-02-11 19:54 ` [PATCH 5/7] PCI: apple: Drop poll for CORE_RC_PHYIF_STAT_REFCLK Alyssa Rosenzweig
2025-02-11 19:54 ` [PATCH 6/7] PCI: apple: Use gpiod_set_value_cansleep in probe flow Alyssa Rosenzweig
2025-02-11 19:54 ` [PATCH 7/7] PCI: apple: Add T602x PCIe support Alyssa Rosenzweig
2025-02-12  9:55   ` Marc Zyngier
2025-02-13 19:51     ` Sven Peter
2025-02-14 11:13       ` Marc Zyngier [this message]
2025-02-13  4:16   ` kernel test robot
2025-02-13 17:56   ` Rob Herring
2025-02-13 18:01     ` Marc Zyngier
2025-02-21 15:47       ` Rob Herring

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=86o6z4srro.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=alyssa@rosenzweig.io \
    --cc=asahi@lists.linux.dev \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kettenis@openbsd.org \
    --cc=krzk+dt@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=marcan@marcan.st \
    --cc=robh@kernel.org \
    --cc=stan@corellium.com \
    --cc=sven@svenpeter.dev \
    /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).