Skip to content

phy: spacemit: k1: fix the PCIe and combo PHY driver

Dave Klotz u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7phy: spacemit: k1: enable refclk and deassert the PHY reset at probedrivers/phy/spacemit/phy-k1-pcie.c+50 -190 replies
2/7phy: spacemit: k1: don't start the combo PHY PLL to calibratedrivers/phy/spacemit/phy-k1-pcie.c+0 -340 replies
3/7phy: spacemit: k1: restore port A state after calibrationdrivers/phy/spacemit/phy-k1-pcie.c+34 -50 replies
4/7phy: spacemit: k1: program the termination fields properlydrivers/phy/spacemit/phy-k1-pcie.c+7 -10 replies
5/7phy: spacemit: k1: set CLKSEL on every lanedrivers/phy/spacemit/phy-k1-pcie.c+7 -40 replies
6/7phy: spacemit: k1: don't overwrite whole PLL control registersdrivers/phy/spacemit/phy-k1-pcie.c+19 -80 replies
7/7phy: spacemit: k1: power on the combo PHY in USB 3 modedrivers/phy/spacemit/phy-k1-pcie.c+80 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] phy: spacemit: k1: fix the PCIe and combo PHY driver

Fixes for the K1 PCIe/combo PHY driver from "phy: spacemit: add K1 PCIe/USB3 combo PHY driver", bringing it in line with the Linux driver:

- enable refclk and take the PHY out of reset at probe, using the clock and reset the binding names, instead of fetching them unused;
- calibrate the termination values the way Linux does, without starting port A's PLL in PCIe mode, and put port A back as it was afterwards;
- clear the termination fields before writing them, set EN_RTERM, set CLKSEL on every lane, and update the PLL control registers with read-modify-write instead of overwriting them;
- add a power_on op that brings the combo PHY up in USB 3 mode (select, test control, timer adjust, SSC, PLL lock wait). Switching the select bit alone leaves the PLL unlocked and the xHCI reset never completes.

Tested on an OrangePi RV2: NVMe on PCIe port B (link up, EFI boot from the drive), an empty port C reporting no link, and a USB 3 stick behind the on-board hub enumerating at 5 Gb/s through the combo PHY with a DWC3 glue driver I will post separately. Not tested: a device on port C, or USB 3 on other K1 boards.

Dave Klotz (7):
phy: spacemit: k1: enable refclk and deassert the PHY reset at probe
phy: spacemit: k1: don't start the combo PHY PLL to calibrate
phy: spacemit: k1: restore port A state after calibration
phy: spacemit: k1: program the termination fields properly
phy: spacemit: k1: set CLKSEL on every lane
phy: spacemit: k1: don't overwrite whole PLL control registers
phy: spacemit: k1: power on the combo PHY in USB 3 mode

 drivers/phy/spacemit/phy-k1-pcie.c | 270 +++++++++++++++++++++--------
 1 file changed, 196 insertions(+), 74 deletions(-)

base-commit: a000f2af240eaa996cec92f8d44bad96fdf3f898

Signature · 1 line
2.55.0