Received: by 10.213.65.68 with SMTP id h4csp74191imn; Thu, 15 Mar 2018 09:57:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELtFhaBct2TA2OwrPukxcmTTns7TAWxGv/SJBFuoRuLRPdwE8acF3uelTTDuUjhqLO+3qYSQ X-Received: by 10.101.75.202 with SMTP id p10mr4835765pgr.339.1521133053224; Thu, 15 Mar 2018 09:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521133053; cv=none; d=google.com; s=arc-20160816; b=Coj4/MPPAV4OYMP6Ca3w2RFAfmGEAORndbWxihZZBHtrrlSTc0JqoMhreX0fAQ6y7D gH5XCNx63xOtX7WC2bvcm5y/0YVibGuXB0+NTjycuvo80t6sPxI5xupGc3KjhUBEdr2k DvycdruBytoWzZEKFMdxcC319Ycn8n1EHfvHS303YNc2IfHFrpt9qm67e/kA98fS+GhA v+NQ+6YrH4NzV0lmm1JkwD2hFcfrHYCNdWyFen6BDyPFZNrDiw6vsYUGHDcaXZHu1naV em0h8HEWFp6PzEUNM43Gqhm1Ml3igZr7ADHuiampngRGcslf5p268ZgjbHAnC54pGET1 Inlw== 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=xu9a7YwlHylPfeNwlbjbr9Q7IPSoepMl6D6vo1fpI80=; b=CfT1FaYmhJrwXMsJjTCsk2tRGdlbtE0MKOnfdltDIHhY4jYuXLmz4mS6wyicilY21W DRuEfxzohqeXEfFepFawu1nNua+CRlweSbsD5TgO9dKRfJtAe9HLHXmXe8ZfiC4G84Zq KeHUakaikw0NdY2tFepYutVc7O+p2EKV9Yc9G8yYX5+ozBohBrUTtp1ebSNGISieJaOX fNwIeyGJytwjrC0HbHBO2mKnGR23/7kmViSxchBHTvm45UOd9jxWVy7EhYsxzggAbLjz bTcczTGMKmBzimx4MbiA0nIo5H2Ne/cwNwsflLLDyBUbkPfhdtcELcry+utWh82/p8Yk I16A== 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 e3-v6si4319560plb.100.2018.03.15.09.57.19; Thu, 15 Mar 2018 09:57:33 -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 S1751739AbeCOQ40 (ORCPT + 99 others); Thu, 15 Mar 2018 12:56:26 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:45530 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbeCOQ4Y (ORCPT ); Thu, 15 Mar 2018 12:56:24 -0400 Received: by mail-pl0-f68.google.com with SMTP id v9-v6so4117925plp.12; Thu, 15 Mar 2018 09:56:24 -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=xu9a7YwlHylPfeNwlbjbr9Q7IPSoepMl6D6vo1fpI80=; b=NNVVL3jz56rYkM1DUMY1RQgrAdEq/3sTxjrcVT6H8LfDWH13TqBFz4mxADnjr9Hgrl LbSx2j2WeP2Ly3Mc514BGz11w6E34vT+K+HGdA5SJrqlmQiTZfq55v2hriSaM+IuKxXR dTVHGtt742iA0F2/wHvSrBsloVU0D3qF7D2IqxKFK94tt+n7fD1l9khXbY1bVuc35llo gfYZc0A5yNIvx+X9u8VCy1t8//95htde6sDy4T5v7iN3XaDoIQ5FmzYtFLkqBLfcxSKu QONYCe8M1bWzdsV6e2ruBwYFRBXmC0s89/+Rm2B0ErWnWhlQjq1REOdSw3B+73wGIWk/ nLJg== X-Gm-Message-State: AElRT7GdvZVFZmDPGETLfQ9eHRCsKiLJ3Bm+UuknZS5/Z06LmdaGcG4m Yk9cne+vdEWsejzjEIPeapc= X-Received: by 2002:a17:902:d892:: with SMTP id b18-v6mr3564794plz.241.1521132984121; Thu, 15 Mar 2018 09:56:24 -0700 (PDT) Received: from szlin-TW ([122.146.92.136]) by smtp.gmail.com with ESMTPSA id k23sm10921465pfi.79.2018.03.15.09.56.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Mar 2018 09:56:23 -0700 (PDT) Received: from root by szlin-TW with local (Exim 4.90_1) (envelope-from ) id 1ewWAv-0007wJ-9S; Fri, 16 Mar 2018 00:56:21 +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 v2] net: ethernet: ti: cpsw: add check for in-band mode setting with RGMII PHY interface Date: Fri, 16 Mar 2018 00:56:01 +0800 Message-Id: <20180315165603.30471-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 --- Changes from v1: - Use phy_interface_is_rgmii helper function - Remove blank line 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) -- 2.16.2