Received: by 10.213.65.68 with SMTP id h4csp1466403imn; Wed, 14 Mar 2018 23:44:08 -0700 (PDT) X-Google-Smtp-Source: AG47ELu4JaG7LMgetoDss+mTw4pceQ6Nam6nAqyhTr2svJx6H/Q6o08KEVdDB9MVh9t2o/x/xSDH X-Received: by 2002:a17:902:7885:: with SMTP id q5-v6mr6715536pll.207.1521096248828; Wed, 14 Mar 2018 23:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521096248; cv=none; d=google.com; s=arc-20160816; b=HWktbMlTbv1bZacg2gUEQhLA8pRxVG2L+80VSR4TRNVcClOG2OgF3HUq/dbSJwYq5B F6Nhon3+ZTSdyast3zlItJhCTbVx8s/XNp9DzfFG7e2Xg9epotvMu+Dx8NnpJmWIWFaW hH+oB8it7m7oOApMIiVFz4hpC7njqTIwQTbtC9x9Ck9N8hx7J2ZuTYEahC8tLowle7cL +DEAaI2EgtOZtQ6XthG2TOjN8poR3182UCJDNYhM18stK53TRNzqJLjXS1jd0tl1NgZ4 sOhFu2VUXZzcTRI2/yeXVqSyVAnYU9pXWUuId9/KImvzZIyedZaeMy+EUGIwJXPrAh4O rT7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:arc-authentication-results; bh=DsWiI2sbNirc+jojdGbR05A1QaF1h0XvLVucVKf3T08=; b=tFd3jNJlVEHMHh5E6hyNCAkfCQITeI6oYq0+GqeSpioYmDUXQEvWB7ZdsZ9frWmiFK qqmeAQNAe0H7MEkqQNtvuoR1GpSB17txcRYx7fXIkEHIyq3+c7sYD6uv0ovXS04hcxRo WzZqeiScr7gDJ9HomvjVMfuPtNXYvaV3SS0xab/90zgjy05724BfxQq4m/tsGak0FvUz C3UVP+d//ep9hpVspP6yL/RhSptgOQ8QCIYLfQqF9WiJuCePBbqHvUtnHYnWzL0PohIH XpbEVqbcLfKZw906FR54CJN9kH39FJsS4MZdjGpJAj2cOPKoz0D608Al/4av+w+Sry0d 4SlA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u25si3087020pge.222.2018.03.14.23.43.54; Wed, 14 Mar 2018 23:44:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751917AbeCOGmy (ORCPT + 99 others); Thu, 15 Mar 2018 02:42:54 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:45689 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751508AbeCOGmw (ORCPT ); Thu, 15 Mar 2018 02:42:52 -0400 Received: by mail-pf0-f194.google.com with SMTP id h19so2472614pfd.12; Wed, 14 Mar 2018 23:42:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DsWiI2sbNirc+jojdGbR05A1QaF1h0XvLVucVKf3T08=; b=pMPQw8MO6ziHkG+HKIzpWEQL3YdObMxuktWNKjC49AFFhH0ZBP9hN0/7mQPC1bAiAP TWJvuai1k+Um/RZpH7sIuuvszhuN7U9i/xxowRRjQxnAbK7IuQI78r1DeEWTOGEptApJ fZFZSnB51Cttqqn0RUpWMvXO8u+I1sAVovJD1URnfHSC75jlzsNehPRDUOz9lwoxGfaE NL3Kt5LSwHcJ8IQZogZiV/r/+m6BI8wpIjHL19EQlHUeVlduCxVqZk0TE/jHHi3fmBcx 4N40kSltszGtp+6EfMrg0ZMje6BQlxakvCXj1EDFBQjP5XJJ/cKqlr3x2h8DaD/S+Vlk zMcw== X-Gm-Message-State: AElRT7HGEeYbdAu/860OVRcSwMznEHXtXDL/ZHBJSSQvfbaXX0aCL5cY WepApkT/dAWcpFyzvuBHKrI= X-Received: by 10.99.151.26 with SMTP id n26mr5968272pge.370.1521096171742; Wed, 14 Mar 2018 23:42:51 -0700 (PDT) Received: from szlin-TW ([122.146.92.136]) by smtp.gmail.com with ESMTPSA id t20sm7934070pfh.182.2018.03.14.23.42.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Mar 2018 23:42:50 -0700 (PDT) Received: from root by szlin-TW with local (Exim 4.90_1) (envelope-from ) id 1ewMbB-0001q8-Ea; Thu, 15 Mar 2018 14:42:49 +0800 From: =?UTF-8?q?SZ=20Lin=20=28=E6=9E=97=E4=B8=8A=E6=99=BA=29?= Cc: =?UTF-8?q?SZ=20Lin=20=28=E6=9E=97=E4=B8=8A=E6=99=BA=29?= , Schuyler Patton , Grygorii Strashko , "David S. Miller" , Ivan Khoronzhuk , Keerthy , Sekhar Nori , linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: ethernet: ti: cpsw: add check for in-band mode setting with RGMII PHY interface Date: Thu, 15 Mar 2018 14:41:43 +0800 Message-Id: <20180315064145.7022-1-sz.lin@moxa.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/ti/cpsw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 1b1b78fdc138..3bbf22ed59cf 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1014,7 +1014,13 @@ 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 == PHY_INTERFACE_MODE_RGMII) || + (phy->interface == PHY_INTERFACE_MODE_RGMII_ID) || + (phy->interface == PHY_INTERFACE_MODE_RGMII_RXID) || + (phy->interface == PHY_INTERFACE_MODE_RGMII_TXID))) mac_control |= BIT(18); /* In Band mode */ if (priv->rx_pause) -- 2.16.2