Skip to content

Commit 1969f69

Browse files
Chunfeng Yunkishon
authored andcommitted
phy: phy-mt65xx-usb3: improve RX detection stable time
The default value of RX detection stable time is 10us, and this margin is too big for some critical cases which cause U3 link fail and link to U2(probability is about 1%). So change it to 5us. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent c957b7d commit 1969f69

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/phy/phy-mt65xx-usb3.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@
112112
#define P3D_RG_CDR_BIR_LTD0 GENMASK(12, 8)
113113
#define P3D_RG_CDR_BIR_LTD0_VAL(x) ((0x1f & (x)) << 8)
114114

115+
#define U3P_U3_PHYD_RXDET1 (SSUSB_SIFSLV_U3PHYD_BASE + 0x128)
116+
#define P3D_RG_RXDET_STB2_SET GENMASK(17, 9)
117+
#define P3D_RG_RXDET_STB2_SET_VAL(x) ((0x1ff & (x)) << 9)
118+
119+
#define U3P_U3_PHYD_RXDET2 (SSUSB_SIFSLV_U3PHYD_BASE + 0x12c)
120+
#define P3D_RG_RXDET_STB2_SET_P3 GENMASK(8, 0)
121+
#define P3D_RG_RXDET_STB2_SET_P3_VAL(x) (0x1ff & (x))
122+
115123
#define U3P_XTALCTL3 (SSUSB_SIFSLV_SPLLC + 0x0018)
116124
#define XC3_RG_U3_XTAL_RX_PWD BIT(9)
117125
#define XC3_RG_U3_FRC_XTAL_RX_PWD BIT(8)
@@ -295,6 +303,16 @@ static void phy_instance_init(struct mt65xx_u3phy *u3phy,
295303
tmp |= P3D_RG_CDR_BIR_LTD0_VAL(0xc) | P3D_RG_CDR_BIR_LTD1_VAL(0x3);
296304
writel(tmp, port_base + U3P_PHYD_CDR1);
297305

306+
tmp = readl(port_base + U3P_U3_PHYD_RXDET1);
307+
tmp &= ~P3D_RG_RXDET_STB2_SET;
308+
tmp |= P3D_RG_RXDET_STB2_SET_VAL(0x10);
309+
writel(tmp, port_base + U3P_U3_PHYD_RXDET1);
310+
311+
tmp = readl(port_base + U3P_U3_PHYD_RXDET2);
312+
tmp &= ~P3D_RG_RXDET_STB2_SET_P3;
313+
tmp |= P3D_RG_RXDET_STB2_SET_P3_VAL(0x10);
314+
writel(tmp, port_base + U3P_U3_PHYD_RXDET2);
315+
298316
dev_dbg(u3phy->dev, "%s(%d)\n", __func__, index);
299317
}
300318

0 commit comments

Comments
 (0)