]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
phy: phy-mt65xx-usb3: increase LFPS filter threshold
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Fri, 31 Mar 2017 07:35:28 +0000 (15:35 +0800)
committerKishon Vijay Abraham I <kishon@ti.com>
Mon, 10 Apr 2017 11:13:40 +0000 (16:43 +0530)
Increase LFPS filter threshold to avoid some fake remote wakeup
signal which cause U3 link fail and link to U2 only at about
0.01% probability.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-mt65xx-usb3.c

index fe2392ac0eb44ab9ec65f6a4da110cf11f6530b5..4fd47d007c3058a5225fdf198897efa44e89d158 100644 (file)
 #define P3A_RG_XTAL_EXT_EN_U3          GENMASK(11, 10)
 #define P3A_RG_XTAL_EXT_EN_U3_VAL(x)   ((0x3 & (x)) << 10)
 
+#define U3P_U3_PHYD_LFPS1              (SSUSB_SIFSLV_U3PHYD_BASE + 0x000c)
+#define P3D_RG_FWAKE_TH                GENMASK(21, 16)
+#define P3D_RG_FWAKE_TH_VAL(x) ((0x3f & (x)) << 16)
+
 #define U3P_PHYD_CDR1          (SSUSB_SIFSLV_U3PHYD_BASE + 0x005c)
 #define P3D_RG_CDR_BIR_LTD1            GENMASK(28, 24)
 #define P3D_RG_CDR_BIR_LTD1_VAL(x)     ((0x1f & (x)) << 24)
@@ -303,6 +307,11 @@ static void phy_instance_init(struct mt65xx_u3phy *u3phy,
        tmp |= P3D_RG_CDR_BIR_LTD0_VAL(0xc) | P3D_RG_CDR_BIR_LTD1_VAL(0x3);
        writel(tmp, port_base + U3P_PHYD_CDR1);
 
+       tmp = readl(port_base + U3P_U3_PHYD_LFPS1);
+       tmp &= ~P3D_RG_FWAKE_TH;
+       tmp |= P3D_RG_FWAKE_TH_VAL(0x34);
+       writel(tmp, port_base + U3P_U3_PHYD_LFPS1);
+
        tmp = readl(port_base + U3P_U3_PHYD_RXDET1);
        tmp &= ~P3D_RG_RXDET_STB2_SET;
        tmp |= P3D_RG_RXDET_STB2_SET_VAL(0x10);