From patchwork Fri Jan 4 12:53:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10748333 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 2193214E5 for ; Fri, 4 Jan 2019 12:53:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E66228450 for ; Fri, 4 Jan 2019 12:53:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF62C28471; Fri, 4 Jan 2019 12:53:33 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 5F7B92844C for ; Fri, 4 Jan 2019 12:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728424AbfADMx2 (ORCPT ); Fri, 4 Jan 2019 07:53:28 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:41676 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726773AbfADMx2 (ORCPT ); Fri, 4 Jan 2019 07:53:28 -0500 Received: by mail-lf1-f66.google.com with SMTP id c16so25347595lfj.8 for ; Fri, 04 Jan 2019 04:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:organization:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=zF4iDaIzxJJZqWHJVdecxj/pcWW0/ZY1vAc81ZpDBJg=; b=MCX+oo8HCbsuFVLNYE/ZDz0/AxUmcN9Uk/JjRReenhPjNmZ4wMlEcAhxOK+CYfMAzu wLmnPC33VRf0D1rpWFCQC7lBrZyxnQdTWXQr9KctSw64/mXnvKpNJvTFWen6yZYEvJ5f p42AGumVKOYJ8y/g/moibKrSupnL2WHjC3OX/vVy6sbuituBM28VLiABvcfDLih8Ig2Z dwrTBzPnEWtWzEphl9qXTqExC1wuipdur4RYca/S8paIBn0k9dvMwGSbDvEw++P/6aUO I14Bip1vVjoWjuD1rMQrE5BOcJJjmnQV3PnNFAqckZL2+NfwfoHtLMY1IvbjGcRCN24g nhJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:organization:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=zF4iDaIzxJJZqWHJVdecxj/pcWW0/ZY1vAc81ZpDBJg=; b=WG7pQn8JOBlmLfeBVDy6SzgiTtuXS7s4+y7TLwRMKO0tuyiQgR8nxajoEuknBvHBXO Bd7WR7T0okRwi0qyouYjeBk58fCPMYcOyCUpEl5y9sCSlhKnfUQoRpY5QBddxeOVTvyv elUlNwMRlZ0nh3Gzdjk+L3ufjrSZaK+cNDqDfzKLBDBJSMjZXSALJH7fD/faDxNaSgU9 oFjPRZ2Gt/nSNGt8MVlt7AwJ/PWi++Oe8MdgpKKoMmWP/1plb4sVlCO1Ceqg0CH7TDS8 U3yFPxnQv/zYOCBe4Pf5svN6JDZ4NOUA/NPORYtWrP0BHh3qEJi6DsGZNqZdHs4HIXg7 aZag== X-Gm-Message-State: AA+aEWYq2/Xlbq1pBxas9CHPHrdEEE+4u9QWTQjGvR7U/xs6hxc6Irbt HBI1GqDh0z8oZx0nsRQoKb4rAU8a284= X-Google-Smtp-Source: AFSGD/WPL6i1lfE1SXQNc/6yFL+GxJHEOIygggIJxfvNBt8R0TQAJxqgB0akAWi2FL2CV9vhFitu8w== X-Received: by 2002:a19:5402:: with SMTP id i2mr24636533lfb.128.1546606405973; Fri, 04 Jan 2019 04:53:25 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.86.82]) by smtp.gmail.com with ESMTPSA id a11sm11165229lff.68.2019.01.04.04.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 04:53:25 -0800 (PST) To: Thomas Petazzoni Cc: linux-sh@vger.kernel.org, linux-renesas-soc@vger.kernel.org From: Sergei Shtylyov Subject: [PATCH RFT v2] net: sh_eth: add support for SH7786 Organization: Cogent Embedded Message-ID: Date: Fri, 4 Jan 2019 15:53:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 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 From: Thomas Petazzoni This commit adds the sh_eth_cpu_data structure that describes the SH7786 variant of the IP. Signed-off-by: Thomas Petazzoni Signed-off-by: Sergei Shtylyov --- The patch is against DaveM's 'net-next.git' repo. Not posting it to netdev@vger.kernel.org this time since the 'net-next' repo is still closed. Changes in version 2: - added a comment before 'sh7786_data' initializer; - added now mandatory soft_reset() method; - changed the 'register_type' initializer to SH_ETH_REG_FAST_RCAR; - added the 'ecsr_value' field initializer; - renamed EESR_RTO to EESR_TRO; - added the 'fdr_value' field initializer; - added the 'no_xdfar' field initializer. drivers/net/ethernet/renesas/sh_eth.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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 @@ -879,6 +879,36 @@ static struct sh_eth_cpu_data sh7724_dat .rpadir = 1, }; +/* SH7786 */ +static struct sh_eth_cpu_data sh7786_data = { + .soft_reset = sh_eth_soft_reset, + + .set_duplex = sh_eth_set_duplex, + + .register_type = SH_ETH_REG_FAST_RCAR, + + .edtrr_trns = EDTRR_TRNS_ETHER, + .ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD, + .ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP, + .eesipr_value = EESIPR_RFCOFIP | EESIPR_ADEIP | 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_CND | EESR_DLC | EESR_CD | EESR_TRO, + .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE | + EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE, + .fdr_value = 0x00000f0f, + + .apr = 1, + .mpr = 1, + .tpauser = 1, + .hw_swap = 1, + .no_xdfar = 1, +}; + static void sh_eth_set_rate_sh7757(struct net_device *ndev) { struct sh_eth_private *mdp = netdev_priv(ndev); @@ -3476,6 +3506,7 @@ static const struct platform_device_id s { "sh7757-ether", (kernel_ulong_t)&sh7757_data }, { "sh7757-gether", (kernel_ulong_t)&sh7757_data_giga }, { "sh7763-gether", (kernel_ulong_t)&sh7763_data }, + { "sh7786-ether", (kernel_ulong_t)&sh7786_data }, { } }; MODULE_DEVICE_TABLE(platform, sh_eth_id_table);