From patchwork Mon Aug 20 14:59:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 10570475 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 B23E8139B for ; Mon, 20 Aug 2018 14:59:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2B742960F for ; Mon, 20 Aug 2018 14:59:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96CDC29612; Mon, 20 Aug 2018 14:59:50 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 49C272960F for ; Mon, 20 Aug 2018 14:59:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726665AbeHTSPt (ORCPT ); Mon, 20 Aug 2018 14:15:49 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:38962 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726662AbeHTSPs (ORCPT ); Mon, 20 Aug 2018 14:15:48 -0400 Received: by mail-pf1-f171.google.com with SMTP id j8-v6so6899692pff.6 for ; Mon, 20 Aug 2018 07:59:49 -0700 (PDT) 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=gTVGovZx1ISeBVT0o4eBDDrejfq4Uaxo9QkMVBQ1O6E=; b=W2RwX/QzoDoa/+aoxMEtKc972GZ4qCpe7i4qJDbkPnEsDYCgqfLHuX6n+4cPtzssl4 8Dgqyh9JkdocxUwmBX+fS4fgVKdpZ4eSWd81IakGTMz+E9mCZW+h0YkhBnBHTPgxie7B 9vcnWQdgH32Y7wzpnnHfbGigYQk0fDRdUrnl5cQxUkxTpIB+FNpUga5v1itPXhwydL5h Kh00MIm17OKkBUfbaKZzWBjoKNuQ/AKJ6mj0XATIpprfm3+iDwVIqPfXsTMvXz7I5d65 5ZVhQ+C7vkpngpHD30Ju0LJbATkcb4AERxREFwm7RWU73oYeuTvagli5a0rdORGyrfFB oWUA== 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=gTVGovZx1ISeBVT0o4eBDDrejfq4Uaxo9QkMVBQ1O6E=; b=evwFra//XMOTocHwJPIwQyv/x3nG/oT0KoQCvFhYUpJEHUzcBqfOpU35eQe4lS5zbR sFhkkJ8vmXoUkEYrfV+rgZ5Kjroeir4bkK7LH7WJRhdWvZwmyyUVgvqMiAsWqWc8HyVO w6JhdbcC/dQmvAZ+5t7J0j1l/JHeCS4F4UZ5RKq8oE1uKRJ14ar3cyQ67dOfJDZYT6qq 4LpzDTAtTOVhWxw1KJDLfBezir6Xo84PYrgoPK5MjEf7232qqXugfJekEKANfrM75y5b qf9wJv+lhA/eRFO5DSBclB8yEPwxpQdxg8lZJNM29NqztD66n7FjNhDeLU7cSiEubH3T Tzqw== X-Gm-Message-State: AOUpUlH2ILyURp8ecCCUfaRwjBy+RuvUt6djTO6ZuV4wGTIAVNTPloci tmHwE5iNWp5/UbCETH1Y5xG+xEb1 X-Google-Smtp-Source: AA+uWPxDnnD/YMuBupNy9grSJF2ORH/kqMPsdV92w5Kb2H5VHVXrkJZrHRiqH9UGwkyKJoPqT9KHFA== X-Received: by 2002:a63:7c43:: with SMTP id l3-v6mr12363635pgn.311.1534777189067; Mon, 20 Aug 2018 07:59:49 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id k64-v6sm16965765pfg.141.2018.08.20.07.59.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 07:59:47 -0700 (PDT) From: Magnus Damm To: linux-renesas-soc@vger.kernel.org Cc: Magnus Damm Date: Mon, 20 Aug 2018 23:59:45 +0900 Message-Id: <153477718520.16950.10138071667883935510.sendpatchset@octo> In-Reply-To: <153477717610.16950.5787705338176325405.sendpatchset@octo> References: <153477717610.16950.5787705338176325405.sendpatchset@octo> Subject: [PATCH/RFC v2 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. Not-Yet-Signed-off-by: Magnus Damm Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergei Shtylyov --- Written on top of next-20180820 drivers/net/ethernet/renesas/ravb_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- 0001/drivers/net/ethernet/renesas/ravb_main.c +++ work/drivers/net/ethernet/renesas/ravb_main.c 2018-08-20 23:42:46.670859449 +0900 @@ -1076,8 +1076,9 @@ static int ravb_phy_init(struct net_devi netdev_info(ndev, "limited PHY to 100Mbit/s\n"); } - /* 10BASE is not supported */ - phydev->supported &= ~PHY_10BT_FEATURES; + /* Neither 10BASE nor half duplex are supported */ + phydev->supported &= ~(PHY_10BT_FEATURES | SUPPORTED_100baseT_Half | + SUPPORTED_1000baseT_Half); phy_attached_info(phydev); From patchwork Mon Aug 20 14:59:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 10570477 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 2C34C139B for ; Mon, 20 Aug 2018 15:00:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BE942960F for ; Mon, 20 Aug 2018 15:00:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FC9929612; Mon, 20 Aug 2018 15:00: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 F40042960F for ; Mon, 20 Aug 2018 14:59:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726662AbeHTSP6 (ORCPT ); Mon, 20 Aug 2018 14:15:58 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42630 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbeHTSP6 (ORCPT ); Mon, 20 Aug 2018 14:15:58 -0400 Received: by mail-pg1-f195.google.com with SMTP id y4-v6so6911569pgp.9 for ; Mon, 20 Aug 2018 07:59:58 -0700 (PDT) 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=hoJpYB1IJRia904To3xYfZeV0gG8t1ULrYTccFbfhz4=; b=YqwvnEAz482VohGqB58v57EMQeWfr2H/d/Z5+nv9+DXw1EMyKZfFQpNZcPYrucfrwP cv/WL6S8s3EsbpNWgweGbKVmJvcVvrlFx8818BgDXJIA3BcixhWx/uNrvVPuYl4AYkkX I0hDWo7TCrExr24V7AwbbYXvq7C/PLQoQI/PF4xVB9woUmByDBt31dn77NlE0tXOQ3sW Hv/xmF3B0xn6F7401L8SU/2YhiDHtBursd8gCubUWUFqNrCnPloi4NE1isYkM6E/GQLu 0bczL4Svr+QMO35by1dwRbbl8bQKoBsXuUft5+YLlhAbMT7UoCt8j86JzndRigOCJcXt MtTQ== 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=hoJpYB1IJRia904To3xYfZeV0gG8t1ULrYTccFbfhz4=; b=avmUtizwiQOPn+2jQjEqDvUxZHz6i6sexBEMAdeco2xNcsgR2k6QjuWxzI93E3dxkc 3NX2hd8ZIND/7qP5MsvkJHTv0gsrGGw/WnVw3zM4+/W9tbFgJ9yj/TU8xaLST7kclbri A1K3Da0hoXAHgLSuZNN4qGM3rWkq7iLUxTsTfZf0JjDpj8LyfbSdwi3pX9mo9057c/2b oq5lZwpq+9bSqy3nQWZTELdisbMSozuWR6NeT96qsQ6HMCNgPryEFaveViw9KRsBhe+x rDEcVnw1WAzMQWVgtHJHaRwQEgnIYgRQJUO2w/leIcHycFOxtmK/BwUo+9BDJYgvq7OG Mm/Q== X-Gm-Message-State: AOUpUlHyEqavaq5cEBKhY+ItFXa8SWbwgN4w3jFMJuDqlqI8Z0SnjWQO tqJW14Pyy64Ht3PfF4WiuB8qhS6U X-Google-Smtp-Source: AA+uWPxhQLxwUN3g0SyrINDmVBLd7cv/2krw9bnVufi97nbe7XtES+Wy2h9tfNTGXcWt8oDPzpJ/bw== X-Received: by 2002:a62:9f1d:: with SMTP id g29-v6mr48143882pfe.207.1534777198233; Mon, 20 Aug 2018 07:59:58 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id v89-v6sm29050796pfj.22.2018.08.20.07.59.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 07:59:56 -0700 (PDT) From: Magnus Damm To: linux-renesas-soc@vger.kernel.org Cc: Magnus Damm Date: Mon, 20 Aug 2018 23:59:54 +0900 Message-Id: <153477719422.16950.5969632005010865481.sendpatchset@octo> In-Reply-To: <153477717610.16950.5787705338176325405.sendpatchset@octo> References: <153477717610.16950.5787705338176325405.sendpatchset@octo> Subject: [PATCH/RFC v2 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." Not-Yet-Signed-off-by: Magnus Damm Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergei Shtylyov --- Written on top of next-20180820 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-08-20 23:45:02.203442052 +0900 @@ -1027,7 +1027,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-08-20 23:48:17.840945347 +0900 @@ -85,13 +85,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); @@ -401,13 +394,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); @@ -989,12 +980,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; @@ -1009,7 +994,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 */ @@ -1039,7 +1023,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);