phy: rockchip-inno-usb2: tuning USB 2.0 squelch detection threshold
authorMeng Dongyang <daniel.meng@rock-chips.com>
Mon, 17 Apr 2017 06:11:58 +0000 (14:11 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 17 Apr 2017 10:06:18 +0000 (18:06 +0800)
According to USB 2.0 Spec Table 7-7, the High-speed squelch
detection threshold Min 100mV and Max 150mV, and we set USB
2.0 PHY0 and PHY1 squelch detection threshold to 150mV by
default, so if the amplitude of differential voltage envelope
is < 150 mV, the USB 2.0 PHYs envelope detector will indicate
it as squelch.

On RK3399 box, if we connect usb device with a 4 meter cable,
we can see that the impedance of U2 cable is too big according
to the eye-diagram test report, and this cause serious signal
attenuation at the end of receiver, the amplitude of differential
voltage falls below 150mV.

This patch aims to reduce the PHY0 and PHY1 otg-ports squelch
detection threshold to 125mV (host-ports still use 150mV by
default), this is helpful to increase USB 2.0 PHY compatibility.

Change-Id: Iec8b4043a3440d6f2a5fb18ff59ac0f4988019e9
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
drivers/phy/phy-rockchip-inno-usb2.c

index 9b3fe5d544ddbd89037d7572fed7c0067ed7cdee..61f2e22bd3a5c4ea78b523294549519856cf8817 100644 (file)
@@ -1461,6 +1461,12 @@ static int rk3399_usb2phy_tuning(struct rockchip_usb2phy *rphy)
                                    GENMASK(17, 16) | 0x0);
                ret |= regmap_write(rphy->grf, 0x44b4,
                                    GENMASK(17, 16) | 0x0);
+
+               /*
+                * Set PHY0 A port squelch trigger point to 125mv
+                */
+               ret |= regmap_write(rphy->grf, 0x4480,
+                                   GENMASK(30, 30) | 0x4000);
        } else {
                /*
                 * Set max ODT compensation voltage and
@@ -1483,6 +1489,12 @@ static int rk3399_usb2phy_tuning(struct rockchip_usb2phy *rphy)
                                    GENMASK(17, 16) | 0x0);
                ret |= regmap_write(rphy->grf, 0x4534,
                                    GENMASK(17, 16) | 0x0);
+
+               /*
+                * Set PHY1 A port squelch trigger point to 125mv
+                */
+               ret |= regmap_write(rphy->grf, 0x4500,
+                                   GENMASK(30, 30) | 0x4000);
        }
 
        return ret;