From patchwork Mon Nov 11 06:55:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11236637 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81D3414E5 for ; Mon, 11 Nov 2019 06:58:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AA9122476 for ; Mon, 11 Nov 2019 06:58:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uwht4vx0"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="jI9eD3Lc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AA9122476 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HfjsnRHEAa/uu/FXMj8UgawXCsmDvM3fdiMW2x/tXu4=; b=uwht4vx0ydJJb3QRUc9JIpd82I UtAd1DOTPhAypXdDCnnaM+gHI6R0HVmbbJHzzGcfkAGv3jq8jWU6RU1FRqk6pJIt5pO7tP2Qk1ff/ aFbgf2W5N6j8FJqJLzB7rKMa88jpdPAZHclJuZ3nVjFvEtHBxDyWIHvahKqSS99FPJ61CLVr9YJmJ xXSXJ/bX4a3xwYklgTPT5P/1DSuCtOcATDQR9ix9nHv/VjhqGvbO5EXvgy26KGB/RlXCtVPMOarhw nqKgcfSu1tz/90K+oxvdmOwDW6y+Epe27LceUWYixZgLjyaBZp/RYGUcWqBOy8HhsJpaReVJGnrHU G4L81adw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3eH-0003bj-TV; Mon, 11 Nov 2019 06:58:05 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3do-0002yL-6c for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 06:57:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573455361; bh=taWXA58DvTrq62BOOg57Z2EuKGOOTGhqKhyK1g3A/ds=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=jI9eD3LcrXzxaGCYBqB3BVpPt1RzH2BS4l+LGiIeqvybJQ2/embAE8eRSEyJcFiBP Eu8AZkvGgRjV9OBVS1Qnf2yvwBJYaoHknmr3WiToXD0iJeNR8HQP6s2TeYM3jyluP9 ZTcER92x0s0VvRFq2tgxe+cUyg5JWrZ5FFAYEn6k= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.112]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MStCe-1iKoVb0kJS-00UJ1B; Mon, 11 Nov 2019 07:56:01 +0100 From: Stefan Wahren To: Matthias Brugger , Matthias Brugger , "David S . Miller" , Florian Fainelli Subject: [PATCH V4 net-next 1/7] net: bcmgenet: Avoid touching non-existent interrupt Date: Mon, 11 Nov 2019 07:55:35 +0100 Message-Id: <1573455341-22813-2-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> References: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:30u0jwnlkfoudF5pdDo00JxvsIXSMCUibVC/6Pvbwnp6td1shV3 Lv2Mm0WGNSdl2svgY+DQBPT+vmoH0wJuYwRZUlJkyFRtSDkdo/n3/lHGnxS+nLIC84axF0O 2VHT50Yj7yT8cM+zz+BKPOWDgsh84ER4zTuKSRRQpT36AF/1gy1rq2K7S5o9TWKwm+vZ5EB B/czQ8SEb6G8mmiuEGM8g== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:I7MAFrqw070=:V2g/cXY0XouCVY0v2UxsdP NgV8EcwKYsUe5X67RRK/sDWIQBRyPLPbNht9Jk4JnmwwjYOq68mpNiPiiqmUMk1opoSX7vD/7 7v1E8rAnvFDC9wPtIIyN76q2fdb0mlCdYCO1gtFKbRKC/XJxb1DHtt5wlY27RUmpY88mVNg6r nXHYxl4tvnitd9VrLxrR8INhd8JEMWLHnfyn85jJmMjl4z1Q4X0PGcaQkC0c/yOOviV75BKQD 8oPOHbI3khMXf41oWpAZ0P3bedG/NC74y8fNAymTXMF4BMMfgxu43lzw7hR/pGvLNXaF966+M tO1m7oUfDXIxA7pHWj5dWaGTv7hgU7Fpg9/kvYAXp++faFli4p1rnoX6BBe2K74O8DCE6msrs vJixrAGiCNs0kqBFyXGsiwvpQLbKlxP8FI/VcNBsQCqamaMjp3W8pQWyYOoebEv85Bncnsb8a dxrYlFWtVuxKuy5mWrXnnI4fNAXAcvaLfPz3xQEdEJ4pn47q1KooVAxrFuZFQ8ZZUImoR16ze TEcK7gnuDqOgbgiYdt5lsNbONrLXMcMSOjRwObOxwpsiGrzDeSZjyrDmTA81Gb1a9gOh0e7KW 0fxdkKsFDpbHXXGSsqGJ6g9Ma4oHMx6vVpjf6nnkeTAoFUaqa1Muo/+IxffR4XTDVIxbgpyeS LHIy/Gn76/4d5+4zlyh36Nq+2IPKtOeuxYtFJnBNFhWuS6Ch2Z6xn1ZOovNGq4PUGIkJRSplC KFUzQV96/s9Fv5b9ZmL7UWTalwu+WxeZahzPRkgWh7+gvzjH6fEkQK48Lx7dDlKf1wxpx43yV t2T55ydrlgPCyLHfLwIsy7MQCRY2BpXHkYxsAv3ZkDnUpe2K/+/X4weaLMt68HYxUbs2n1d8G ye5dLIqE/sD8J5y4TvUM4rq9VEEOJrJaz9cpEjnf9C63umBDJYlUd6tEJhooXR6jN2wbGfk/B Gl8aDHFg1IbLz+hRo0m884xLwl11pwN7omY/dITSAH5O4IHh0H7w2LJze9/EB4eLQY3QSpftb 9X5vO7KsAiZRsRrXfXSw4RuQ6t1axipUCk3AMIDNb6Tj/XvJqQL2owHmMzdvGzPitWy2PWBoI i3oPRCHMm0pkWZ2xDYph8cv69nnv/aVz8huz0ZKuhLcMI9f/OAIaYC7uThrpDFLT4QCBxKslY N+mfaFFGhIWMA1eBC0XVGr0oD1AsV12o755nPXWzVGEsgQB5gwpcedmLWT8N2HxLAe4EvcBDv xXVQtLbf/leCRsMuXZqxnZPL7NM3lzZX/XNmMEg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191110_225736_560207_A8438CDC X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.15 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (wahrenst[at]gmx.net) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Berger , netdev@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Stefan Wahren MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org As platform_get_irq() now prints an error when the interrupt does not exist, we are getting a confusing error message in case the optional WOL IRQ is not defined: bcmgenet fd58000.ethernet: IRQ index 2 not found Fix this by using the platform_get_irq_optional(). Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 3504f77..575f162 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -3459,7 +3459,7 @@ static int bcmgenet_probe(struct platform_device *pdev) priv = netdev_priv(dev); priv->irq0 = platform_get_irq(pdev, 0); priv->irq1 = platform_get_irq(pdev, 1); - priv->wol_irq = platform_get_irq(pdev, 2); + priv->wol_irq = platform_get_irq_optional(pdev, 2); if (!priv->irq0 || !priv->irq1) { dev_err(&pdev->dev, "can't find IRQs\n"); err = -EINVAL; From patchwork Mon Nov 11 06:55:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11236641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08D5D139A for ; Mon, 11 Nov 2019 06:58:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA7F42247F for ; Mon, 11 Nov 2019 06:58:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sdedhW1i"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="HfqxP65F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA7F42247F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RBKsWYQF8FftJT1Z0eSEqmH7B0BzQvEOtdd1GE2CT94=; b=sdedhW1iwRzDdSj9JSBUEi79oe vORWzdILr1VvTQjF4nK5KRlcFNl1qPGQIiWpcLMRHJKCZfKUgzPysoIy4BKFzHjwpZ3c00bvwWsBc Q2PamaMpvIADPge4In0TBfLlyrXaeII/gXHCwmlmu5MDQSxAZY5XYTBzH3mqPtg48VXGB9XhPkFQy miY6olPQBPBlt/oX82/pIi9uI91yBO3cxYsYgKeUm9IJHanputRWwXtOCdGmHoiKClSWIL9chFvk+ q4soI/bJrJ/oltcWc+DthW8V5Jp07ti3j1M1nYW2+dyHuWDbKP8/Kh1kZrPURM9nKrid5IZW4mUnF qTTSri7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3ep-0004C4-Tc; Mon, 11 Nov 2019 06:58:39 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3dp-0002zM-IA for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 06:57:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573455361; bh=PDcMlsTNCVoRx2qfDTLufTFxlXCLrYMeLsjNAqTRG/Q=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=HfqxP65F6w51fsv1P0/ZPY3bCrSW2AL+n0F5dx1q4l7gDIZjQ4T0Ns3XDnoaGz/NO naUgKVJth9NBizgog6EjQ0XeJoQgOfdWduGBFm8fm17votdW3RLiZutcXLkrGLzdTD kNFOy+SaRiJClC13ROpBtDCe65JwbG4Ojav4+QSc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.112]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Msq6M-1hbHCr2bsm-00t9N5; Mon, 11 Nov 2019 07:56:01 +0100 From: Stefan Wahren To: Matthias Brugger , Matthias Brugger , "David S . Miller" , Florian Fainelli Subject: [PATCH V4 net-next 2/7] net: bcmgenet: Fix error handling on IRQ retrieval Date: Mon, 11 Nov 2019 07:55:36 +0100 Message-Id: <1573455341-22813-3-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> References: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:tJhOetkiIh6PrprbPRKXYAtx+HAC2RlHNL5fKAuiJHmf6KO+I1W oSUkUc9Nkatbi8GZBpGN8EGQVwe7w7gZ985Jb+aitMGtQRsNv8nmqsvXtoOCHpysVwO/Om1 6WRcpq3o5DKu7CvfaWRIgshkKH2S+SyuG85Fvao8LNMiSwJbr/80vwz8M0qtGl83CTSU0yB FKHR9K91Dfy4lOUWL1PmA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:sIyxer6VW/8=:yhQZQcwXDUhs03Hp9PyJWh XMR8AWaOIrqiuvOZBtw53P9WCljXhJXQO3TPkUyqp39jWdG0Jg40rfN6JEeyYEdkPjXy2PQrU 3mV4WyOdFkK6euLtDQejeqH3BCfn3h9157M4KUs9E+mp6KWUXJ9BDtzf3QP69TyY6rILiJZDt eTLBFs/1/FYow8wts1QFNYExKpFSeu4xNRz3g6cgRnqpHScjFKRTzS2RzcjjX/WLnfOxgtLS+ CYsAKCNKOpae+QVxpiJs5VX8OiH7UvGxTD/J3NoKVJJydg9v5C5A+z7gtWMN0Shz3b7iOyovd k5xcbiEcEDTfGMhf4jGRaJP+Req3jx7dszZ0+w75FXqtKA8rZf4g1N2bWpXbnaXyq2ODu/Is2 Y+DbnQlFgLNyU0ltzi4HKuoueRODAWzP320OYyjDU/Rm2lcTJN+5s9JeiY03avuxM471RR1Tj ynJtptPluIDhYLCCfeRC4/y5ibezsLHBy0ltMEI2VFEkRepcpj+LdnpsHbj24hVVn/uIRRXVy R5uGrWEOZKFiaOlKm16EBa+8o/q8GTD3hReTyPgi03C+X64yuQZBQDl9Y5I1nx5k+F/0BznQF gqrgzrXSq6q0ftfnZS02ejp2XkxJK2xS3X3sMpDemTRsoQnJ6RoW6XFT5Z7t5/81ubDTaBdta xsmbPcTnOuqK0DapfopqZMDQ6/XyQSxmiHJQEYKNdcJ48JRpFgo0ctTa+ZE3mCrIyrDVoTO6z dWHLRFFl7G50kiqFc7s2qB9VUCOt9H2nA5dMu4r4bWyVbSJGR2fYxOeNGYDocPP854J+7pYu/ IAzUbtmSBrFE4Awpgnu9ePeGML46Hs6uIwx1DFtAFfQw/p1gUFYSE8znyexoFeWynuPVz2O5Z AsJ2L3QXxwKxVoYp6NMQqIzif9hZTTdDlFh/2xeU9hhvZchb+4WFR+dgHLg3L16ceNd4ueZ2H dr1MCrktx64umgx8NaDw4tPv35hJBetSq085R9P9xT8OMU6nL9TWMZN2SCfSQeuaBa+QwLdRw HZjX0TWwDJVgD0MOsM6+jF4NhI79mDGTeND4c0GYsok5xZtrp2eQN89syOzGub5VfogE4C3vC eP/TFHJ5Q4nc/cEkBaNIU5WUyludnAio5SIq+S7UFD8T2K9DTPVNmH/yMK4W3c2yOhE048CYT 5HuwSCrWi21+Qp/k5IlHvMoxjpwLMVHqDdnAC3JvbEFogA4LViEWXvvLbuav1Fu/Gh7mx/O5J XXpgpCn6R6/GMJpvJSCTfi3wn9XiBUQXgd5Re2w== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191110_225738_244412_F31D54C5 X-CRM114-Status: GOOD ( 11.53 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.18 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (wahrenst[at]gmx.net) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Berger , netdev@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Stefan Wahren MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This fixes the error handling for the mandatory IRQs. There is no need for the error message anymore, this is now handled by platform_get_irq. Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 575f162..ee4d8ef 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -3458,13 +3458,16 @@ static int bcmgenet_probe(struct platform_device *pdev) priv = netdev_priv(dev); priv->irq0 = platform_get_irq(pdev, 0); + if (priv->irq0 < 0) { + err = priv->irq0; + goto err; + } priv->irq1 = platform_get_irq(pdev, 1); - priv->wol_irq = platform_get_irq_optional(pdev, 2); - if (!priv->irq0 || !priv->irq1) { - dev_err(&pdev->dev, "can't find IRQs\n"); - err = -EINVAL; + if (priv->irq1 < 0) { + err = priv->irq1; goto err; } + priv->wol_irq = platform_get_irq_optional(pdev, 2); if (dn) macaddr = of_get_mac_address(dn); From patchwork Mon Nov 11 06:55:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11236633 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53A8414E5 for ; Mon, 11 Nov 2019 06:57:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31C39222C1 for ; Mon, 11 Nov 2019 06:57:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FAwBZ1jF"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="C72sYSAF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31C39222C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=BNOSr6D7iYuulb7CgCVaHcHCg2/z5UhYn8SChYA4bOc=; b=FAwBZ1jFnmZX+Vb5PCEWkfms2z +UpkXWxlwncsPcUU+dQAzOIfSwb0OuiB7iASMqt6hkAxmzrAxXBXA/I1nUmtGpXfM/dUq7k0YXqBn 8/eozNPv6Wi7sM5Jyr9e6dwHk7CTesYkOtkmvxvp1PwILsf6eHm7K97cKNVQOy3pfT8R6vt4291VT bDY0yqJmchgq3a8UI/S9NvgJe2B7PP/F4hYbFGjw1lhqwwbf5f+dfDxc8AdwbJyiABDLR5/VT8EoC bH5LkxL0u3Xo3Ge03EYLw+zUk2lOOmY7EDPqmPUEoKXsm6qL2iNt4wUHeChqYidwr7ze4bRfc4LCF eeLuNPkQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3dt-0003Ar-Es; Mon, 11 Nov 2019 06:57:41 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3do-0002y7-6a for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 06:57:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573455362; bh=jyAikbVVRrPYgn/XSwbrVXcnTYEvKUjvXNC1/tigGeU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=C72sYSAFQFl3by4zU3weGmJQkmCfe3varVCoZL4nL9viiLliVOiFmChUGJnwmZ/05 7pqZKncEzkCtiG4+bfvwOCuoVCPXue8d8Mz8L2jWI3uF0O7mH83NWI1pxMqC6JaqUX 8ECWp2fkA+fe2VK4d4DLQvxdE+plYGu31j6gV01Q= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.112]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MGQjH-1ifwGV0InN-00Gsly; Mon, 11 Nov 2019 07:56:02 +0100 From: Stefan Wahren To: Matthias Brugger , Matthias Brugger , "David S . Miller" , Florian Fainelli Subject: [PATCH V4 net-next 3/7] dt-bindings: net: bcmgenet: Add BCM2711 support Date: Mon, 11 Nov 2019 07:55:37 +0100 Message-Id: <1573455341-22813-4-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> References: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:2hB5ao/GcCOJ/sp3SAl2oL4SCzxVLtXCrSYNQ6upR9E0WsjjTdc ZO9EsdDfYGZI95Si0y4UmUMsaX8xzliUlOaUh69kRJqpSRtxJ1Qp3JzINmLC2+PCWyHZbz/ 0gxpPQIbnwLRtsF9kn/MmycDAZjey4tfyxbLOhNrf+veEESSxVCgKOaIwHOCo4pSwQkY2Lh 33+ieyYe4X1c+YdZCZWIg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:qWyXgYi9gYc=:lW3bEoSyQQZxKO8G9+DPdJ A/pnMjwBwOYGMnvIGXQ1StodIBbG9PnEd489MYVpLjzRuAgL9zYliaQG2CusQuJwZ3yWR+20H kYTwBcCRI0Ru2r5j4mZqFZ60JCuNFimHOeVLQsMgH4dFhf21R5hVEDDL2TGHY+3cCGy+IYrg2 FEqtusPbdI39WX6TrMn+bYZ4c9LhQtI0X/CZKyAx+3/MS4TbH40ZWOvqph+6MpsAa76YtK4vV TRak/d3cNq/TQdvnFzSV+Kv1cYaVyPEP2oK5lMJQgUNiiPlxG+SWg/UhZ8ZqaLBHhLESMp1hj TQ+DxJfGKwEfsoh+7YoeLhO1xpgCwwf+cvJL/b2erq6KnuFpWn2dqLUxLlRJFdOLgAW82zA/0 yMkTZOgNw1A4oFvHPvAdWQb37Pq39AlieD0Gehk+q+LXISiHisGZICvVjbBTl8tBBU7G2A3Sf WvJgtiXYtxMqtS4+qDf1I4sI4aDPN7TKf56H5oY+K3akNozjh70kHZZHAaaqLrk7bjF/QN6X1 Zg8pvfp0OOn/5TlYiqsjz6HyvtgKYbyYKQ9XrLCXIYKR7Cw9CWkQZAzuduPfDtVskSTI4wCfF 3vdwYAOHdmn0ZurGH7nDJZ7hKWHVEgzA0S4r82OBPj1jtapXN0g658xzafBTcS4yP3Kry/VJ0 2DGQsXWuMOzR00ca+uUh9wrwq1BpzrS/VmjQ0h5y/SKFVxb1+8H2Q6qDZgR0A6nUhAbggmHm3 ZM1OUp5khBXqF4d+jFIOM6hdj+7sIKht4sVK+dt3M+YFSCPIuYpQ6CZVTJOVw++vVTkzpVvuT wGfjCrneTik3GxiR4znhya372Jc79kIfbp4qNzDRh/+IEoSZ+0XTItB4XhK0+c9wXklIi+mtH nC4JBSZAs9Mt8/QWnqa8hCxY/oPo+gXM0DXpkZziDM8vGwck6dAhYgA0I1LWg8CmugxPkm1yg aUWVokm9J5e3Pv6pFewP1R/fDGf1ru3sIo6CxbCf8Tx5YNrI5D7Eg/WyWh5e2Mzmv8kjl3x+1 AgHW79yYbhRlugV/SlmAmiajx6ca50H9avODGbhFl8e/5UlwK/vDCSAh7XX54GaOy+MUBOXV/ 1wZDFWEk1QEXXlTmTXag7pHQpSixmkA5YcOyyyRAQalmoXBzxqYNeJOPQodX2nfeh/z5f0H43 4PUscjR7q1c6LzQtC8xeIdN264vK5lQ3/hbhrUD7RLYrmdt2D5wrJWytYn4igT+jVp240Keq1 nCzPYldviO1dY44gWItmBEzWBRB/r9yhHobuXYQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191110_225736_553398_8E5C689E X-CRM114-Status: GOOD ( 11.16 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.15 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (wahrenst[at]gmx.net) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Berger , netdev@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Stefan Wahren MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The BCM2711 has some modifications to the GENET v5. So add this SoC specific compatible. Suggested-by: Florian Fainelli Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli --- Documentation/devicetree/bindings/net/brcm,bcmgenet.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt index 3956af1..33a0d67 100644 --- a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt +++ b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt @@ -2,7 +2,7 @@ Required properties: - compatible: should contain one of "brcm,genet-v1", "brcm,genet-v2", - "brcm,genet-v3", "brcm,genet-v4", "brcm,genet-v5". + "brcm,genet-v3", "brcm,genet-v4", "brcm,genet-v5", "brcm,bcm2711-genet-v5". - reg: address and length of the register set for the device - interrupts and/or interrupts-extended: must be two cells, the first cell is the general purpose interrupt line, while the second cell is the From patchwork Mon Nov 11 06:55:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11236643 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA648139A for ; Mon, 11 Nov 2019 06:58:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B2DE2247F for ; Mon, 11 Nov 2019 06:58:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uLkesbO6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="OS35HakR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B2DE2247F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=bcCpqAWKvAmNGznGfj5gtO1+Uq5ob8hMD1fVvtiADCE=; b=uLkesbO6cBkgk8O+hzSNEp0fQM ++4+TtUtm5CVaLrnXK00FOXHnkXDpnzJawb2gDISI0J/+Zbo+OZI1w2HnEjtg9Ab9mygG6iSK/6hL 3Ns6txoA1Nvhd28u++Jx2AI3a5103j1w8P7IW3GfJOGZXjwgqwVa6iAvedxtF/ErXdxdei0iJmuze NER5Gb+PHSsjPi+9yTDXWgnzGhqN3+tSBNayF/jZqci2/yOUe6cDLRqJ4Vxqe9NXw5XmmOlgC90ld 3bwGsp1AUlPixsQliJ2v7elWaGKwrPNeV3veNVT3MJksXa0WjET2IyJtJzAWyWDYgb4G9eQHjI71N Yyo3Sb+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3f3-0004QK-Jj; Mon, 11 Nov 2019 06:58:53 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3dp-0002zZ-Ho for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 06:57:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573455362; bh=8HV3EiHpIHVHXBdME3Q/eToeSF7Jm2HaGy/rlqtR8Ok=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=OS35HakRmMN/vW5B0NGPW1fASvPZvo4LGO0ksNKg+GhWg9pzowrKqRT85QStuX6gn xMEBbwHgAh5RJaEzAOgRlqGVccMJI3SMOP+7hX3a5fjJxlT2YNQHOwIvh6uhAy/CG8 gAy6rzbLUiel3E9XWWIW8mFt0REfNkPoRtUI3nXY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.112]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MfYPi-1hxDuU2AdE-00g0F1; Mon, 11 Nov 2019 07:56:02 +0100 From: Stefan Wahren To: Matthias Brugger , Matthias Brugger , "David S . Miller" , Florian Fainelli Subject: [PATCH V4 net-next 4/7] net: bcmgenet: Add BCM2711 support Date: Mon, 11 Nov 2019 07:55:38 +0100 Message-Id: <1573455341-22813-5-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> References: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:tRBUOnoU9EWg6WOY04KifIkEQDRnA9kKZz4ezZGLLoMf4Ocl2tg uk0mMja29Qfoz81SKYJlwy3j7OXMtUbHvR/7dbxmCCBe7N7tWpx/ejkqSwzxoQOHEfQs+X0 +8p3sXTHeTSGMsPjdY6KUz/TEyq8xEymvN0dtlDtxHj/GCiWl3no+Lw6IHSVWp6f6gIAkio hQVIFZ3thzkMr+X59PV/g== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:xrqUkc5hyA8=:QyBakKAx3dPhq8Jn1H7yRv yQk7gKlELOMgNuv+H4YMEf1WFv3cRoYroK61LNuHdluPvsmTD6S6DjWCOVqc16U4siw7f5IpZ TGdZu9P0JehAm7Q2qhsC0jfbm+YZQvTEYSEd9vxPisXtxtnSBSuXK+UHEHj9WTnOO4bsASzpA VLxMibj5gC0kp4wZfpi7kalrkdD5ukdhc3CljyVd855t4Y2eZ6kHFKmScxZNWBcAD0YBqIt+2 8bci4r5Y3E0zxB/LDBZgY0U6n2LdxNbGVPDMdqxFB+CezpAjmWEdkGO79Xkm2wPCvPx6si1aW sR6ru12+d6CL4bO9Gc5A67GI+usTQnfKKxKYMTxKjYDcazJYNeLxV36KWdj8Bw9V/6y5YsOkw I/GW2EDRHCVSXcaSuy46G02LT6qmXEuA4vqadod+VOYO3Kmha953EJrKqlRnwp5VSrOCcV+fa PuBvbQTx6G4LfPoB5yJyB3zbleFj1z/ZTCnbiWAd7QvKkEEWuEevImE7PJrHoIVopxba6HofX D+ooM1dEBakXRhptyuanxyLHimS4EftTRcioeXlR3W5ue9PoKCdafUxrKJvElL7G58c0nvdh0 p/LihWLl6tlluiwlTho06hgwAHdeEeCd40Seh9SnoI/yKjMDgPw51OIJLwkw56ERH5EirzcFC UptVzqDoRf6xx10fll3lZ4MicZOd5Krk7bG2fZK/nCKn7gQRIdmG4JKiRsLOCY4nzZeisNxUX U3LBaUj3E/Jj8kt+XBzFziHXE7Nd7E4ivU2U/QZytI1ALCgHL4i7b0YLZQdRV5atAu4K4smg0 lzsIMaKN84GKXfIFo30lLChxj4UGQRZl9qQkOh7nQgbcE06bH5E7ebVQPqTvWgVMl3x8FwCk7 Zzn87BPqrjxO2aig74AybtMmjZLIuO1J1CCWiDgAxtD2fKattidm0diisfGiW7+f26d72qqzp vkAkPCFYWztqxTnN074Lps5M8Td8NsHGQmzF47jGOWdk/qBaswzWSisFUVieQw7pBcAQczJoO 0gc6lkwde8/G/S5pYoRazsUybIUYWdsQQKMBA8xAOTVvTc1L2+0A9zT6v217GIwpfIN1Ejggc jxRIzaxislJ9l4LXpEihU2NIKiaQRu3zZ/oU4pTSpuUI1TOQaRkafhXjtCjxXlzVmO9UAWOls pi2PStrvTdQCBeN4UIGOe7q87TOSZj169alGMkvIwTL32QLbNKreR6mbvSzsDJAJuWLTae6cl KXOhYNaCD1flfda353OBC4ic1hv3YGKKrQfJN3A== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191110_225738_245279_0578CAE9 X-CRM114-Status: GOOD ( 13.94 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.18 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (wahrenst[at]gmx.net) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Berger , netdev@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Stefan Wahren MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The BCM2711 needs a different maximum DMA burst length. If not set accordingly a timeout in the transmit queue happens and no package can be sent. So use the new compatible to derive this value. Until now the GENET HW version was used as the platform identifier. This doesn't work with SoC-specific modifications, so introduce a proper platform data structure. Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli Reviewed-by: Matthias Brugger --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 63 ++++++++++++++++++++++---- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 1 + 2 files changed, 54 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index ee4d8ef..120fa05 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2576,7 +2576,8 @@ static int bcmgenet_init_dma(struct bcmgenet_priv *priv) } /* Init rDma */ - bcmgenet_rdma_writel(priv, DMA_MAX_BURST_LENGTH, DMA_SCB_BURST_SIZE); + bcmgenet_rdma_writel(priv, priv->dma_max_burst_length, + DMA_SCB_BURST_SIZE); /* Initialize Rx queues */ ret = bcmgenet_init_rx_queues(priv->dev); @@ -2589,7 +2590,8 @@ static int bcmgenet_init_dma(struct bcmgenet_priv *priv) } /* Init tDma */ - bcmgenet_tdma_writel(priv, DMA_MAX_BURST_LENGTH, DMA_SCB_BURST_SIZE); + bcmgenet_tdma_writel(priv, priv->dma_max_burst_length, + DMA_SCB_BURST_SIZE); /* Initialize Tx queues */ bcmgenet_init_tx_queues(priv->dev); @@ -3420,12 +3422,48 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv) params->words_per_bd); } +struct bcmgenet_plat_data { + enum bcmgenet_version version; + u32 dma_max_burst_length; +}; + +static const struct bcmgenet_plat_data v1_plat_data = { + .version = GENET_V1, + .dma_max_burst_length = DMA_MAX_BURST_LENGTH, +}; + +static const struct bcmgenet_plat_data v2_plat_data = { + .version = GENET_V2, + .dma_max_burst_length = DMA_MAX_BURST_LENGTH, +}; + +static const struct bcmgenet_plat_data v3_plat_data = { + .version = GENET_V3, + .dma_max_burst_length = DMA_MAX_BURST_LENGTH, +}; + +static const struct bcmgenet_plat_data v4_plat_data = { + .version = GENET_V4, + .dma_max_burst_length = DMA_MAX_BURST_LENGTH, +}; + +static const struct bcmgenet_plat_data v5_plat_data = { + .version = GENET_V5, + .dma_max_burst_length = DMA_MAX_BURST_LENGTH, +}; + +static const struct bcmgenet_plat_data bcm2711_plat_data = { + .version = GENET_V5, + .dma_max_burst_length = 0x08, +}; + static const struct of_device_id bcmgenet_match[] = { - { .compatible = "brcm,genet-v1", .data = (void *)GENET_V1 }, - { .compatible = "brcm,genet-v2", .data = (void *)GENET_V2 }, - { .compatible = "brcm,genet-v3", .data = (void *)GENET_V3 }, - { .compatible = "brcm,genet-v4", .data = (void *)GENET_V4 }, - { .compatible = "brcm,genet-v5", .data = (void *)GENET_V5 }, + { .compatible = "brcm,genet-v1", .data = &v1_plat_data }, + { .compatible = "brcm,genet-v2", .data = &v2_plat_data }, + { .compatible = "brcm,genet-v3", .data = &v3_plat_data }, + { .compatible = "brcm,genet-v4", .data = &v4_plat_data }, + { .compatible = "brcm,genet-v5", .data = &v5_plat_data }, + { .compatible = "brcm,bcm2711-genet-v5", .data = &bcm2711_plat_data }, { }, }; MODULE_DEVICE_TABLE(of, bcmgenet_match); @@ -3435,6 +3473,7 @@ static int bcmgenet_probe(struct platform_device *pdev) struct bcmgenet_platform_data *pd = pdev->dev.platform_data; struct device_node *dn = pdev->dev.of_node; const struct of_device_id *of_id = NULL; + const struct bcmgenet_plat_data *pdata; struct bcmgenet_priv *priv; struct net_device *dev; const void *macaddr; @@ -3516,10 +3555,14 @@ static int bcmgenet_probe(struct platform_device *pdev) priv->dev = dev; priv->pdev = pdev; - if (of_id) - priv->version = (enum bcmgenet_version)of_id->data; - else + if (of_id) { + pdata = of_id->data; + priv->version = pdata->version; + priv->dma_max_burst_length = pdata->dma_max_burst_length; + } else { priv->version = pd->genet_version; + priv->dma_max_burst_length = DMA_MAX_BURST_LENGTH; + } priv->clk = devm_clk_get(&priv->pdev->dev, "enet"); if (IS_ERR(priv->clk)) { diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h index dbc69d8..a565919 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h @@ -664,6 +664,7 @@ struct bcmgenet_priv { bool crc_fwd_en; unsigned int dma_rx_chk_bit; + u32 dma_max_burst_length; u32 msg_enable; From patchwork Mon Nov 11 06:55:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11236645 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4E5A14E5 for ; Mon, 11 Nov 2019 06:59:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A2014222C2 for ; Mon, 11 Nov 2019 06:59:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KARI8poz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="TGGJOWk4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2014222C2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZTdW+jgsvnkPBaUYJWMToDYIWxhx4DC9we9IoWhZFec=; b=KARI8pozTvxx5xPP8dHgOfsi1O kOEgo6BLlGLtYacVNjgDT0xZm1uM5F/pZel1cAVH4+ircFUMZfNLpXVvMPHtodCtJqZ2GGfBpN4Az IDXSeusECd6EoXDA7tshv51X35WT9yaiGF0QNQjDUJk+LsCOerhcH0XpjGLSLNff1qp5MXvYQbTOG lEmrheiBy2m9Ba00vscPNPf0s+wm+onfX7ZeKN+ajuuZDPetk8Xpq3JaxyjH7vW8NwjSiGfZLwz5G exYqtIfB/TdDc6JyUqN/Eyn6qknHGyq7Rht5z7JWm77UI3/6O6h1XZsUS2GWvX75czDaXpITzY5EB SS0ueoOw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3fL-0004h1-Cm; Mon, 11 Nov 2019 06:59:11 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3dp-0002zR-Hn for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 06:57:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573455363; bh=6oOYDZnnvSD75V6ZmRJVa3Ar4J3K6bMR/ftChguqLOU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=TGGJOWk4cz8sVGSLorIk4qjmC2qaGIIJLCcZsFFMYdWuBgB3mPIasN1GlAzehsWln q/TfXra4CdTu6D1F5nhNrlNEzvHtUuYdHq5wqAvya7a/zeeFC0xQqBlvuudyOxyVei gwwKSn+GuSg2xjCdkLBlszZu1/AqxXtY9zYp6tTA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.112]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MRmjw-1iJiZs3yIs-00TCYT; Mon, 11 Nov 2019 07:56:03 +0100 From: Stefan Wahren To: Matthias Brugger , Matthias Brugger , "David S . Miller" , Florian Fainelli Subject: [PATCH V4 net-next 5/7] net: bcmgenet: Refactor register access in bcmgenet_mii_config Date: Mon, 11 Nov 2019 07:55:39 +0100 Message-Id: <1573455341-22813-6-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> References: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:wwekawicxXhu5PocOcioXJGiprUWpRBl8u9NmXJgZD+mu75xj81 XmbPqOePIUeIN3GyuM3kEhdBDsxmI9+BsG9//nTm2slFnUkeGXpLBuDPytelwxj/BR/yC40 GmXHsivs2M3W6aAN/4Oyx3XSK1WSKsb+0sxwlCfbzj7rgzPiZpeY60Usmf8uhKqFOipvNWm iaYHN4MPEct4l+wvYp4QQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Ahc8IbfomGQ=:60kD43os0A5+n075oUNwl2 LiqU0tC/fTJ1hZ+iAq3RnTW2sGZcgtRrZAy+cGNUUwDSXysvAGCGE7ZUjT9wceS0iAED445yv YQJ7Cy1GAMMF1B6NSQNIBqGLCm5UgjchJWJrPJ+w3M0nhdxUQEr2Jyg40fKHRHzHNPU8JmtBP Yae9K2h28Z3CGscz6C1+zVuHtItNkPjD6hv+cdNEG8jWXO87jOpBxyLVS7fb3yFBNoV6vuIDy UiSJzf4uRP0t/40a2Bp3FyNwpbjH8UKcUumY40EnXVM5Kd428CofPISnh5TpAGQ3fDb8q9iEm fKtWYOTghgv/dC/BlMdS36aYvglI8FQX/6kCfp48B1VY9gfYgirw2RYSMTE9A/BStYlld5CVq WiZ3GyYgWTn9zB0uOAU2WU/7w/6AjVXWSHk4i7EK/sUwB0NRGiM+/2vY7+CYe447Q0nH6z9Kr ykvynItrADStqO7p1nR4nm62V8SxBr+DQnwQg4HEpSkWGWCQZVvpOrHWanMAerut/dVza4fpx q9ztSe8897/zEPV6S/UYIY4Sw90qSAU9uumXPot6uni2Fvk9sQJMDnzEDEQXZgQd6sQPGdMq3 M3g4G35RJIjgywjrBp+OP7rDibZHrp3c9WnGIg+UEzgXlZWVaPg+1k4ZKz0jY08/2wS4OSzsW 549Vsv4ka4ndP2ylPN7Zk7Pw4irwQlWNTQIADebI/Ju2BAoesn+1b5LGMN6SkLTkj4qTm2da2 MB40H7Oz8WUXK9TpMnq1cmvGtS3lizCY4P1mNcd953dhTx+8dvSCyiuGfl1bmgOZyhZr0w010 RzIuwvgVNxSFY82rIMhr1b+2va5VYj1cioWy2a3Nkc7MZnuLlgRPr0Vx2Ubb+Mth9BimMET3f i81G76la7pY7GhnubJxuL8e+ThTJjGxJMhXAsy7PBpN9abNpfYg+PQ0jM+3tjjUEf0pvr7WZj HUk1ik5NhHObRrkJLDGw6j0PdlzpdFcg3OtJX6RF0/2vsObfSqi027HOlqjn7u1HTDKzeGtNL Y1QWwq63W008kg53VFkqA1k+zzINK9rCIEKOnXNpYJmuzqjTz4m2Md8Jxo4xBPTVHw2rWlDuB SPn14/7jfrjXrYKpmfHLNY5fN9quNnSmINjQ2k7Xk9QtP5dW7uFyl5lflK5ksoylZEdYIZBDx 5epEeS3kXLECClahhw6UirOcOxLusGQNulFoeGl9yoXbb+a7YrDaP0MRAB2D2VSiOn8hqgmQ/ HJL/xEml1FOUvekyWySaxBYjBV5aTv0YXpR7EjA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191110_225738_249081_1283077A X-CRM114-Status: GOOD ( 12.00 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.18 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (wahrenst[at]gmx.net) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Berger , netdev@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Stefan Wahren MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The register access in bcmgenet_mii_config() is a little bit opaque and not easy to extend. In preparation for the missing RGMII PHY modes move all the phy name assignments into the switch statement and the port register access to the end of the function. This make the code easier to read and extend. Signed-off-by: Stefan Wahren --- drivers/net/ethernet/broadcom/genet/bcmmii.c | 35 +++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index 6f291ee..611a6c0 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -213,11 +213,10 @@ int bcmgenet_mii_config(struct net_device *dev, bool init) udelay(2); } - priv->ext_phy = !priv->internal_phy && - (priv->phy_interface != PHY_INTERFACE_MODE_MOCA); - switch (priv->phy_interface) { case PHY_INTERFACE_MODE_INTERNAL: + phy_name = "internal PHY"; + /* fall through */ case PHY_INTERFACE_MODE_MOCA: /* Irrespective of the actually configured PHY speed (100 or * 1000) GENETv4 only has an internal GPHY so we will just end @@ -229,11 +228,7 @@ int bcmgenet_mii_config(struct net_device *dev, bool init) else port_ctrl = PORT_MODE_INT_EPHY; - bcmgenet_sys_writel(priv, port_ctrl, SYS_PORT_CTRL); - - if (priv->internal_phy) { - phy_name = "internal PHY"; - } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { + if (!phy_name) { phy_name = "MoCA"; bcmgenet_moca_phy_setup(priv); } @@ -242,8 +237,7 @@ int bcmgenet_mii_config(struct net_device *dev, bool init) case PHY_INTERFACE_MODE_MII: phy_name = "external MII"; phy_set_max_speed(phydev, SPEED_100); - bcmgenet_sys_writel(priv, - PORT_MODE_EXT_EPHY, SYS_PORT_CTRL); + port_ctrl = PORT_MODE_EXT_EPHY; /* Restore the MII PHY after isolation */ if (bmcr >= 0) phy_write(phydev, MII_BMCR, bmcr); @@ -261,31 +255,34 @@ int bcmgenet_mii_config(struct net_device *dev, bool init) port_ctrl = PORT_MODE_EXT_RVMII_50; else port_ctrl = PORT_MODE_EXT_RVMII_25; - bcmgenet_sys_writel(priv, port_ctrl, SYS_PORT_CTRL); break; case PHY_INTERFACE_MODE_RGMII: /* RGMII_NO_ID: TXC transitions at the same time as TXD * (requires PCB or receiver-side delay) - * RGMII: Add 2ns delay on TXC (90 degree shift) * * ID is implicitly disabled for 100Mbps (RG)MII operation. */ + phy_name = "external RGMII (no delay)"; id_mode_dis = BIT(16); - /* fall through */ + port_ctrl = PORT_MODE_EXT_GPHY; + break; + case PHY_INTERFACE_MODE_RGMII_TXID: - if (id_mode_dis) - phy_name = "external RGMII (no delay)"; - else - phy_name = "external RGMII (TX delay)"; - bcmgenet_sys_writel(priv, - PORT_MODE_EXT_GPHY, SYS_PORT_CTRL); + /* RGMII_TXID: Add 2ns delay on TXC (90 degree shift) */ + phy_name = "external RGMII (TX delay)"; + port_ctrl = PORT_MODE_EXT_GPHY; break; default: dev_err(kdev, "unknown phy mode: %d\n", priv->phy_interface); return -EINVAL; } + bcmgenet_sys_writel(priv, port_ctrl, SYS_PORT_CTRL); + + priv->ext_phy = !priv->internal_phy && + (priv->phy_interface != PHY_INTERFACE_MODE_MOCA); + /* This is an external PHY (xMII), so we need to enable the RGMII * block for the interface to work */ From patchwork Mon Nov 11 06:55:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11236635 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C3FB139A for ; Mon, 11 Nov 2019 06:57:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E29222459 for ; Mon, 11 Nov 2019 06:57:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fk/DBwUo"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="IzoFprfv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E29222459 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Exm/cFXfi9GlXhPF/RTR+FXX283TSM4NT02VkmQJT7k=; b=fk/DBwUoJvpdiZzuaMeqtLg2l0 y/DlM2jfZ8aqS+K4Xa8lVh68Xx7bBA4s24eXa37gxQhlVKJHq3iz1xbkKbrQ0gzx0fM06F6FjyirX 6iseC7XArPHP8YOBrkW5ucD7D1fYrE802F1bfhsq6oNlZqM5/1G6xwjpH71Jaqb+gABK8U9Gky5JK MvFtOTUG8YJck80a1uC78HvWr4g6qxUXabySRft7jpGxPIH9/SvU5epUDZ0SRZiOaCGYDtFP9/COz t+m7hMfzcgBNUUcvrF8lSzl7f+E1xfNHAGLh9g2zDPEVGO635LCyj62Fu1Y516YVgs6vMShL/X13F XHNpLHbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3e7-0003QA-Fl; Mon, 11 Nov 2019 06:57:55 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3do-0002yE-6b for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 06:57:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573455363; bh=Imoq/wSFMrBBPLNQDLfO722VD00600hqsxm/eoRaikM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=IzoFprfv+223+F9CAdkCL1fPQsVURQw7l2gyTLN+ngxtXQ8miGkleq50GY+bk5by2 gCnicIWRvhPRZEw5oKHHrjUolOC1Vzza7JH4+Dm59DGyG4+A8mKqh1lqaPWcTbqgs6 rV0lmUsW6YFcyUHp8t4w+DcD4MOHZX3/oz3vqjQ8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.112]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MGhyS-1ihr8b1gIs-00DrZJ; Mon, 11 Nov 2019 07:56:03 +0100 From: Stefan Wahren To: Matthias Brugger , Matthias Brugger , "David S . Miller" , Florian Fainelli Subject: [PATCH V4 net-next 6/7] net: bcmgenet: Add RGMII_RXID support Date: Mon, 11 Nov 2019 07:55:40 +0100 Message-Id: <1573455341-22813-7-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> References: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:kNPp966w54VeZ2+FMAstTTYYTOCLGCHBqjQrWRi18NF975uBc6A iT30WGE0l5WPP7ZeZfmscjl6IaRAiN8OuWTOSZdSjxxrOi+brBjzDGbd5dsQxkYdHTNVwW3 9cQ0YOzWZfS4tAhnlkZbbzHIXlNoyUvA9QH4vwChdhf7+WG35qjuUHww/uwGboFujLD+jBu keYltdNqvv5UdOHk7NtJg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Xl7Wvqae/X0=:oPA1wqbZGgNTv/lV8qVoTR iPLHcqbC2K4zYqmYyVAQ6PpEcg989LoUGpcXjZqB/u/pnfwObTj5y5sVPRdcyDL6LdF1baVsS UhD8HiqZTr8O33Vi5VGLtiv1FGcm6CpFWVl7a9zTGgUIaCueo2oQmliilt25UKBqmIDGV7tCP Nzzm/Rmd64qAkXlXORqcJpkEQlMJ6RthsD58YRO4ErbKmlDlWqukN62NSzNr4SzTS4JyZzSG3 peK5fq5lYhpAxb3OXcUDBFCpqbjN89wjZiV98FJ7gFiDxR5UzuG3je+M6ksXSxt4S4j7JBcN3 nC2Vr+na++CXYbzOTd8EAqytZWKiB37GkKrHHRYRLFmeNj/lo6hvlcIbe78FK4P33EhDTVCxg qMHLVsuvCs6DWOBJsigfT8pruJWwxMA8GB6rjdYCnxiWij6TDMJq46j2cskp6T9NDK+lpdb5F vLItd4Sx4/kmyV7ARpPo4OszFk+Jb44SCKfYaHaxKgiN4sJcsDF69ASL7/iWvft281Ehi5BY/ /GcwPkpTJ91othwE0RQkBF67W/r6ywG1MLRQ1Yvw6VZ1de9w3KDOq3kNiRXqNz8fCiyE5A2WX EwyuV6mgB/3oJR/bqa+BT3UKtXaZSHOFI63y/Um1TKh2XycaOg7m77yQoc1zsaVyA5q+PHP2e paJ0Zh70vMWVrDOo9chGjEC8jl/VhhxYVPT9XROLPLrCelJUOGeOayciJuTC+B8untyh2pBqr 9ZApm8V7blrpXXhO4YuGrhFxM3O4870J5wLrXy5sa0vm9MmWfq3Sf1nQdOwEJwu2iQ4qCnbfB Apl8QRXpUnV5xrd3icdIxQ57VC17iFgkQxWinR7mar5AZNKQznYm3oirfWxVA4jkRGhDKaELV jZ32pP6C2ULOCBY1xspW7cbMZETTfk9KQlNuPHre1haJ/7KnZgU8P8urwFZyQQpo8PZyH3Sh8 AuHEPvlbBpUY0ru0GDDOv1zNyvjQe1g9u1Cq1BeHfq1b20k3bvrSZNH9SK2lK1RzTS/TvP07G sutX2TyCUOPCozFMtxznytqm4AF/y+XZsRfqDYeRB/qhnacnayics9VDaaW7ma+D8jsfGqp5D xcVRlwvSqJ33PhJlvHuaC2sJyu0+eO8ipGXRikm/SxkjELiY4FExOeDnQ6qWfIgXoG2Wf0Udf wU0SidL0CGKNu4nW0dDAKPHPokrC11snTDDZYYAt0rZSqneJLfSj24gMWYzFNseFzvKxnpPsh sSmhUuzQwm1vr6xYNaaoJ3gvo1nWNx/6YvS6kww== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191110_225736_548921_CE9E8D4C X-CRM114-Status: UNSURE ( 9.43 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.15 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (wahrenst[at]gmx.net) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Berger , netdev@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Stefan Wahren MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This adds the missing support for the PHY mode RGMII_RXID. It's necessary for the Raspberry Pi 4. Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/net/ethernet/broadcom/genet/bcmmii.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index 611a6c0..80d2f87 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -273,6 +273,11 @@ int bcmgenet_mii_config(struct net_device *dev, bool init) phy_name = "external RGMII (TX delay)"; port_ctrl = PORT_MODE_EXT_GPHY; break; + + case PHY_INTERFACE_MODE_RGMII_RXID: + phy_name = "external RGMII (RX delay)"; + port_ctrl = PORT_MODE_EXT_GPHY; + break; default: dev_err(kdev, "unknown phy mode: %d\n", priv->phy_interface); return -EINVAL; From patchwork Mon Nov 11 06:55:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11236631 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA1FE14E5 for ; Mon, 11 Nov 2019 06:57:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96F2A21928 for ; Mon, 11 Nov 2019 06:57:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e2/qkKOa"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="RApLwqGM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96F2A21928 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Bw8He4WOMPwfPtLw50VeruUJ0TWzit2uLOS++nR6ZWg=; b=e2/qkKOaQ8PUoRgvQZlNxGjH79 8op+1S1FOnyJzxPu+/kaFDr4xHSozyHZEAhsYxCToL/buW+2xDb1oLSKsw6kpT9oN3eYpCI9dnJHl ZTAjHZR+5ihIbFd3d+ye4RjdFpeTfB4VtT1hYKAm+3xgLYCDF6yFu4MNZgc7m5hmLs5+I5qTezhMh 7D6McTo+QTwWLfBLPilcc7OXHhuZEuxfRXwWDN1CgiyYJfeKLLencLYQKHI0cJmv2qvjqUrbh1lOg NOOCGnb9rA/se8aTZ3a/jUPjBV2O9SqZhmXJ2frmuElszp6ukYe5jK7rJwC3EKJjZD1acrBX4BM7Q uh6QnmZw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3di-0002tZ-Cs; Mon, 11 Nov 2019 06:57:30 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU3df-0002sx-GO for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2019 06:57:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573455364; bh=am5k+ShH8U/QfQdyBRZNILtXr6ux5dgQyoLfNDeiNlM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=RApLwqGMk/oF/T5fy2n6Ki38f/8gU1sAmixbHhlw3w1a7r8ohDhQ7v/NqitDChArt qWBhwPankPJZaw0slnTVr3USIkng8xK7WrbVZgRXCMjmVciWkSAisNO549MMRyOWHT KWPcQ0JIfJvg+gfrJaKOH7l0Na5b3BwuY4MLO9hA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.112]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MFKGZ-1ieqKo3hVZ-00FmJG; Mon, 11 Nov 2019 07:56:04 +0100 From: Stefan Wahren To: Matthias Brugger , Matthias Brugger , "David S . Miller" , Florian Fainelli Subject: [PATCH V4 net-next 7/7] ARM: dts: bcm2711-rpi-4: Enable GENET support Date: Mon, 11 Nov 2019 07:55:41 +0100 Message-Id: <1573455341-22813-8-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> References: <1573455341-22813-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:FtYw9AitZ/QWi6w2TJzn4EBO/VhwqWfVGIfXiA4PmfXq1eBy23k muNpAVhuygC+ZOR06igORgZiQv1dAJXdmyX7LtqN8uUZmcGGTjBKRADTPf3vJBnih9tfulD qlP33dILLeEuc1kaQiICvpE3+1knRWBVsMCLY/nYTwlIWbWFOrmgQwTIrZ9QNzOSRQyD1US ZHVZUCSdmV4x7pRIMDgSA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:VEcE/ir0bqg=:JaxsQix5JyZ8OVQ8MCL5dy h+CuFtGAhAaAt67se0yoAFCbDhAz4z/B3qHYexipnRMhOL7yba5WHSFcx0J7DlZn99+ap942t 8QOa2uUYcutnLQlp8fp9xwlzykVx3jg0+bOa2qA7g/58lKlQM7L3q1ZdrGgqldMgKhrpq2qfZ zv1vdURGvJxZhEe/MDFiAxzh5+c1o0Ogag5TJVyH5iZkvFnSqV27xOozh50aiHjDbfi4Jy7zk P+KPswjbW583RA2tz9pD9Uqt3TYY20bEfX/23U813fBimEvk3ggmV11mbGg5WipEhJNPp0JCJ 5S0TCjiEaMGhS7Tv+uXcqXO/cotg7PMBIkRSt02gUbYFoqEjgDZNrZXRUzZ4wSHh1dWbOl/sw qJvx0rN7aEeFPbS+fTLQgHOlUPB4A6uRVLzTh0oSGPpmXs+BgayfD2zrUQJfwkjHU/u862N+M +tT6HC5i6chR2hmoF+E75BxtwFZFPMrNLfVa90nyKKYmo+6cVZr5cXE2mtCm9pa7xaSo49txr 0Hw0wo5AZPojFkQgsraq74smoLrNyFtHX6l42+JO0Qt0C9oDo0CytmFlQF9y8ctbnNFCF4nPm CtIdrKDKB8r6qpS/3EqUID7zxVSIBm5ijfIwaG7Mlhu8L2cnq+cSw6w6t803h16eatJ8VC0ty 1enBFgaUb9KOImqxH50hqC7DW9CGpnkmQq4UTc5clxP+jGdqW+EnCwXzXAAK8Tq/75xe4ORT9 0k7Kv7c9NIdTQ7jjJHlw3Dzv5o3Gs6n2F7qu7fw1Vcugm9RQkL+oEiiyYB9xcRcJ+wqD80ioA mkKPRDPCxgwxklnRqwrlD6RO5H3eS7pzNw3AQPJXE4G6BrKQFFORimgHYCZgEP8T3S2QINYaM tQ0zZE4PU+ncf2kqrNuMQ1befO/hTXZi3MrIyk9zSQCAW/8U0r/vp3O6jnXXX41NAONKrvdxt w64yq1xYtA0matk40zJRd2GdQcYBxX9qsotZm1pzx9E9nyTi2ohbgie/fNekdw2ck9ao9+6Vg YG3idxsdetLUijaq/7UmhfHOVgWzObqO7TCUcPy0tybpEQ3/EXq0KulpNc5Cb7U/9jAux0Nt0 LSTfxxuZSpOl542kSCQ7jVZNJYmhMWTLrbJuHKnWxAPExfxwNoTldvePff2i2N7YcpzkzkUz6 2Tdm0pH9bJ4WZ8+GbUHlDy/CawrSoE8l2/lGuZg9L5WARF94F6Q2BXbHnI9Q4P5D0qBnlIjhx IzsOj9HN3UJ2fwHKH8vsY5DlhIv4JUDLsLyZ1IQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191110_225727_882702_0473C882 X-CRM114-Status: GOOD ( 10.23 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.19 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (wahrenst[at]gmx.net) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Berger , netdev@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org, Stefan Wahren MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This enables the Gigabit Ethernet support on the Raspberry Pi 4. The defined PHY mode is equivalent to the default register settings in the downstream tree. Signed-off-by: Matthias Brugger Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli --- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 17 +++++++++++++++++ arch/arm/boot/dts/bcm2711.dtsi | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) -- 2.7.4 diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index cccc1cc..1b5a835 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -19,6 +19,10 @@ reg = <0 0 0>; }; + aliases { + ethernet0 = &genet; + }; + leds { act { gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; @@ -97,6 +101,19 @@ status = "okay"; }; +&genet { + phy-handle = <&phy1>; + phy-mode = "rgmii-rxid"; + status = "okay"; +}; + +&genet_mdio { + phy1: ethernet-phy@1 { + /* No PHY interrupt */ + reg = <0x1>; + }; +}; + /* uart0 communicates with the BT module */ &uart0 { pinctrl-names = "default"; diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi index ac83dac..a571223 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -305,6 +305,32 @@ cpu-release-addr = <0x0 0x000000f0>; }; }; + + scb { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <1>; + + ranges = <0x0 0x7c000000 0x0 0xfc000000 0x03800000>; + + genet: ethernet@7d580000 { + compatible = "brcm,bcm2711-genet-v5"; + reg = <0x0 0x7d580000 0x10000>; + #address-cells = <0x1>; + #size-cells = <0x1>; + interrupts = , + ; + status = "disabled"; + + genet_mdio: mdio@e14 { + compatible = "brcm,genet-mdio-v5"; + reg = <0xe14 0x8>; + reg-names = "mdio"; + #address-cells = <0x0>; + #size-cells = <0x1>; + }; + }; + }; }; &clk_osc {