Received: by 10.213.65.68 with SMTP id h4csp98164imn; Thu, 15 Mar 2018 10:40:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELtBhaEcbSk8Wc8k2OF3ez/1gkkauiinfe+LtnW/f4ArWreALwInOqXvgV/aeUVsF1f2QrDm X-Received: by 2002:a17:902:12e:: with SMTP id 43-v6mr8814187plb.77.1521135629752; Thu, 15 Mar 2018 10:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521135629; cv=none; d=google.com; s=arc-20160816; b=L7gVMRFdSe6Xk1Mhu3TqYBlD8nzqlmFAKbQwMQrBTSyxsEo/nJWWfj0jDaJJEkyFLR fS3c2nTj1Cw73+bwkHNfDrK8QpVVdNNX6wF4Z9WxKU96U+5jeFRAwUGsi9x/gLC+9mbx Rswrt8+owOw2uDuHMn0NEUun0vQc2wRthG4M9DOvjkf41bGJHzl2Ae5hEYw+wAfJedYN Ua7f/67/4mixfPh/tGVcI/M5oCzF07Fw2ZF9igoUt2X8ckpLRrzmipfHuMAwPyLdQgLn clM5y+8p3FVp5KTl9jCDdGa4kGJZF37yfr1a1VKTGHtAT6BhW+k/iAQRRvmS5t2Nq/vG CYIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=NgOfumLKO3/ZK9OAf36G1kuGg76ngesQwQB9pidfcS4=; b=O7IenHUFc3Y7RGZUTMsVo//5ortG0Ewu/FAkJECBHLlkaT65nmRFjw8Y1Uc62fuAfG Lf+rXZBwEnYFKTTflNXmSX8ZWqcEadLnh++CZT2avvNxKSnGvqnL+eOC+MkTOqA8eD+L 8qWaEs6yuEbWMEmipASMhsX++jCYqZ8cpzk5kZ2q0TDnfJg8OC+uqkjjEBsxGrwuG1fo p495DEAY9mrz6CA4+XyEkU72uSFqXWPdxkSlJ3Bacsk4LqE+UEwA1P6liaz6DYIpgppE H4EhNhgCs76lydeTZimgioaGx8RBcbD4WKjOksq8Ff5WAcnK0bjBTnGJOo8CX0+s102E mzVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=FK7R6pss; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si3684194pgv.593.2018.03.15.10.40.14; Thu, 15 Mar 2018 10:40:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=FK7R6pss; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752006AbeCORjV (ORCPT + 99 others); Thu, 15 Mar 2018 13:39:21 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:18319 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbeCORjT (ORCPT ); Thu, 15 Mar 2018 13:39:19 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w2FHdEld003020; Thu, 15 Mar 2018 12:39:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1521135554; bh=BZphDbnAmJ/2Hp//6jZI2Fmnx1bqMKO2SCNo+KHdJb4=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=FK7R6pssC6fJCF740HCmvxOZvRtbvtN/uNRwVC6zmEqgZ9NenMkTWDM7XGQOleh8h EoSgF1fPeMJiSenfJNNe1EXgWHuc1HLVr6H4KUExSjlkAfuXUkgL738T6gP0uxXz2T nC1fAWtRak4b0Ai2Hv7S0Tvi3FYigZKPGpnar57c= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w2FHdEwD016868; Thu, 15 Mar 2018 12:39:14 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 15 Mar 2018 12:39:14 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 15 Mar 2018 12:39:14 -0500 Received: from [128.247.59.147] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w2FHdDLX015439; Thu, 15 Mar 2018 12:39:14 -0500 Subject: Re: [PATCH v2] net: ethernet: ti: cpsw: add check for in-band mode setting with RGMII PHY interface To: =?UTF-8?B?U1ogTGluICjmnpfkuIrmmbop?= CC: Schuyler Patton , "David S. Miller" , Ivan Khoronzhuk , Keerthy , Sekhar Nori , , , References: <20180315165603.30471-1-sz.lin@moxa.com> From: Grygorii Strashko Message-ID: Date: Thu, 15 Mar 2018 12:39:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180315165603.30471-1-sz.lin@moxa.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/15/2018 11:56 AM, SZ Lin (林上智) wrote: > According to AM335x TRM[1] 14.3.6.2, AM437x TRM[2] 15.3.6.2 and > DRA7 TRM[3] 24.11.4.8.7.3.3, in-band mode in EXT_EN(bit18) register is only > available when PHY is configured in RGMII mode with 10Mbps speed. It will > cause some networking issues without RGMII mode, such as carrier sense > errors and low throughput. TI also mentioned this issue in their forum[4]. > > This patch adds the check mechanism for PHY interface with RGMII interface > type, the in-band mode can only be set in RGMII mode with 10Mbps speed. > > References: > [1]: https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf > [2]: http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf > [3]: http://www.ti.com/lit/ug/spruic2b/spruic2b.pdf > [4]: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/640765/2392155 > > Suggested-by: Holsety Chen (陳憲輝) > Signed-off-by: SZ Lin (林上智) > Signed-off-by: Schuyler Patton > --- > Changes from v1: > - Use phy_interface_is_rgmii helper function > - Remove blank line > Reviewed-by: Grygorii Strashko > drivers/net/ethernet/ti/cpsw.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c > index 1b1b78fdc138..b2b30c9df037 100644 > --- a/drivers/net/ethernet/ti/cpsw.c > +++ b/drivers/net/ethernet/ti/cpsw.c > @@ -1014,7 +1014,8 @@ static void _cpsw_adjust_link(struct cpsw_slave *slave, > /* set speed_in input in case RMII mode is used in 100Mbps */ > if (phy->speed == 100) > mac_control |= BIT(15); > - else if (phy->speed == 10) > + /* in band mode only works in 10Mbps RGMII mode */ > + else if ((phy->speed == 10) && phy_interface_is_rgmii(phy)) > mac_control |= BIT(18); /* In Band mode */ > > if (priv->rx_pause) > -- regards, -grygorii