From patchwork Mon Jul 22 06:23:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11051673 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 36A6B912 for ; Mon, 22 Jul 2019 06:24:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23677283AD for ; Mon, 22 Jul 2019 06:24:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 177EB28524; Mon, 22 Jul 2019 06:24: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 C21B928511 for ; Mon, 22 Jul 2019 06:24:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbfGVGYA (ORCPT ); Mon, 22 Jul 2019 02:24:00 -0400 Received: from mout.gmx.net ([212.227.17.22]:40479 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfGVGX7 (ORCPT ); Mon, 22 Jul 2019 02:23:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563776616; bh=C/BKlEwyumlArmwD/E6wgYAWdwQ1Y8+GdUItO4AwDB8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=OF7ORH1kF6/Jm6qRQVl13FGHOStoa4RCDp0c8+GTv9hJDPuD8BCHtSoWiB18kGngM gRvPEOfcQOuwo7lRhSSLb0qsOV6ylGZtc1PJ1jeMBjudXmLmkB61zhXboD6sOVJEkF vr9Zg/OVlPCx1pPMG4yMBMtulAET3WX3VdCAStlA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.98]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LlGoc-1iOE3F3Eco-00b2gg; Mon, 22 Jul 2019 08:23:35 +0200 From: Stefan Wahren To: Eric Anholt , Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Matthias Brugger , Rob Herring , Mark Rutland , Linus Walleij , Michael Turquette , Stephen Boyd , Ulf Hansson , Adrian Hunter Cc: bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-mmc@vger.kernel.org, Stefan Wahren Subject: [PATCH 10/18] mmc: sdhci-iproc: Add support for emmc2 of the BCM2711 Date: Mon, 22 Jul 2019 08:23:23 +0200 Message-Id: <1563776607-8368-1-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K1:GxIuRAwNwjQ8P41WK7RQ/jyBcX+5REqGD0yM69ZZYhZQaHNsw7q EaToozX93r4CKrb3WTg2CUJz3UBqmlifhGylbY5Im3SzMrQn5BTJhL01pFO5RAfv0gmFJKm 9rX7TpJnETIl1e6XJv2U11q4XdPjsOG18MPswiTv8InzARGumCVTtFlWubXLSlRv+NZr26M 6Vv17Byc488qhwM0Qk5lA== X-UI-Out-Filterresults: notjunk:1;V03:K0:+GtNzptVxGY=:YCCTEBW68gIi4LhAv/5Nwm cvvvKUl6h7apzwQMmuZPq2cNyteRgKStyl4yDNYwViCjPdrLYJvBtx3x6BybQiLXec8FAjaAb hwkzHG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-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The additional emmc2 interface of the BCM2711 is an improved version of the old emmc controller, which is able to provide DDR50 mode on the Raspberry Pi 4. Except 32 bit only register access no other quirks are known yet. Signed-off-by: Stefan Wahren Reviewed-by: Matthias Brugger --- drivers/mmc/host/sdhci-iproc.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.7.4 diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c index 2feb4ef..2b9cdcd 100644 --- a/drivers/mmc/host/sdhci-iproc.c +++ b/drivers/mmc/host/sdhci-iproc.c @@ -261,8 +261,17 @@ static const struct sdhci_iproc_data bcm2835_data = { .mmc_caps = 0x00000000, }; +static const struct sdhci_pltfm_data sdhci_bcm2711_pltfm_data = { + .ops = &sdhci_iproc_32only_ops, +}; + +static const struct sdhci_iproc_data bcm2711_data = { + .pdata = &sdhci_bcm2711_pltfm_data, +}; + static const struct of_device_id sdhci_iproc_of_match[] = { { .compatible = "brcm,bcm2835-sdhci", .data = &bcm2835_data }, + { .compatible = "brcm,bcm2711-emmc2", .data = &bcm2711_data }, { .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_cygnus_data}, { .compatible = "brcm,sdhci-iproc", .data = &iproc_data }, { } From patchwork Mon Jul 22 06:23:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11051671 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 F0F236C5 for ; Mon, 22 Jul 2019 06:24:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDFDB283AD for ; Mon, 22 Jul 2019 06:24:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D135128524; Mon, 22 Jul 2019 06:24:00 +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 7CCBA28563 for ; Mon, 22 Jul 2019 06:24:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726364AbfGVGYA (ORCPT ); Mon, 22 Jul 2019 02:24:00 -0400 Received: from mout.gmx.net ([212.227.17.22]:36443 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbfGVGX7 (ORCPT ); Mon, 22 Jul 2019 02:23:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563776616; bh=p7EuEN+WXnzmcDfw8Q5gWYTDfwT+rrLjIA0t4iR5+DU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Fs7+OVDivi+bxt7RG4MgsXL9iMFsdsFLsu8M/Ofw0D3bG2jayz7C5BLqxT0Jz7ChV xfSd9tEIGIK0/QkidlIkkj75mePWfRAai0gs2I1knyTADe0T6oKDWoRHiy6gawpFiA JqIYS6XbhH7MFrv06OwjEF/7cW4bl9/PpAgNiDvo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.98]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MaV3V-1i8uWX2ZBZ-00KCgz; Mon, 22 Jul 2019 08:23:36 +0200 From: Stefan Wahren To: Eric Anholt , Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Matthias Brugger , Rob Herring , Mark Rutland , Linus Walleij , Michael Turquette , Stephen Boyd , Ulf Hansson , Adrian Hunter Cc: bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-mmc@vger.kernel.org, Stefan Wahren Subject: [PATCH 11/18] dt-bindings: pinctrl: bcm2835: Add brcm,bcm2711 compatible Date: Mon, 22 Jul 2019 08:23:24 +0200 Message-Id: <1563776607-8368-2-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1563776607-8368-1-git-send-email-wahrenst@gmx.net> References: <1563776607-8368-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:L6MvCiJSUEBAg1rTPB7ACRbeRDXsOwcCOZcjaEYDTpcasQM/U5z 3+lW4tcXkM8Ok5cyjtm399i4Fiin6mdeNhwTW8WSrDg4LkG9sXABaWVT7PNX5VjBaS2Oe+m qfJNByhfka/+Pn7gu74tdiZ60bAd+LH3IleO0W+0Rr1Ut2+3yAGprJDmJMjKR+1P54l7v2I DFjYVlyuh3cTv0FNKCGIg== X-UI-Out-Filterresults: notjunk:1;V03:K0:MJTh9r2apxo=:iwLc9ZJ3pv2oOMTOXOcVge I9yPnQoAGYB7VvLujM0XRTWRzYaDGW4JBSR/9CVMI/KP9szSSAFVsF1IFFeJXqD0Sc60mwSLF BwO4AhkEUbvo4tdx/7dhG780XfC9wNkSE4Hld9prwxaZW7Mw6+coZBi6pfxmRKDB8PEI++dy+ SXHt9d9A2jTwY1k7xamdHOBDkgrxVIaywxHvImhzCxx82RvZCAg7xgb2faAVHLUMF45Jp41Ap B97Y8dBBk43dejfqln2C8iKdbH04YnTxzARdUZInRacl6JyO5px44kJhG9meTJ7zXISls5mhB Xw7gAwZF65p7eqhhM8ELp3lRE4omt8XCrXWmxgO2H0j1edeKFdZ4QWBLYw000UoL8LmSxD6ia c19xye46n7nWEE/bCuXPgYrepKyZlmaz0YZHUZ9E+tru35fOm1gMZk+Dj0r0Mc9mO1O1Fey64 fVZMwREad/Pko4gXl3mSeVzECi/GUNn+UPASk8yJXUY1mP8Vh6wnkefdWVomTtGsu7aa+fSLb JzWLq2hYWAMYLQRW3ioihAQVgsp+2EoZwKiEg/AIB1JY9UbRjPg3+RLNGS9eDWTIHF1cpoPVC HaNrIqDL9YBxl9pTmk6V2jRAwqsHe+LpwXPH20Ug5VzWstd3tMbbO+U9twwVBAuLW2t1LRZY9 2f1nS2+UWqCRgKTpyyP5mYjShHKzpOcn11lUomyoDj261j6AotDFCGIHnasTbOjXAvoDXqMfi DcyYFJYLj1a4AnFBZ5tr89H/HZy3xNrjWiaxKEEW7furQ9U9kS8pUGVsD7qW4n2a2cS22d0T/ CPveiO/8mgjF6ApfsVWCuFZn84if6SmqUewB1Yrv93ZZpsgMOcLgU0H/iiOVGUh5GtHHKKDca w0ySOjNFi2LKkRF4iwQHJe6DQuOi42H9Sou+fQmkm0nDCBPa4WtCfTmQSHDbS/zquaTXcUzP3 B8qwWJMDZGekfEmnBIf2OvFDQ38pjdb3XOOeCP37b+VyYD13j66Zgtq28LamiEbwlnyZgWcuv OmbTgKBzmetHA/mjgkR5vpNQF6ShB88cLDK19LNIiImiTVfVeX9/35OwHVMfwCUr5CpRp3elI sshxoWksxyjM38= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new compatible for the BCM2711. Signed-off-by: Stefan Wahren --- Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt index ac6d614..3cab733 100644 --- a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt @@ -8,6 +8,7 @@ Required properties: - compatible: should be one of: "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl + "brcm,bcm2711-gpio" - BCM2711 compatible pinctrl - reg: Should contain the physical address of the GPIO module's registers. - gpio-controller: Marks the device node as a GPIO controller. - #gpio-cells : Should be two. The first cell is the pin number and the From patchwork Mon Jul 22 06:23:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11051677 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 ABF0814F6 for ; Mon, 22 Jul 2019 06:24:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96A83283AD for ; Mon, 22 Jul 2019 06:24:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A35528511; Mon, 22 Jul 2019 06:24:02 +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 042E4283AD for ; Mon, 22 Jul 2019 06:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726762AbfGVGYB (ORCPT ); Mon, 22 Jul 2019 02:24:01 -0400 Received: from mout.gmx.net ([212.227.17.21]:44721 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfGVGYB (ORCPT ); Mon, 22 Jul 2019 02:24:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563776617; bh=z18lzCFKYvrFVHVAu6EYGbfVShdzolb5W7gum8yzyTw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=PMdr0Xs/BDri+k3ruvU8E9f/PTmshqM6ZbByqU7iwcn/Dy/nXqizy9VAvnSXbE4Ld c6S6qO0zAsM7gJtOwYOMZCW7Dh+aFAwq1bwafDg0YjXgeO5SL0JwHJzx2vLHyPFzbU 5jn8oAn2ygsdSWwzmq8YDJGK5e8hvYoUtBOn4OfM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.98]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M7UUd-1ib4501cDX-00xMvP; Mon, 22 Jul 2019 08:23:37 +0200 From: Stefan Wahren To: Eric Anholt , Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Matthias Brugger , Rob Herring , Mark Rutland , Linus Walleij , Michael Turquette , Stephen Boyd , Ulf Hansson , Adrian Hunter Cc: bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-mmc@vger.kernel.org, Stefan Wahren Subject: [PATCH 12/18] pinctrl: bcm2835: Add support for BCM2711 pull-up functionality Date: Mon, 22 Jul 2019 08:23:25 +0200 Message-Id: <1563776607-8368-3-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1563776607-8368-1-git-send-email-wahrenst@gmx.net> References: <1563776607-8368-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1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CeYJSaFftVcpOmyzA3 peIniS1wwXbIwqqTh/P+bQ+4y5PI6uVqx15Ybui2mxcpmAAKjqm18a0PDSpSnCgGZzG/NTD00 CK1FUG534G4vdRQqDWMUH/ig0wFPpigA+4/bhccyAzCXgNGx5iW8eQe79OICo9aHbevl6cd4Y egwG3kZmUSJANPU/XJ+1J5Wyk/MMczykf86G7QJwBS2ayvQsCn9WkyNLxvHQJyyvDxJZ+jJnr hH4tQ/kOqMDkjgOnjFE1ooBF8PoYt/Ig+NNcjH70tcZ0W/N0Y+PPqd0DqXZb73nUV1LtQnq5X ODTtmZY0TNorNQ= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The BCM2711 has a new way of selecting the pull-up/pull-down setting for a GPIO pin. The registers used for the BCM2835, GP_PUD and GP_PUDCLKn0, are no longer connected. A new set of registers, GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add a new compatible string "brcm,bcm2711-gpio" and the kernel driver will use it to select which method is used to select pull-up/pull-down. This patch based on a patch by Al Cooper which was intended for the BCM7211. This is a bugfixed and improved version. Signed-off-by: Stefan Wahren --- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 105 ++++++++++++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 183d1ff..a493205 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -57,15 +57,24 @@ #define GPAFEN0 0x88 /* Pin Async Falling Edge Detect */ #define GPPUD 0x94 /* Pin Pull-up/down Enable */ #define GPPUDCLK0 0x98 /* Pin Pull-up/down Enable Clock */ +#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 2711 Pin Pull-up/down select */ #define FSEL_REG(p) (GPFSEL0 + (((p) / 10) * 4)) #define FSEL_SHIFT(p) (((p) % 10) * 3) #define GPIO_REG_OFFSET(p) ((p) / 32) #define GPIO_REG_SHIFT(p) ((p) % 32) +#define PUD_2711_MASK 0x3 +#define PUD_2711_REG_OFFSET(p) ((p) / 16) +#define PUD_2711_REG_SHIFT(p) (((p) % 16) * 2) + /* argument: bcm2835_pinconf_pull */ #define BCM2835_PINCONF_PARAM_PULL (PIN_CONFIG_END + 1) +#define BCM2711_PULL_NONE 0x0 +#define BCM2711_PULL_UP 0x1 +#define BCM2711_PULL_DOWN 0x2 + struct bcm2835_pinctrl { struct device *dev; void __iomem *base; @@ -975,6 +984,77 @@ static const struct pinconf_ops bcm2835_pinconf_ops = { .pin_config_set = bcm2835_pinconf_set, }; +static void bcm2711_pull_config_set(struct bcm2835_pinctrl *pc, + unsigned int pin, unsigned int arg) +{ + u32 shifter; + u32 value; + u32 off; + + off = PUD_2711_REG_OFFSET(pin); + shifter = PUD_2711_REG_SHIFT(pin); + + value = bcm2835_gpio_rd(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 + (off * 4)); + value &= ~(PUD_2711_MASK << shifter); + value |= (arg << shifter); + bcm2835_gpio_wr(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 + (off * 4), value); +} + +static int bcm2711_pinconf_set(struct pinctrl_dev *pctldev, + unsigned int pin, unsigned long *configs, + unsigned int num_configs) +{ + struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); + u32 param, arg; + int i; + + for (i = 0; i < num_configs; i++) { + param = pinconf_to_config_param(configs[i]); + arg = pinconf_to_config_argument(configs[i]); + + switch (param) { + /* convert legacy brcm,pull */ + case BCM2835_PINCONF_PARAM_PULL: + if (arg == BCM2835_PUD_UP) + arg = BCM2711_PULL_UP; + else if (arg == BCM2835_PUD_DOWN) + arg = BCM2711_PULL_DOWN; + else + arg = BCM2711_PULL_NONE; + + bcm2711_pull_config_set(pc, pin, arg); + break; + + /* Set pull generic bindings */ + case PIN_CONFIG_BIAS_DISABLE: + bcm2711_pull_config_set(pc, pin, BCM2711_PULL_NONE); + break; + case PIN_CONFIG_BIAS_PULL_DOWN: + bcm2711_pull_config_set(pc, pin, BCM2711_PULL_DOWN); + break; + case PIN_CONFIG_BIAS_PULL_UP: + bcm2711_pull_config_set(pc, pin, BCM2711_PULL_UP); + break; + + /* Set output-high or output-low */ + case PIN_CONFIG_OUTPUT: + bcm2835_gpio_set_bit(pc, arg ? GPSET0 : GPCLR0, pin); + break; + + default: + return -ENOTSUPP; + } + } /* for each config */ + + return 0; +} + +static const struct pinconf_ops bcm2711_pinconf_ops = { + .is_generic = true, + .pin_config_get = bcm2835_pinconf_get, + .pin_config_set = bcm2711_pinconf_set, +}; + static struct pinctrl_desc bcm2835_pinctrl_desc = { .name = MODULE_NAME, .pins = bcm2835_gpio_pins, @@ -990,6 +1070,18 @@ static struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = { .npins = BCM2835_NUM_GPIOS, }; +static const struct of_device_id bcm2835_pinctrl_match[] = { + { + .compatible = "brcm,bcm2835-gpio", + .data = &bcm2835_pinconf_ops, + }, + { + .compatible = "brcm,bcm2711-gpio", + .data = &bcm2711_pinconf_ops, + }, + {} +}; + static int bcm2835_pinctrl_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -997,6 +1089,8 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) struct bcm2835_pinctrl *pc; struct resource iomem; int err, i; + const struct of_device_id *match; + BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2835_NUM_GPIOS); BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2835_NUM_GPIOS); @@ -1073,6 +1167,12 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) bcm2835_gpio_irq_handler); } + match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node); + if (match) { + bcm2835_pinctrl_desc.confops = + (const struct pinconf_ops *)match->data; + } + pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc); if (IS_ERR(pc->pctl_dev)) { gpiochip_remove(&pc->gpio_chip); @@ -1087,11 +1187,6 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) return 0; } -static const struct of_device_id bcm2835_pinctrl_match[] = { - { .compatible = "brcm,bcm2835-gpio" }, - {} -}; - static struct platform_driver bcm2835_pinctrl_driver = { .probe = bcm2835_pinctrl_probe, .driver = {