mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
phy: rockchip: rockchip-inno-usb2: tuning pre-emphasize for rk3399
In current code, the pre-emphasize in eop state and chirp state are disabled only if we add “rockchip,u2phy-tuning” property in RK3399 dts, But we find that if we enable the pre-emphasize of sop/eop/chirp state for rk3399 by default, it will cause usb2 compliance test item - EL_8 and EL_9 failure, so disable the pre-emphasize of sop/eop/chirp state by default. And this can also help to avoid mis-trigger the disconnect detection or high-speed handshake failure. Change-Id: I5ceac9c88de4cdae5af904e973124c194f7718f6 Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
@@ -1830,6 +1830,30 @@ static int rk3399_usb2phy_tuning(struct rockchip_usb2phy *rphy)
|
||||
struct device_node *node = rphy->dev->of_node;
|
||||
int ret = 0;
|
||||
|
||||
if (rphy->phy_cfg->reg == 0xe450) {
|
||||
/*
|
||||
* Disable the pre-emphasize in eop state
|
||||
* and chirp state to avoid mis-trigger the
|
||||
* disconnect detection and also avoid hs
|
||||
* handshake fail for PHY0.
|
||||
*/
|
||||
ret |= regmap_write(rphy->grf, 0x4480,
|
||||
GENMASK(17, 16) | 0x0);
|
||||
ret |= regmap_write(rphy->grf, 0x44b4,
|
||||
GENMASK(17, 16) | 0x0);
|
||||
} else {
|
||||
/*
|
||||
* Disable the pre-emphasize in eop state
|
||||
* and chirp state to avoid mis-trigger the
|
||||
* disconnect detection and also avoid hs
|
||||
* handshake fail for PHY1.
|
||||
*/
|
||||
ret |= regmap_write(rphy->grf, 0x4500,
|
||||
GENMASK(17, 16) | 0x0);
|
||||
ret |= regmap_write(rphy->grf, 0x4534,
|
||||
GENMASK(17, 16) | 0x0);
|
||||
}
|
||||
|
||||
if (!of_property_read_bool(node, "rockchip,u2phy-tuning"))
|
||||
return ret;
|
||||
|
||||
@@ -1845,17 +1869,6 @@ static int rk3399_usb2phy_tuning(struct rockchip_usb2phy *rphy)
|
||||
ret |= regmap_write(rphy->grf, 0x44b0,
|
||||
GENMASK(18, 16) | 0x07);
|
||||
|
||||
/*
|
||||
* Disable the pre-emphasize in eop state
|
||||
* and chirp state to avoid mis-trigger the
|
||||
* disconnect detection and also avoid hs
|
||||
* handshake fail for PHY0.
|
||||
*/
|
||||
ret |= regmap_write(rphy->grf, 0x4480,
|
||||
GENMASK(17, 16) | 0x0);
|
||||
ret |= regmap_write(rphy->grf, 0x44b4,
|
||||
GENMASK(17, 16) | 0x0);
|
||||
|
||||
/*
|
||||
* Set PHY0 A port squelch trigger point to 125mv
|
||||
*/
|
||||
@@ -1873,17 +1886,6 @@ static int rk3399_usb2phy_tuning(struct rockchip_usb2phy *rphy)
|
||||
ret |= regmap_write(rphy->grf, 0x4530,
|
||||
GENMASK(18, 16) | 0x07);
|
||||
|
||||
/*
|
||||
* Disable the pre-emphasize in eop state
|
||||
* and chirp state to avoid mis-trigger the
|
||||
* disconnect detection and also avoid hs
|
||||
* handshake fail for PHY1.
|
||||
*/
|
||||
ret |= regmap_write(rphy->grf, 0x4500,
|
||||
GENMASK(17, 16) | 0x0);
|
||||
ret |= regmap_write(rphy->grf, 0x4534,
|
||||
GENMASK(17, 16) | 0x0);
|
||||
|
||||
/*
|
||||
* Set PHY1 A port squelch trigger point to 125mv
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user