Skip to content

pci: spacemit: fixes for the K1 PCIe host driver

Dave Klotz u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9pci: spacemit: power the slot from vpcie3v3-supplydrivers/pci/pcie_dw_spacemit.c+35 -371 reply
2/9pci: spacemit: hold the PHY interface in reset until link startdrivers/pci/pcie_dw_spacemit.c+4 -21 reply
3/9pci: spacemit: soft reset the controller before bring-updrivers/pci/pcie_dw_spacemit.c+18 -51 reply
4/9pci: spacemit: check clock, reset and iATU setup resultsdrivers/pci/pcie_dw_spacemit.c+14 -21 reply
5/9pci: spacemit: report link up from the link status registerdrivers/pci/pcie_dw_spacemit.c drivers/pci/pcie_dw_spacemit.h+6 -81 reply
6/9pci: spacemit: do not force the link to 2.5 GT/sdrivers/pci/pcie_dw_spacemit.c drivers/pci/pcie_dw_spacemit.h+34 -211 reply
7/9pci: spacemit: do not advertise ASPM L1drivers/pci/pcie_dw_spacemit.c+6 -01 reply
8/9pci: spacemit: set the link width from num-lanesdrivers/pci/pcie_dw_spacemit.c+6 -01 reply
9/9pci: spacemit: do not fail the probe when the link is downdrivers/pci/pcie_dw_spacemit.c+43 -101 reply

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchEric Chung
SeriesR-b R-b
1/9R-b
2/9R-b
3/9R-b
4/9
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/9] pci: spacemit: fixes for the K1 PCIe host driver

Fixes for "pci: spacemit: add DesignWare PCIe host controller driver", following the Linux driver and the bring-up order that works on the boards I have:

- power the slot from the root port's vpcie3v3-supply (the vendor k1x,pwr_on property is not in any upstream device tree);
- keep the PHY interface in reset until LTSSM enable, and soft-reset the controller before bring-up so a warm reset starts clean;
- check clock, reset and iATU setup errors;
- report link up from the SMLH/RDLH bits in the link window;
- leave the link speed alone unless max-link-speed is set, instead of writing Gen1 into LNKCAP and LNKCTL2, so the OS can still train the link at its full speed;
- drop ASPM L1 from LNKCAP as Linux does for NVMe drives;
- set the link width from num-lanes;
- keep the probe successful when the link is down (an empty slot), and answer config cycles behind a down link with all ones.

Tested on an OrangePi RV2: an NVMe drive on port B is found and FreeBSD boots from it by EFI; FreeBSD then retrains the link to x2 at 5 GT/s (with the Gen1 cap in place it could not). Port C, empty, reports "Link down" and nothing hangs. Under U-Boot this drive still trains x1 at 2.5 GT/s.

Two observations about the RV2 device tree, not addressed here:
pcie1_3_cfg and pcie2_4_cfg mux CLKREQ#, and with CLKREQ# muxed the controller gates its DBI clock whenever the endpoint leaves CLKREQ# high, so the next DBI access hangs; I run the board with PERST# only in those groups. And port B needs num-lanes = <2>, which the tree does not set.

Dave Klotz (9):
pci: spacemit: power the slot from vpcie3v3-supply
pci: spacemit: hold the PHY interface in reset until link start
pci: spacemit: soft reset the controller before bring-up
pci: spacemit: check clock, reset and iATU setup results
pci: spacemit: report link up from the link status register
pci: spacemit: do not force the link to 2.5 GT/s
pci: spacemit: do not advertise ASPM L1
pci: spacemit: set the link width from num-lanes
pci: spacemit: do not fail the probe when the link is down

 drivers/pci/pcie_dw_spacemit.c | 231 +++++++++++++++++++++++----------
 drivers/pci/pcie_dw_spacemit.h |  12 --
 2 files changed, 162 insertions(+), 81 deletions(-)

base-commit: a000f2af240eaa996cec92f8d44bad96fdf3f898

Signature · 1 line
2.55.0