From patchwork Wed May 16 20:00:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 914908 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cogentembedded.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=cogentembedded-com.20150623.gappssmtp.com header.i=@cogentembedded-com.20150623.gappssmtp.com header.b="LY/um/KQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40mQKH2MfLz9s1d for ; Thu, 17 May 2018 06:00:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751273AbeEPUAe (ORCPT ); Wed, 16 May 2018 16:00:34 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:39982 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751033AbeEPUAd (ORCPT ); Wed, 16 May 2018 16:00:33 -0400 Received: by mail-wr0-f194.google.com with SMTP id v60-v6so3089386wrc.7 for ; Wed, 16 May 2018 13:00:32 -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=oI4+4oigmSMLBJjc8FHE/I4Gt2watTFl1bnaOYHL9b4=; b=LY/um/KQX5Uwz2cpE0BccYv8b9gkPLpLoUwBpdBSRYjgTLrMaqovlnBuZE13pamxUI NOlbMRDUnATShUnubXj4UmiP4qxY92dZLN1+Avos8ACE96H7GE/qf1batIuq33AQCmIz aapoh+pybPkdV0vTiDnLJHWUjIq0kVv2EGa3X/eMUe+EFAaZ/C9v1eSHDug36VlMQK7U S/k40/03V/PXJWFEfgUkeBt++AdbKqAjeNiReRb8VXqQSiiwgpxZIYT/ETCHwHkhcZQe l7RNqxEovITkmBGY1wzBlnarsom1TvSDtIK2IBjrWUMWvlGlM3FKysOSY4SqaKiqbwow Xa1g== 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=oI4+4oigmSMLBJjc8FHE/I4Gt2watTFl1bnaOYHL9b4=; b=dVzdEaMHEfD4yuJqgI4SIRU9uhBIX+hwMSRpXAzydyYANQPV8ERlz6NwUeNhYpFaaq DEJJBe4orJK1gV34Fi6/P2EcaMmIJrBDynTTHDsZ7Iideo2HvkDGfNe2v4nbN0/Jt3Lg Te8NP2TLHas41BBosgXn6sZtTUiIr/ZVS+U8t0+TiBqd9qvXp0pgRw3di2A6VMqDprZy dF5ct+DPKDZ7plvFnjpcl+Ct5Ao2lgiIwgWsByfI7x8n4OkcoJXc5BGgcJuSsys8/POb mzVWsqQl+0ifmmYKhAr00J4gMB/lU7PqsCW/V8mj11ceJmdvsjtqwxOHlz+n0MinTfp+ Kveg== X-Gm-Message-State: ALKqPwf1Skd46Fviws2Wm9/FCB5qG1yip4BqefyOjBlkUJAbMm0drZjO 2cAT1bC90UQLrOLC6oF7WiIdXeRDMCY= X-Google-Smtp-Source: AB8JxZqRaj9PoBU2fk6s3A8Rtq+9po0kWbZ/6m6gyDEfX2/bmfwuP7J14d67svmle5+m+9jfDgV2ew== X-Received: by 2002:a19:f509:: with SMTP id j9-v6mr16351859lfb.116.1526500831862; Wed, 16 May 2018 13:00:31 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.81.40]) by smtp.gmail.com with ESMTPSA id p88-v6sm547686lja.0.2018.05.16.13.00.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 13:00:30 -0700 (PDT) Subject: [PATCH 3/3] sh_eth: add R8A77980 support From: Sergei Shtylyov To: netdev@vger.kernel.org, devicetree@vger.kernel.org, "David S. Miller" , Rob Herring Cc: Mark Rutland , linux-renesas-soc@vger.kernel.org References: <087c91a3-a451-6de7-5e0f-a835f8cc98f1@cogentembedded.com> Organization: Cogent Embedded Message-ID: Date: Wed, 16 May 2018 23:00:29 +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: <087c91a3-a451-6de7-5e0f-a835f8cc98f1@cogentembedded.com> Content-Language: en-MW Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Finally, add support for the DT probing of the R-Car V3H (AKA R8A77980) -- it's the only R-Car gen3 SoC having the GEther controller -- others have only EtherAVB... Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov Signed-off-by: Sergei Shtylyov Reviewed-by: Simon Horman --- Documentation/devicetree/bindings/net/sh_eth.txt | 1 drivers/net/ethernet/renesas/sh_eth.c | 44 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe devicetree" 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/Documentation/devicetree/bindings/net/sh_eth.txt =================================================================== --- net-next.orig/Documentation/devicetree/bindings/net/sh_eth.txt +++ net-next/Documentation/devicetree/bindings/net/sh_eth.txt @@ -14,6 +14,7 @@ Required properties: "renesas,ether-r8a7791" if the device is a part of R8A7791 SoC. "renesas,ether-r8a7793" if the device is a part of R8A7793 SoC. "renesas,ether-r8a7794" if the device is a part of R8A7794 SoC. + "renesas,gether-r8a77980" if the device is a part of R8A77980 SoC. "renesas,ether-r7s72100" if the device is a part of R7S72100 SoC. "renesas,rcar-gen1-ether" for a generic R-Car Gen1 device. "renesas,rcar-gen2-ether" for a generic R-Car Gen2 or RZ/G1 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 @@ -753,6 +753,49 @@ static struct sh_eth_cpu_data rcar_gen2_ .rmiimode = 1, .magic = 1, }; + +/* R8A77980 */ +static struct sh_eth_cpu_data r8a77980_data = { + .soft_reset = sh_eth_soft_reset_gether, + + .set_duplex = sh_eth_set_duplex, + .set_rate = sh_eth_set_rate_gether, + + .register_type = SH_ETH_REG_GIGABIT, + + .edtrr_trns = EDTRR_TRNS_GETHER, + .ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD | ECSR_MPD, + .ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP | + ECSIPR_MPDIP, + .eesipr_value = EESIPR_RFCOFIP | EESIPR_ECIIP | + EESIPR_FTCIP | EESIPR_TDEIP | EESIPR_TFUFIP | + EESIPR_FRIP | EESIPR_RDEIP | EESIPR_RFOFIP | + EESIPR_RMAFIP | EESIPR_RRFIP | + EESIPR_RTLFIP | EESIPR_RTSFIP | + EESIPR_PREIP | EESIPR_CERFIP, + + .tx_check = EESR_FTC | EESR_CD | EESR_RTO, + .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | + EESR_RFE | EESR_RDE | EESR_RFRMER | + EESR_TFE | EESR_TDE | EESR_ECI, + .fdr_value = 0x0000070f, + + .apr = 1, + .mpr = 1, + .tpauser = 1, + .bculr = 1, + .hw_swap = 1, + .nbst = 1, + .rpadir = 1, + .rpadir_value = 2 << 16, + .no_trimd = 1, + .no_ade = 1, + .xdfar_rw = 1, + .hw_checksum = 1, + .select_mii = 1, + .magic = 1, + .cexcr = 1, +}; #endif /* CONFIG_OF */ static void sh_eth_set_rate_sh7724(struct net_device *ndev) @@ -3134,6 +3177,7 @@ static const struct of_device_id sh_eth_ { .compatible = "renesas,ether-r8a7791", .data = &rcar_gen2_data }, { .compatible = "renesas,ether-r8a7793", .data = &rcar_gen2_data }, { .compatible = "renesas,ether-r8a7794", .data = &rcar_gen2_data }, + { .compatible = "renesas,gether-r8a77980", .data = &r8a77980_data }, { .compatible = "renesas,ether-r7s72100", .data = &r7s72100_data }, { .compatible = "renesas,rcar-gen1-ether", .data = &rcar_gen1_data }, { .compatible = "renesas,rcar-gen2-ether", .data = &rcar_gen2_data },