From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752380AbdEJJsl (ORCPT ); Wed, 10 May 2017 05:48:41 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34110 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751894AbdEJJsj (ORCPT ); Wed, 10 May 2017 05:48:39 -0400 Subject: Re: [PATCH v5 1/9] phy: phy-mt65xx-usb3: improve RX detection stable time To: Kishon Vijay Abraham I , Chunfeng Yun Cc: Felipe Balbi , Rob Herring , Mark Rutland , Ian Campbell , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org References: <1490945735-9531-1-git-send-email-chunfeng.yun@mediatek.com> From: Matthias Brugger Message-ID: <75079f91-01f3-88ef-1733-5139857cc609@gmail.com> Date: Wed, 10 May 2017 11:48:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I took DTS parts for v4.12-next. Sorry for the late response. Matthias On 06/04/17 12:28, Kishon Vijay Abraham I wrote: > > > On Friday 31 March 2017 01:05 PM, Chunfeng Yun wrote: >> 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. >> > merged all the phy patches in this series to linux-phy -next. > > Thanks > Kishon > >> Signed-off-by: Chunfeng Yun >> --- >> drivers/phy/phy-mt65xx-usb3.c | 18 ++++++++++++++++++ >> 1 file changed, 18 insertions(+) >> >> diff --git a/drivers/phy/phy-mt65xx-usb3.c b/drivers/phy/phy-mt65xx-usb3.c >> index d972067..fe2392a 100644 >> --- a/drivers/phy/phy-mt65xx-usb3.c >> +++ b/drivers/phy/phy-mt65xx-usb3.c >> @@ -112,6 +112,14 @@ >> #define P3D_RG_CDR_BIR_LTD0 GENMASK(12, 8) >> #define P3D_RG_CDR_BIR_LTD0_VAL(x) ((0x1f & (x)) << 8) >> >> +#define U3P_U3_PHYD_RXDET1 (SSUSB_SIFSLV_U3PHYD_BASE + 0x128) >> +#define P3D_RG_RXDET_STB2_SET GENMASK(17, 9) >> +#define P3D_RG_RXDET_STB2_SET_VAL(x) ((0x1ff & (x)) << 9) >> + >> +#define U3P_U3_PHYD_RXDET2 (SSUSB_SIFSLV_U3PHYD_BASE + 0x12c) >> +#define P3D_RG_RXDET_STB2_SET_P3 GENMASK(8, 0) >> +#define P3D_RG_RXDET_STB2_SET_P3_VAL(x) (0x1ff & (x)) >> + >> #define U3P_XTALCTL3 (SSUSB_SIFSLV_SPLLC + 0x0018) >> #define XC3_RG_U3_XTAL_RX_PWD BIT(9) >> #define XC3_RG_U3_FRC_XTAL_RX_PWD BIT(8) >> @@ -295,6 +303,16 @@ 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_RXDET1); >> + tmp &= ~P3D_RG_RXDET_STB2_SET; >> + tmp |= P3D_RG_RXDET_STB2_SET_VAL(0x10); >> + writel(tmp, port_base + U3P_U3_PHYD_RXDET1); >> + >> + tmp = readl(port_base + U3P_U3_PHYD_RXDET2); >> + tmp &= ~P3D_RG_RXDET_STB2_SET_P3; >> + tmp |= P3D_RG_RXDET_STB2_SET_P3_VAL(0x10); >> + writel(tmp, port_base + U3P_U3_PHYD_RXDET2); >> + >> dev_dbg(u3phy->dev, "%s(%d)\n", __func__, index); >> } >> >>