From patchwork Wed Nov 21 11:21:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 10692441 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36AA613AD for ; Wed, 21 Nov 2018 11:21:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 238AC2B80C for ; Wed, 21 Nov 2018 11:21:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E8392B9D8; Wed, 21 Nov 2018 11:21:01 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,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 A10F22B9D1 for ; Wed, 21 Nov 2018 11:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726016AbeKUVzA (ORCPT ); Wed, 21 Nov 2018 16:55:00 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:41429 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730195AbeKUVzA (ORCPT ); Wed, 21 Nov 2018 16:55:00 -0500 Received: by mail-pl1-f194.google.com with SMTP id u6so5111126plm.8; Wed, 21 Nov 2018 03:20:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=+dIGJjafXcdgIe5O9286Yy2klGG05lCXf2qAdSA/rGw=; b=b9iqkinnrHmJw7oVPpiN+7iewtSGzWj7u/g4nB4ScOlOsS8I/8JGg0635caFB9CVQQ 8luI5RoFAUjI5XildFvlviQp/O0Q0yBmk46waWltx7SW1zZmt2b2+eGUQz23aCutqUm5 QeyMOd6HkqwnCxePMhYhfbM/MAnobYmI1lUVNpFQ8lcyx74Gj90/zZVfvfmkeAlw3/wz ZvxySBvOrryvkEPDwxAexjxQ4T7SbEmQFA6/fl/dtJHs9Sv1l6aoFibfCY/ZsCgIaTG6 HvibuTh8I8DK0yvUpMoihdyC6GCiYh3+QoW/nIlqZre1EqmKM74HyLelxT1oeLOT6Org E5+g== 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:date:message-id:in-reply-to :references:subject; bh=+dIGJjafXcdgIe5O9286Yy2klGG05lCXf2qAdSA/rGw=; b=RnXuJxFGEPy/YHTggrrd4GHG2iIlFxIxzF2yvYAIns98b1q/mXtdCocze7OiOv479M 1LuejaxDavrwkb/7MspbExeeNXL21fLvNTvc6PBv1e1hCetIurXI1kTaM74Tjf3tM218 b7ZtBdqnLnBKBxzd2qtdDYMDlK6q6NIj7fKwSrqycm3g9+0lggF6/SKCRaIqrJ2isvc6 VJCpcAoi+EmmU5XYI780p1bIDnROlrmrpe7zmipr0qdB3JIJQU8Jq/sH+Z+ISGv6Vzp3 Hl/HDSwXSUgS30zA/G6a+jq0tC9/VkE8A9oWGd4bR0uaWLtLMLai8Co45WZcScfTBhkz Rdww== X-Gm-Message-State: AA+aEWZquJYDUHB8eneTrOYyibN7rUvXU7gqvqbQOdlaHLZiDbfrTaaS H7P/e2zRyExE8gEk25jWP6sNxwhb X-Google-Smtp-Source: AFSGD/Uth3q/yX56zu44hK2qbMICRA27rpNR/JpDBCI8wBDyZGhOPygSMxESvkQv0kwArzSY6Chsew== X-Received: by 2002:a63:f547:: with SMTP id e7mr5705005pgk.182.1542799259142; Wed, 21 Nov 2018 03:20:59 -0800 (PST) Received: from [127.0.0.1] (l193216.ppp.asahi-net.or.jp. [218.219.193.216]) by smtp.gmail.com with ESMTPSA id 34sm77707028pgp.90.2018.11.21.03.20.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 03:20:58 -0800 (PST) From: Magnus Damm To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Magnus Damm , davem@davemloft.net, sergei.shtylyov@cogentembedded.com Date: Wed, 21 Nov 2018 20:21:17 +0900 Message-Id: <154279927781.10272.2774991326285490398.sendpatchset@octo> In-Reply-To: <154279926877.10272.700833429936129422.sendpatchset@octo> References: <154279926877.10272.700833429936129422.sendpatchset@octo> Subject: [PATCH v3 01/02] ravb: Do not announce HDX as supported Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm According to the data sheet the Ethernet-AVB hardware in R-Car Gen3 and R-Car Gen2 SoCs do not support half duplex operation. So update the driver to mark 100Mbit and 1Gbps HDX as unsupported. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Signed-off-by: Magnus Damm Reviewed-by: Sergei Shtylyov --- Slightly reworked since V2 to make use of phy_remove_link_mode(). In case Sergei wants to opt-out from the Reviewed-by tag for V2 let us know. Applies on top of next-20181121 drivers/net/ethernet/renesas/ravb_main.c | 4 ++++ 1 file changed, 4 insertions(+) --- 0001/drivers/net/ethernet/renesas/ravb_main.c +++ work/drivers/net/ethernet/renesas/ravb_main.c 2018-11-21 19:47:58.165498803 +0900 @@ -1088,6 +1088,10 @@ static int ravb_phy_init(struct net_devi phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_Pause_BIT); phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_Asym_Pause_BIT); + /* Half Duplex is not supported */ + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT); + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT); + phy_attached_info(phydev); return 0; From patchwork Wed Nov 21 11:21:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 10692443 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A17213AD for ; Wed, 21 Nov 2018 11:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 167882B80C for ; Wed, 21 Nov 2018 11:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A6B92B9DA; Wed, 21 Nov 2018 11:21:10 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,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 9A1462B80C for ; Wed, 21 Nov 2018 11:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729757AbeKUVzJ (ORCPT ); Wed, 21 Nov 2018 16:55:09 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:32914 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729555AbeKUVzJ (ORCPT ); Wed, 21 Nov 2018 16:55:09 -0500 Received: by mail-pl1-f193.google.com with SMTP id z23so5124101plo.0; Wed, 21 Nov 2018 03:21:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=uR+dyDnSXVbQ6v7Q5fOz9I+gHypL497WobKeZNeqyI4=; b=ql6n7QjlCEZ8B/dGXFjvMO1affkoX276oCGt91pA/kxSJOqShv7zynpmiLD0EX84cs RHMPKQ18WEv9yHrVLlWKvJMdIoCPzK8qtxJ7nZOhtx32swlVbif3YfZv/MSsqQo6dcSz e0kp2+TvlNcSS70d0gVP+bSzm99///n+ncLhacHFXlSTSpUNCpSXuNbudB70M0GQvtGd wH4Tubi9+HYvkLSHs3AgPXntkbZI9iwLjKiQdcCH+5JvSGchXLEQ+Z1FBWw1rQyzROA5 ZKbpRN6ymzCv11Y2AwIF+MInq/ma0rWc47svWGHxYGC4W7/woIeBgs9gXZI8B9RDMyAz RtPw== 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:date:message-id:in-reply-to :references:subject; bh=uR+dyDnSXVbQ6v7Q5fOz9I+gHypL497WobKeZNeqyI4=; b=h8jg7iSEOmAJAFxsFsmfnhXvF/MtuuvW3kJ0Mwxyoup09EcjLpRRUymMUWgvTYPbAQ feQ7t+k5tjlFA4Ut6u2g76WGp+wPSVSy4NK1kHPBNmqFVFmfWGKaNiQhU39PYlxjCRdp cx1Y0G94ae0w7bKlT8AUGj5y2L2QTEQ30BeAfNTITVTCeXPvylLbnkxZH50tlO83L7bC 6sdPGIEVIfnxcG419uh+g5SXZlx0nmMHb4sdyxc9Wfjf8jPLijDdLltFTkO14OJqWU38 5iGjbIhU3XRxsiarqDFGp/GZQfBD4QeLax+XewojrU1GN4d/ORtAsNc3g38NV14fyAvb Svsw== X-Gm-Message-State: AA+aEWYnZ7LGSWLnuMI4gt0bf0QTvYZr3ZeCKugLEbuFgHJX+pTwcT+Z qR3+qrORoewMQxApMXTPnPI70PeR X-Google-Smtp-Source: AFSGD/VynBp4dokkEr5uF+tBgPv0/iDbcTDz9SbfQuWGQ4gvkkja1C41TEtG1bJHAv/jKAN6UgChpw== X-Received: by 2002:a17:902:2f03:: with SMTP id s3mr5900934plb.277.1542799268122; Wed, 21 Nov 2018 03:21:08 -0800 (PST) Received: from [127.0.0.1] (l193216.ppp.asahi-net.or.jp. [218.219.193.216]) by smtp.gmail.com with ESMTPSA id i62sm30196450pge.44.2018.11.21.03.21.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 03:21:07 -0800 (PST) From: Magnus Damm To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Magnus Damm , davem@davemloft.net, sergei.shtylyov@cogentembedded.com Date: Wed, 21 Nov 2018 20:21:26 +0900 Message-Id: <154279928683.10272.8364745949300109786.sendpatchset@octo> In-Reply-To: <154279926877.10272.700833429936129422.sendpatchset@octo> References: <154279926877.10272.700833429936129422.sendpatchset@octo> Subject: [PATCH v3 02/02] ravb: Clean up duplex handling Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Since only full-duplex operation is supported by the hardware, remove duplex handling code and keep the register setting of ECMR.DM fixed at 1. This updates the driver implementation to follow the data sheet text "This bit should always be set to 1." Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Signed-off-by: Magnus Damm Reviewed-by: Sergei Shtylyov --- Applies on top of next-20181121 drivers/net/ethernet/renesas/ravb.h | 1 - drivers/net/ethernet/renesas/ravb_main.c | 19 +------------------ 2 files changed, 1 insertion(+), 19 deletions(-) --- 0001/drivers/net/ethernet/renesas/ravb.h +++ work/drivers/net/ethernet/renesas/ravb.h 2018-11-21 19:50:04.477121118 +0900 @@ -1032,7 +1032,6 @@ struct ravb_private { phy_interface_t phy_interface; int msg_enable; int speed; - int duplex; int emac_irq; enum ravb_chip_id chip_id; int rx_irqs[NUM_RX_QUEUE]; --- 0002/drivers/net/ethernet/renesas/ravb_main.c +++ work/drivers/net/ethernet/renesas/ravb_main.c 2018-11-21 19:50:04.479121223 +0900 @@ -82,13 +82,6 @@ static int ravb_config(struct net_device return error; } -static void ravb_set_duplex(struct net_device *ndev) -{ - struct ravb_private *priv = netdev_priv(ndev); - - ravb_modify(ndev, ECMR, ECMR_DM, priv->duplex ? ECMR_DM : 0); -} - static void ravb_set_rate(struct net_device *ndev) { struct ravb_private *priv = netdev_priv(ndev); @@ -406,13 +399,11 @@ error: /* E-MAC init function */ static void ravb_emac_init(struct net_device *ndev) { - struct ravb_private *priv = netdev_priv(ndev); - /* Receive frame limit set register */ ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR); /* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */ - ravb_write(ndev, ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) | + ravb_write(ndev, ECMR_ZPF | ECMR_DM | (ndev->features & NETIF_F_RXCSUM ? ECMR_RCSC : 0) | ECMR_TE | ECMR_RE, ECMR); @@ -995,12 +986,6 @@ static void ravb_adjust_link(struct net_ ravb_rcv_snd_disable(ndev); if (phydev->link) { - if (phydev->duplex != priv->duplex) { - new_state = true; - priv->duplex = phydev->duplex; - ravb_set_duplex(ndev); - } - if (phydev->speed != priv->speed) { new_state = true; priv->speed = phydev->speed; @@ -1015,7 +1000,6 @@ static void ravb_adjust_link(struct net_ new_state = true; priv->link = 0; priv->speed = 0; - priv->duplex = -1; } /* Enable TX and RX right over here, if E-MAC change is ignored */ @@ -1045,7 +1029,6 @@ static int ravb_phy_init(struct net_devi priv->link = 0; priv->speed = 0; - priv->duplex = -1; /* Try connecting to PHY */ pn = of_parse_phandle(np, "phy-handle", 0);