From patchwork Thu Mar 15 16:56:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SZ Lin X-Patchwork-Id: 10285239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DC28602C2 for ; Thu, 15 Mar 2018 16:56:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8086E28B6E for ; Thu, 15 Mar 2018 16:56:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 751E228B7A; Thu, 15 Mar 2018 16:56:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F71A28B6E for ; Thu, 15 Mar 2018 16:56:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751508AbeCOQ4Z (ORCPT ); Thu, 15 Mar 2018 12:56:25 -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-Google-Smtp-Source: AG47ELtDnYqb3DxaR+wHFYCMQBnkR3lRuOXQnqfqldtXM5ikExsD0PNsIL5hN33JNHfwDmwIVgIuIw== 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 To: unlisted-recipients:; (no To-header on input) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Grygorii Strashko --- 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)