From patchwork Sat Mar 24 20:12:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10306393 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 1C0DB60385 for ; Sat, 24 Mar 2018 20:13:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C16A2900E for ; Sat, 24 Mar 2018 20:13:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0087F290C7; Sat, 24 Mar 2018 20:13:04 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 644462900E for ; Sat, 24 Mar 2018 20:13:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753336AbeCXUM7 (ORCPT ); Sat, 24 Mar 2018 16:12:59 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34216 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753328AbeCXUM6 (ORCPT ); Sat, 24 Mar 2018 16:12:58 -0400 Received: by mail-lf0-f65.google.com with SMTP id c78-v6so18197970lfh.1 for ; Sat, 24 Mar 2018 13:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3DmZ5znltq708J5nQTuD92IGJ+QQFPtICjhWLdAXUQA=; b=FF1yuNG7tBXkcLgOP0eYVX8dTRcngt7rbKnUvf9ePw7JlYTZ0HeNVWkAaxturGvCr6 SQmI9Zhupj7IdisdX+yMOCH5UKtR4LG7CuMxTMcLBKOO+OQiBaKs5n2PtfbDbL5aA6/J 5fbwPtC63Y4FOVT5P0oAj8AQI7FOvxeW1LtGAGxnyChlGaxL2MJEqcwnQdRSIlTpq501 nqldd1Ay9bo1f/1V0IGfVAM9e5lNCbL7sHTO5V6k8/AfIlk61Xq+9jbRZtQxvkCevZlv xSBzcPAuA3QAl2fcspWK657kmKMMOFaJARhCbmw09LDHP6fsm3qMoSbgMC94Qv4UBGwB LKOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=3DmZ5znltq708J5nQTuD92IGJ+QQFPtICjhWLdAXUQA=; b=p8cAidip+FedMZ3sntk8SFId21Le1PSQfxDFTjfYF8AIYwiGX2cEvMrhOMZADv6tY4 cnx7aGMYT5qpxWmooXwGLADykD3Ku8gMQsKsr45ZGSezoUGjJLbZfLHQk1IVmckvpXap l1PP5xV8yoEPAongcR082MjWjL+O4+DLdwKt2ONKfpua3WjRAi0mpZXDyDN+uKbAa0Wx wcNycndV3TTTlmLUU3ExKB6kNvzDRVsM4NtGHUIHI0SEM6dY8imcAkVNxdXdwNjrVPAa RSRdSvnXiTduIZGmmPH/8sB7nufT2s9H/B/faiyhRujPBCFxIuwNKaucQfMNezai/3y6 15XQ== X-Gm-Message-State: AElRT7FHluoaKbP4U3whkqQq+IxZeXj3Il20sKlwW/PbbjrG9MUlzhMW t1rz1c9GliWuFPhRKyFLAJLovTfk+e0= X-Google-Smtp-Source: AG47ELv8beX5cYphmpvf1SN8wRVtKqmsT7ji7ckzR5FmbDWVSFy7/Cm0/VFu9HlKH+EHzzoVEEl+og== X-Received: by 10.46.65.73 with SMTP id o70mr13499427lja.140.1521922376436; Sat, 24 Mar 2018 13:12:56 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.80.64]) by smtp.gmail.com with ESMTPSA id 200sm2578085ljf.12.2018.03.24.13.12.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Mar 2018 13:12:55 -0700 (PDT) Subject: [PATCH 5/5] sh_eth: add sh_eth_cpu_data::cexcr flag From: Sergei Shtylyov To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: <58a630fa-0e76-dea7-bf11-ad872a4de061@cogentembedded.com> Date: Sat, 24 Mar 2018 23:12:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GEther controllers have CERCR/CEECR instead of CNDCR on the others. Currently we are calling sh_eth_is_gether() in order to check for this, however it would be simpler to check the new 'cexcr' bitfield in the 'struct sh_eth_cpu_data'; then we'd be able to remove sh_eth_is_gether() as there would be no callers left... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 11 +++++------ drivers/net/ethernet/renesas/sh_eth.h | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -450,11 +450,6 @@ static u32 sh_eth_tsu_read(struct sh_eth return ioread32(mdp->tsu_addr + mdp->reg_offset[enum_index]); } -static bool sh_eth_is_gether(struct sh_eth_private *mdp) -{ - return mdp->reg_offset == sh_eth_offset_gigabit; -} - static void sh_eth_select_mii(struct net_device *ndev) { struct sh_eth_private *mdp = netdev_priv(ndev); @@ -661,6 +656,7 @@ static struct sh_eth_cpu_data r8a7740_da .tsu = 1, .select_mii = 1, .magic = 1, + .cexcr = 1, }; /* There is CPU dependent code */ @@ -918,6 +914,7 @@ static struct sh_eth_cpu_data sh7757_dat .no_ade = 1, .xdfar_rw = 1, .tsu = 1, + .cexcr = 1, .dual_port = 1, }; @@ -959,6 +956,7 @@ static struct sh_eth_cpu_data sh7734_dat .hw_checksum = 1, .select_mii = 1, .magic = 1, + .cexcr = 1, }; /* SH7763 */ @@ -997,6 +995,7 @@ static struct sh_eth_cpu_data sh7763_dat .tsu = 1, .irq_flags = IRQF_SHARED, .magic = 1, + .cexcr = 1, .dual_port = 1, }; @@ -2540,7 +2539,7 @@ static struct net_device_stats *sh_eth_g sh_eth_update_stat(ndev, &ndev->stats.collisions, CDCR); sh_eth_update_stat(ndev, &ndev->stats.tx_carrier_errors, LCCR); - if (sh_eth_is_gether(mdp)) { + if (mdp->cd->cexcr) { sh_eth_update_stat(ndev, &ndev->stats.tx_carrier_errors, CERCR); sh_eth_update_stat(ndev, &ndev->stats.tx_carrier_errors, Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -515,6 +515,7 @@ struct sh_eth_cpu_data { unsigned rtrate:1; /* EtherC has RTRATE register */ unsigned magic:1; /* EtherC has ECMR.MPDE and ECSR.MPD */ unsigned no_tx_cntrs:1; /* EtherC DOES NOT have TX error counters */ + unsigned cexcr:1; /* EtherC has CERCR/CEECR */ unsigned dual_port:1; /* Dual EtherC/E-DMAC */ };