From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E68ECC282C4 for ; Tue, 12 Feb 2019 10:55:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4D192083B for ; Tue, 12 Feb 2019 10:55:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="P5MVNyHL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727804AbfBLKzV (ORCPT ); Tue, 12 Feb 2019 05:55:21 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:41310 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbfBLKzV (ORCPT ); Tue, 12 Feb 2019 05:55:21 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x1CAtD6E052595; Tue, 12 Feb 2019 04:55:13 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549968913; bh=JA8zNgJ+Hd4Fa1avjnrzRU2vlne3bBHk9CoF4+AYDtg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=P5MVNyHL1Mv05pjTb0T2PSHwx3hHSC57VH3a/edMjFkVTDOXC9gNPl0Jm1WcTGukR 6kNESB+8GZP5FD+Vj1whBl2jiZalQ8zElfiMVM+IB02Zz4+vbqCTuM9/DIiHZadU+0 Jx1ygD7aaD6QMCxg7Vt4P6NNdoILdeOtMJPiqQd0= Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x1CAtDof119553 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 12 Feb 2019 04:55:13 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 12 Feb 2019 04:55:09 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Tue, 12 Feb 2019 04:55:09 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x1CAt7en019073; Tue, 12 Feb 2019 04:55:07 -0600 Subject: Re: [v3,4/5] net: phy: at803x: Disable phy delay for RGMII mode To: Vinod Koul , David S Miller , Roger Quadros CC: , , Niklas Cassel , Bjorn Andersson , Andrew Lunn , Florian Fainelli , "Nori, Sekhar" References: <20190121091318.20079-5-vkoul@kernel.org> From: Peter Ujfalusi Message-ID: <147151c4-d162-4ebe-189a-564492d84d18@ti.com> Date: Tue, 12 Feb 2019 12:55:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190121091318.20079-5-vkoul@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Vinod, On 21/01/2019 11.13, Vinod Koul wrote: > For RGMII mode, phy delay should be disabled. Add this case along > with disable delay routines. In next-20190211 I need to revert this patch to get cpsw networking to work on am335x-evmsk. The board uses AR8031_AL1A PHY, which is handled by the phy/at803x.c On next-20190211: [ 3.374601] net eth0: initializing cpsw version 1.12 (0) [ 3.384484] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL) [ 3.400041] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx [ 3.410813] mmc1: new SDIO card at address 0001 [ 3.439362] IP-Config: Complete: [ 3.442649] device=eth0, hwaddr=bc:6a:29:7d:2c:a9, ipaddr=10.0.0.90, mask=255.255.255.0, gw=10.0.0.1 [ 3.452840] host=10.0.0.90, domain=, nis-domain=(none) [ 3.458462] bootserver=10.0.0.30, rootserver=10.0.0.30, rootpath= [ 3.466296] vwl1271: disabling [ 3.470195] ALSA device list: [ 3.473189] #0: AM335x-EVMSK After reverting this patch: [ 3.374636] net eth0: initializing cpsw version 1.12 (0) [ 3.384534] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL) [ 3.400125] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx [ 3.410866] mmc1: new SDIO card at address 0001 [ 3.439379] IP-Config: Complete: [ 3.442666] device=eth0, hwaddr=bc:6a:29:7d:2c:a9, ipaddr=10.0.0.90, mask=255.255.255.0, gw=10.0.0.1 [ 3.452865] host=10.0.0.90, domain=, nis-domain=(none) [ 3.458482] bootserver=10.0.0.30, rootserver=10.0.0.30, rootpath= [ 3.466334] vwl1271: disabling [ 3.470245] ALSA device list: [ 3.473241] #0: AM335x-EVMSK [ 3.501052] VFS: Mounted root (nfs filesystem) readonly on device 0:15. [ 3.508694] devtmpfs: mounted [ 3.514546] Freeing unused kernel memory: 1024K [ 3.520567] Run /sbin/init as init process and the board boots to nfsroot fine. > Signed-off-by: Vinod Koul > --- > drivers/net/phy/at803x.c | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c > index f9432d053a22..8ff12938ab47 100644 > --- a/drivers/net/phy/at803x.c > +++ b/drivers/net/phy/at803x.c > @@ -110,16 +110,16 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg, > return phy_write(phydev, AT803X_DEBUG_DATA, val); > } > > -static inline int at803x_enable_rx_delay(struct phy_device *phydev) > +static inline int at803x_disable_rx_delay(struct phy_device *phydev) > { > - return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0, > - AT803X_DEBUG_RX_CLK_DLY_EN); > + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, > + AT803X_DEBUG_RX_CLK_DLY_EN, 0); > } > > -static inline int at803x_enable_tx_delay(struct phy_device *phydev) > +static inline int at803x_disable_tx_delay(struct phy_device *phydev) > { > - return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0, > - AT803X_DEBUG_TX_CLK_DLY_EN); > + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, > + AT803X_DEBUG_TX_CLK_DLY_EN, 0); > } > > /* save relevant PHY registers to private copy */ > @@ -256,15 +256,17 @@ static int at803x_config_init(struct phy_device *phydev) > return ret; > > if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID || > - phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { > - ret = at803x_enable_rx_delay(phydev); > + phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || > + phydev->interface == PHY_INTERFACE_MODE_RGMII) { > + ret = at803x_disable_rx_delay(phydev); > if (ret < 0) > return ret; > } > > if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID || > - phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { > - ret = at803x_enable_tx_delay(phydev); > + phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || > + phydev->interface == PHY_INTERFACE_MODE_RGMII) { > + ret = at803x_disable_tx_delay(phydev); > if (ret < 0) > return ret; > } > - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki