diff options
author | Michal Simek <michal.simek@xilinx.com> | 2022-02-07 12:36:32 +0300 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2022-02-15 15:04:28 +0300 |
commit | 462f76bc002da9c1d0f4b27380a493dc7928df7e (patch) | |
tree | 83c9a7d970c0ec294a068599a504c502a52c68a6 /drivers | |
parent | fac46bc446e0ca2e5bd8fa4d28f243ee4a1d8995 (diff) | |
download | u-boot-462f76bc002da9c1d0f4b27380a493dc7928df7e.tar.xz |
phy: zynqmp: Add support for sata and DP phy initialization
DP is untested but just c&p from Linux driver. Sata is tested on kv260-revA
board which has SATA connector populated.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/d231610160e76a2ad1b4a163e0e8db0ddc4733e2.1644226590.git.michal.simek@xilinx.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/phy/phy-zynqmp.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/phy/phy-zynqmp.c b/drivers/phy/phy-zynqmp.c index 9dc3d426a3..08c1b6efcf 100644 --- a/drivers/phy/phy-zynqmp.c +++ b/drivers/phy/phy-zynqmp.c @@ -373,6 +373,29 @@ static void xpsgtr_bypass_scrambler_8b10b(struct xpsgtr_phy *gtr_phy) xpsgtr_write_phy(gtr_phy, L0_TX_DIG_61, L0_TM_DISABLE_SCRAMBLE_ENCODER); } +/* DP-specific initialization. */ +static void xpsgtr_phy_init_dp(struct xpsgtr_phy *gtr_phy) +{ + xpsgtr_write_phy(gtr_phy, L0_TXPMD_TM_45, + L0_TXPMD_TM_45_OVER_DP_MAIN | + L0_TXPMD_TM_45_ENABLE_DP_MAIN | + L0_TXPMD_TM_45_OVER_DP_POST1 | + L0_TXPMD_TM_45_OVER_DP_POST2 | + L0_TXPMD_TM_45_ENABLE_DP_POST2); + xpsgtr_write_phy(gtr_phy, L0_TX_ANA_TM_118, + L0_TX_ANA_TM_118_FORCE_17_0); +} + +/* SATA-specific initialization. */ +static void xpsgtr_phy_init_sata(struct xpsgtr_phy *gtr_phy) +{ + struct xpsgtr_dev *gtr_dev = gtr_phy->dev; + + xpsgtr_bypass_scrambler_8b10b(gtr_phy); + + writel(gtr_phy->lane, gtr_dev->siou + SATA_CONTROL_OFFSET); +} + /* SGMII-specific initialization. */ static void xpsgtr_phy_init_sgmii(struct xpsgtr_phy *gtr_phy) { @@ -427,9 +450,12 @@ static int xpsgtr_init(struct phy *x) case ICM_PROTOCOL_SGMII: xpsgtr_phy_init_sgmii(gtr_phy); break; - case ICM_PROTOCOL_DP: case ICM_PROTOCOL_SATA: - return -EINVAL; + xpsgtr_phy_init_sata(gtr_phy); + break; + case ICM_PROTOCOL_DP: + xpsgtr_phy_init_dp(gtr_phy); + break; } dev_dbg(gtr_dev->dev, "lane %u (type %u, protocol %u): init done\n", |