[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02c1ce97-109a-90da-46ce-f8394f00de74@baylibre.com>
Date: Mon, 11 May 2020 10:58:59 +0200
From: Neil Armstrong <narmstrong@...libre.com>
To: Marc Zyngier <maz@...nel.org>, linux-pci@...r.kernel.org,
linux-amlogic@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Bjorn Helgaas <bhelgaas@...gle.com>, Rob Herring <robh@...nel.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Kevin Hilman <khilman@...libre.com>,
Yue Wang <yue.wang@...ogic.com>
Subject: Re: [PATCH] PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up
link
On 29/04/2020 18:42, Marc Zyngier wrote:
> My vim3l board stubbornly refuses to play ball with a bog
> standard PCIe switch (ASM1184e), spitting all kind of errors
> ranging from link never coming up to crazy things like downstream
> ports falling off the face of the planet.
>
> Upon investigating how the PCIe RC is configured, I found the
> following nugget: the Sysnopsys DWC PCIe Reference Manual, in the
> section dedicated to the PLCR register, describes bit 7 (FAST_LINK_MODE)
> as:
>
> "Sets all internal timers to fast mode for simulation purposes."
>
> I completely understand the need for setting this bit from a simulation
> perspective, but what I have on my desk is actual silicon, which
> expects timers to have a nominal value (and I expect this is the
> case for most people).
>
> Making sure the FAST_LINK_MODE bit is cleared when configuring the RC
> solves this problem.
>
> Fixes: 9c0ef6d34fdb ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver")
> Signed-off-by: Marc Zyngier <maz@...nel.org>
> ---
> drivers/pci/controller/dwc/pci-meson.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> index 3715dceca1bf..ca59ba9e0ecd 100644
> --- a/drivers/pci/controller/dwc/pci-meson.c
> +++ b/drivers/pci/controller/dwc/pci-meson.c
> @@ -289,11 +289,11 @@ static void meson_pcie_init_dw(struct meson_pcie *mp)
> meson_cfg_writel(mp, val, PCIE_CFG0);
>
> val = meson_elb_readl(mp, PCIE_PORT_LINK_CTRL_OFF);
> - val &= ~LINK_CAPABLE_MASK;
> + val &= ~(LINK_CAPABLE_MASK | FAST_LINK_MODE);
> meson_elb_writel(mp, val, PCIE_PORT_LINK_CTRL_OFF);
>
> val = meson_elb_readl(mp, PCIE_PORT_LINK_CTRL_OFF);
> - val |= LINK_CAPABLE_X1 | FAST_LINK_MODE;
> + val |= LINK_CAPABLE_X1;
> meson_elb_writel(mp, val, PCIE_PORT_LINK_CTRL_OFF);
>
> val = meson_elb_readl(mp, PCIE_GEN2_CTRL_OFF);
>
I don't have HW to test on non NVMe, but I'm reading the same as you in the
DWC PCIe Reference Manual, and it seems coherent.
Reviewed-by: Neil Armstrong <narmstrong@...libre.com>
Neil
Powered by blists - more mailing lists