From 9b42cfa024e3bd413ef74e7b8bb2c73714139285 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 2 Feb 2020 18:48:28 +0000 Subject: [PATCH] Add support for all bcm2711 GPIOs --- ...35-Add-support-for-all-BCM2711-GPIOs.patch | 868 ++++++++++++++++++ kernel.spec | 2 + 2 files changed, 870 insertions(+) create mode 100644 arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch diff --git a/arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch b/arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch new file mode 100644 index 000000000..87ef3d967 --- /dev/null +++ b/arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch @@ -0,0 +1,868 @@ +From patchwork Mon Jan 27 18:15:05 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Stefan Wahren +X-Patchwork-Id: 11353081 +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 E75D71398 + for ; + Mon, 27 Jan 2020 18:15:48 +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 C51652087F + for ; + Mon, 27 Jan 2020 18:15:48 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="boj1KSY/" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C51652087F +Authentication-Results: mail.kernel.org; + dmarc=none (p=none dis=none) header.from=i2se.com +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=vI+2qhhQ/ad2gqCbe5hUTYTYVj8IfAamleiL75V5TSM=; b=boj1KSY/v7nluMqljONFMsrQpY + TIwo7rcohwHGuN2fwWIQvlOtuoNfi2Fq0p3Scukv0Q2ADP7S7q291VcafNnFU5KN1MrzMbRGe4GnM + P3V6kUvf56szm1T1NS1MkTH0UxtSeASAdrde8x8OVZKQoaCTk7UON0PPOY27cnqVlh3c0YEdnjw7O + mqUMZ1W2xfP/jLVZPipZOqiUkCPtyOl7fcUXPVJInCLU8Ap12h/ucwxm6p7sL/miLW+RLo0gKtso8 + vE/Ub+gXij8pNQBcHeQOS3T5w7YYAKX0ckGovHYTGCE5G9DP0PYvWHj2aUr39vu4U7SF87h2rVwQ8 + lsj/6XEg==; +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 1iw8vL-0007qT-4l; Mon, 27 Jan 2020 18:15:47 +0000 +Received: from mout.kundenserver.de ([212.227.126.130]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1iw8vI-0007pK-OI + for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 18:15:46 +0000 +Received: from localhost.localdomain ([37.4.249.152]) by + mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) + id 1MRmwM-1j2Dig1rly-00TAt5; Mon, 27 Jan 2020 19:15:40 +0100 +From: Stefan Wahren +To: Nicolas Saenz Julienne , + Florian Fainelli , + Linus Walleij , Ray Jui , + Scott Branden +Subject: [RFC PATCH 1/4] pinctrl: bcm2835: Drop unused define +Date: Mon, 27 Jan 2020 19:15:05 +0100 +Message-Id: <1580148908-4863-2-git-send-email-stefan.wahren@i2se.com> +X-Mailer: git-send-email 2.7.4 +In-Reply-To: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com> +References: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com> +X-Provags-ID: V03:K1:lGg05mfNcExFSuIdqSja3VB+cOAOOVkxA1mUl+WjJLfuDEYN48s + KCpfgqk9HemEgzwKhTMkYEgexHNzZfeVG5k5xAbv9CDheeQx24pa/Pz7dPaHD9i2zVtcPEX + ugday3kFGFOvKGH3QCW8oxkE91P2/fJaGsnynRzDkoSe3RjqXABLPjZW+febQ6xUrd9aF8p + OvDdu6E+cBesU1loyk22g== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:FBYTcl5hsyU=:/uJXPKY5G3RK2HKm3g2afF + CA5JAlk5ZwkebJLV4bbQfKqE89ChkfNCYzAIhT9SgQhi22RYSBr1LmN//FwU0R3diFEvflVI4 + OPkci48gv0sh+mZnsk9a5fiLs2oAnSh5hggie4G8ZelqhAZ6n4CYEWIp+lz1bo5KPywuZxqek + T8GpkbU4eb/oEicxOhC8lN0DwOFD5W3GliKQ1IpWDarfz8Y9a4d+EgeY0+iBjelJHlfR3e1Q4 + 5TOF82NxXDkBp/4GoxSxM5JDUgoTnPvWCJ7ZFIchyrHbjc5NauAb/4e//OnNTPB8e7bKoOaH2 + HQ6XUp0Da/6crl8QtfuGEbHRAtkNZFJTRdT07zQtpcH89Cqto3IYQ9ND/7ijWcWxu5wb7Ve34 + RPM8gzArJAvou4fFeqPnnHkVmPuq3p5Xua81P7sTqXQN3m5U5RqmH8Lzr8w92FQrloZ2SMe9z + XjYOrjAoxuxpe2x+H3tUoY4PwEgZjz7swAA8BeyYnRzumaAVvQgvNKrW2Qj9V73nKPwgtehvz + hZDfvJgFBHEyfHVj4Fcz+N3r4xFIWS5o2UW5P2M2L2v7bQsckL4EkHWUHSjK5sJhQVDongIHo + /+aJJViGcVBiAGrzvEW2ksFVnPP5X7R2pBxPckyIx3WhJaGzC1OGqA3Wg/a2k08Ewtt7m2DXz + yYvnBfgEsV57VS3aLe8dsbJ2HqKMcqeahm6FQesAnangl4BtG6RH1BMKAaaaMeuJm2DQO+UUA + PELxUMq3dBDAOEuSMNSdvN15BCqDxAajjVLnv+b/+pnKsJ/31p3YVryA78eJ6/kZm1a/DobHg + vNu1QLjbpYkq/WH/K/LaUxt+YpwMi8egvQPLH32zMRACRbsqlMQ7nAGsZtdEkU8zYbp38yV +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20200127_101545_079150_4EC20A38 +X-CRM114-Status: GOOD ( 11.11 ) +X-Spam-Score: 0.0 (/) +X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: + Content analysis details: (0.0 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, + no trust [212.227.126.130 listed in list.dnswl.org] + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record +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: Stefan Wahren , linux-gpio@vger.kernel.org, + bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, + devicetree@vger.kernel.org +MIME-Version: 1.0 +Sender: "linux-arm-kernel" +Errors-To: + linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org + +There is no usage for this define, so drop it. + +Signed-off-by: Stefan Wahren +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +index 0de1a3a..3fc2638 100644 +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -40,9 +40,6 @@ + #define BCM2835_NUM_BANKS 2 + #define BCM2835_NUM_IRQS 3 + +-#define BCM2835_PIN_BITMAP_SZ \ +- DIV_ROUND_UP(BCM2835_NUM_GPIOS, sizeof(unsigned long) * 8) +- + /* GPIO register offsets */ + #define GPFSEL0 0x0 /* Function Select */ + #define GPSET0 0x1c /* Pin Output Set */ + +From patchwork Mon Jan 27 18:15:06 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Stefan Wahren +X-Patchwork-Id: 11353087 +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 D0A70159A + for ; + Mon, 27 Jan 2020 18:16:30 +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 A832D214AF + for ; + Mon, 27 Jan 2020 18:16:30 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="BBcc5MYW" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A832D214AF +Authentication-Results: mail.kernel.org; + dmarc=none (p=none dis=none) header.from=i2se.com +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=zl633DOCOOf5sEmBHgEEmRs3zIL6xCyAbRmQHF/5twU=; b=BBcc5MYWdf7TBI7GF8KvMnZTXP + vwSri+G4Xg+SfQ0x1b4jtd8AwTGL1tYuyopmjQCdIt42APOehPRUttV2YvvQ9suKeJoNobnLxLcBr + zvQYgSNAwt21baLbOyQi0HJWd2BzeIpRw419olVPp37cUGLwE4hpNIv0peCB/6uhTDXyN4YPrXKmW + P7fz/gK+8yj6qz6VZeILYNYiE5DjbkwPSIoD8X/NZhppDvPNCkO3tmD4Z1UQDhMoZNooqIWcGRKIh + umTkq58tIYGNOTccLaKvcW8Elm9ZHK7ssai4uhpgfmL0tId3saEqMuJzSccyqF6ENztpgOra2qWKS + cVX67vMA==; +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 1iw8vz-0008UK-VC; Mon, 27 Jan 2020 18:16:27 +0000 +Received: from mout.kundenserver.de ([212.227.126.135]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1iw8vJ-0007pN-PH + for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 18:15:48 +0000 +Received: from localhost.localdomain ([37.4.249.152]) by + mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) + id 1MdvVu-1jTpmM3Tfy-00b6tv; Mon, 27 Jan 2020 19:15:40 +0100 +From: Stefan Wahren +To: Nicolas Saenz Julienne , + Florian Fainelli , + Linus Walleij , Ray Jui , + Scott Branden +Subject: [RFC PATCH 2/4] pinctrl: bcm2835: Refactor platform data +Date: Mon, 27 Jan 2020 19:15:06 +0100 +Message-Id: <1580148908-4863-3-git-send-email-stefan.wahren@i2se.com> +X-Mailer: git-send-email 2.7.4 +In-Reply-To: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com> +References: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com> +X-Provags-ID: V03:K1:VruPCfmk9mM3xiAf4DG/6aoXzCy4UDEsxr5SC+GDP4iRdgXZX29 + MFCNoD27qBqcSq1LjDl1+NGtNJ3+c1twK3aKoFUdWC05HKxzJPuizB6xDkWYoCIsLzUx75H + HiA0SBUlw/LN+bHlzoczcUQzu+qFL0N3XAwKX9HxzpPzSFwl1lRDgLB6suBZjq4VTFrw6QP + xptjL6VDFkgqBb05XjOfA== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:f2Tec5CMQUc=:niiLUGM7C+e//7RIjf+wMq + wLFHtqjv1ynGaEgrTEwtjnWYqI/r72m4A6fdxd06jGD2Uyp8tpT//zGZgAMatxGP2tJCKPrs8 + H50QvZYrkhyeWT1e/b/43xnEBFcJ26c6kKbSdwNEaPpeQ2pSXrJ+fWFg4rgyr2kyb0a6fODwi + glMJlRcbMvRam6bDw57BliG4DhkYgMl0WB+vE3ztB/xJo+NhTzPKfEpK10WVhz1N+MdOE8gPM + Ed3HaUcq1KYSZvZRKVS8rOnqLfx2aLsXvrn+YKEvs5xzV1w8QpRWEIYZcLOwKvY23kJzQG9eq + MIIG4Or4qhijuBXiW2q6mwUPh2z1lLVKOHwzEHdCAb+4bDlzo8dAxIoc40B0H6ZxVg4/5LHFJ + La0bD0qwfKTemPRPvdCrUGRjVY38hB0RBGSXLrWBfL0PkTsuaEeRZvCVEY80YYfxmOaIKNCZI + KTZTGrVvZWUrz2smObUJlIIzYVznL4L5rWMZjNaLpWxwyNpAg0eDTqVYFmDT+qIxNN4PgQhRy + tSUqMKFEgm7xT/YoZD4jdOe5rJJ0dEmy9DgnlvjmjzCBjXAGdPFrFO9kKivLmdSPaubJ7DdcC + tcrGiqydtDkturFJvTsQYH+PmTQvbe4oBqgNIRZo8f1X5RgRS0fFLp3LA8/+FKUufNNqrLMao + +41TZ2JeFAJBnB9x8z5VMa7EVYvu5Vv7a6UPbF0i7yUPlzFy4OB0vDTMzjH7rW414iarBNvIy + QDypz6a5PwveJ4Fe9ATD7LILVISmcIjM7r29JF4LAmFeYo0lVn6a4kM0PnIwd/wQsax1Rp9/Y + J1/TI8TQICVBl0N9CsxgAPc+X49YqHbFXpoqbsqqK9BIb3Bj+cJJ6Owe9HtjZLb6ifZLnyA +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20200127_101546_108760_0514F0F4 +X-CRM114-Status: GOOD ( 14.77 ) +X-Spam-Score: 0.0 (/) +X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: + Content analysis details: (0.0 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, + no trust [212.227.126.135 listed in list.dnswl.org] + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record +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: Stefan Wahren , linux-gpio@vger.kernel.org, + bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, + devicetree@vger.kernel.org +MIME-Version: 1.0 +Sender: "linux-arm-kernel" +Errors-To: + linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org + +This prepares the platform data to be easier to extend for more GPIOs. +Except of this there is no functional change. + +Signed-off-by: Stefan Wahren +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 57 +++++++++++++++++++++++++++-------- + 1 file changed, 44 insertions(+), 13 deletions(-) + +diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +index 3fc2638..ffd069a 100644 +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -82,6 +82,7 @@ struct bcm2835_pinctrl { + + struct pinctrl_dev *pctl_dev; + struct gpio_chip gpio_chip; ++ struct pinctrl_desc pctl_desc; + struct pinctrl_gpio_range gpio_range; + + raw_spinlock_t irq_lock[BCM2835_NUM_BANKS]; +@@ -1051,7 +1052,7 @@ static const struct pinconf_ops bcm2711_pinconf_ops = { + .pin_config_set = bcm2711_pinconf_set, + }; + +-static struct pinctrl_desc bcm2835_pinctrl_desc = { ++static const struct pinctrl_desc bcm2835_pinctrl_desc = { + .name = MODULE_NAME, + .pins = bcm2835_gpio_pins, + .npins = ARRAY_SIZE(bcm2835_gpio_pins), +@@ -1061,19 +1062,47 @@ static struct pinctrl_desc bcm2835_pinctrl_desc = { + .owner = THIS_MODULE, + }; + +-static struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = { ++static const struct pinctrl_desc bcm2711_pinctrl_desc = { ++ .name = MODULE_NAME, ++ .pins = bcm2835_gpio_pins, ++ .npins = ARRAY_SIZE(bcm2835_gpio_pins), ++ .pctlops = &bcm2835_pctl_ops, ++ .pmxops = &bcm2835_pmx_ops, ++ .confops = &bcm2711_pinconf_ops, ++ .owner = THIS_MODULE, ++}; ++ ++static const struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = { + .name = MODULE_NAME, + .npins = BCM2835_NUM_GPIOS, + }; + ++struct bcm_plat_data { ++ const struct gpio_chip *gpio_chip; ++ const struct pinctrl_desc *pctl_desc; ++ const struct pinctrl_gpio_range *gpio_range; ++}; ++ ++static const struct bcm_plat_data bcm2835_plat_data = { ++ .gpio_chip = &bcm2835_gpio_chip, ++ .pctl_desc = &bcm2835_pinctrl_desc, ++ .gpio_range = &bcm2835_pinctrl_gpio_range, ++}; ++ ++static const struct bcm_plat_data bcm2711_plat_data = { ++ .gpio_chip = &bcm2835_gpio_chip, ++ .pctl_desc = &bcm2711_pinctrl_desc, ++ .gpio_range = &bcm2835_pinctrl_gpio_range, ++}; ++ + static const struct of_device_id bcm2835_pinctrl_match[] = { + { + .compatible = "brcm,bcm2835-gpio", +- .data = &bcm2835_pinconf_ops, ++ .data = &bcm2835_plat_data, + }, + { + .compatible = "brcm,bcm2711-gpio", +- .data = &bcm2711_pinconf_ops, ++ .data = &bcm2711_plat_data, + }, + {} + }; +@@ -1083,6 +1112,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct bcm2835_pinctrl *pc; ++ struct bcm_plat_data *pdata; + struct gpio_irq_chip *girq; + struct resource iomem; + int err, i; +@@ -1108,7 +1138,13 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) + if (IS_ERR(pc->base)) + return PTR_ERR(pc->base); + +- pc->gpio_chip = bcm2835_gpio_chip; ++ match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node); ++ if (!match) ++ return -EINVAL; ++ ++ pdata = (struct bcm_plat_data *)match->data; ++ ++ memcpy(&pc->gpio_chip, pdata->gpio_chip, sizeof(pc->gpio_chip)); + pc->gpio_chip.parent = dev; + pc->gpio_chip.of_node = np; + +@@ -1159,19 +1195,14 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) + return err; + } + +- 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); ++ memcpy(&pc->pctl_desc, pdata->pctl_desc, sizeof(pc->pctl_desc)); ++ pc->pctl_dev = devm_pinctrl_register(dev, &pc->pctl_desc, pc); + if (IS_ERR(pc->pctl_dev)) { + gpiochip_remove(&pc->gpio_chip); + return PTR_ERR(pc->pctl_dev); + } + +- pc->gpio_range = bcm2835_pinctrl_gpio_range; ++ memcpy(&pc->gpio_range, pdata->gpio_range, sizeof(pc->gpio_range)); + pc->gpio_range.base = pc->gpio_chip.base; + pc->gpio_range.gc = &pc->gpio_chip; + pinctrl_add_gpio_range(pc->pctl_dev, &pc->gpio_range); + +From patchwork Mon Jan 27 18:15:07 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Stefan Wahren +X-Patchwork-Id: 11353089 +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 01D8B159A + for ; + Mon, 27 Jan 2020 18:16:42 +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 A3164214AF + for ; + Mon, 27 Jan 2020 18:16:41 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="OgchXKpW" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3164214AF +Authentication-Results: mail.kernel.org; + dmarc=none (p=none dis=none) header.from=i2se.com +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=XmwwFukBgBjwO0LJL+fK3hmGj90hC5ef7Vri1vGrDvw=; b=OgchXKpWUifGHBapyBCQRZf4Oe + Leu+Cl9F+oT35HizJxpDIqWCQOPGA84tYHVdL8DHnOR2sS8sgHpZTWMKe0QSgr3SUuLaQ2diawm04 + B9CSuvfP5yx9MActAPcuhQbMJldRfdt0X+pqyeQf6kaHPaj2JnqRwXWOofaMYeLQwl9zbqEB1B5Ss + FGQnyl0V9sMSPydz6oe5UALnFguup+uWjm3ybTj1yEDhm5vypOqzhTm3vwrvY0CtmPhS3f3vx5F/7 + qNeG7wpGbnUw9b2Ta44QWFyROWbi81UIHkON1Rn1lw/J5gf470beknQM/5fyv2iHMWMVIopDs2Qpo + Jxtt2SIA==; +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 1iw8wC-0000I4-7V; Mon, 27 Jan 2020 18:16:40 +0000 +Received: from mout.kundenserver.de ([212.227.126.135]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1iw8vJ-0007pO-PH + for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 18:15:48 +0000 +Received: from localhost.localdomain ([37.4.249.152]) by + mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) + id 1MIxFi-1jB3PL0sMU-00KPSh; Mon, 27 Jan 2020 19:15:41 +0100 +From: Stefan Wahren +To: Nicolas Saenz Julienne , + Florian Fainelli , + Linus Walleij , Ray Jui , + Scott Branden +Subject: [RFC PATCH 3/4] pinctrl: bcm2835: Add support for all GPIOs on + BCM2711 +Date: Mon, 27 Jan 2020 19:15:07 +0100 +Message-Id: <1580148908-4863-4-git-send-email-stefan.wahren@i2se.com> +X-Mailer: git-send-email 2.7.4 +In-Reply-To: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com> +References: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com> +X-Provags-ID: V03:K1:X6IS1XjHy4cJfxjoudVoDX/cZvMR/vfdQSMdLzkgWq1irgCvB38 + RaAG8s5bLq+gwxv7sq4OOzzzIjMwUf3oUytVqdip8Emtgr3GiNEl2vBd272/sh3B1OJanK8 + goehy07Y9M/B0RMRS8QYkknz5PIlSimkZBJKjNE686UdoJg1We/vhXibKmf8z5kreTjrWe3 + q1JcyYfqP1itQAVjziUtQ== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:LyL94am3zLA=:BmnKGYucrjNaj35BCZWbP5 + JzGddQvqDkhH/CCngNEO2dMwjvlnPKHh/PEbdrGp6m9QHAmq4UkqMbHYKp4XqoYGKvPoozwfP + FP1S21DqEh5BYA0hhWgk2maxuudk085Kg/UXpitwP437bovAei4bfR+gXu53083PnNenJAm4p + xAhXuwmTwnWKv+qAem9IrQUBQtWZqTLIoviS/rBI58lKIF9owSsmboh1lagz+7EGkpnXhcae1 + 0MbckaZUNlfNjiRnq4V+VHRLEiPKWNxiGYMIefuH9JuPr6WXJPFk7fJo8OZ45VvNntUoYSSpc + j0n6iO9I7UbYvyi7+SAmts7a4bZF+1qLxOl9S9cCBKPRGH2Z3kUCuTwNYlPjcUQyn6uqO0Mlx + c+13a6OSMjdDPVRDOntBqI0l4rsK062Ig/ZwiteVVX/T7ZtOdNR2v9sRVAnh/w8iyF4VHZ0GC + ULTnZeoeqfXKRaXEz7sGaOev/A5I1h35g02J5m9TlwjHQiNzKPNc45U2Rab8osp5QUPpRpD1N + 4TUS9baKQp8dfAHyEkc1gBlk0cb1zDcQJMX7bQVUSSxSFx0otQCiojOcWf2PP2Hf1NREQw+82 + UV3Z09N/3ny3u6Qu0dI11Kin/x4ZubPCk2Z9H663jrHUxQP4afxI/ZCeRjqTIpU8chYef1IHT + v3ZX4UpNi6S2kossS/nmFNqzdzxsOnNFseX4lA9Pp5DREJwDVh4t9UFpY49YOKaWkmqBFAAh4 + O7NlyceEWWYXkJh8pRPkdftSVQVKKjtoc+mmNdZ6A/MFCjlN4hQ4NzpeCvIGk1Jp/tUXAyMDV + jBtNPE8cgg54eLvhAbGLfFWVNbu8UAkmntw7HjfU+o9g9ylEQ02IihlbByt5l+e7GdgBJm5 +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20200127_101546_105798_68395F22 +X-CRM114-Status: GOOD ( 17.25 ) +X-Spam-Score: 0.0 (/) +X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: + Content analysis details: (0.0 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, + no trust [212.227.126.135 listed in list.dnswl.org] + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record +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: Stefan Wahren , linux-gpio@vger.kernel.org, + bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, + devicetree@vger.kernel.org +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 supports 58 GPIOs. So extend pinctrl and GPIOs accordingly. + +Signed-off-by: Stefan Wahren +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 54 +++++++++++++++++++++++++++-------- + 1 file changed, 42 insertions(+), 12 deletions(-) + +diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +index ffd069a..41e7bf9 100644 +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -37,6 +37,7 @@ + + #define MODULE_NAME "pinctrl-bcm2835" + #define BCM2835_NUM_GPIOS 54 ++#define BCM2711_NUM_GPIOS 58 + #define BCM2835_NUM_BANKS 2 + #define BCM2835_NUM_IRQS 3 + +@@ -78,7 +79,7 @@ struct bcm2835_pinctrl { + + /* note: locking assumes each bank will have its own unsigned long */ + unsigned long enabled_irq_map[BCM2835_NUM_BANKS]; +- unsigned int irq_type[BCM2835_NUM_GPIOS]; ++ unsigned int irq_type[BCM2711_NUM_GPIOS]; + + struct pinctrl_dev *pctl_dev; + struct gpio_chip gpio_chip; +@@ -145,6 +146,10 @@ static struct pinctrl_pin_desc bcm2835_gpio_pins[] = { + BCM2835_GPIO_PIN(51), + BCM2835_GPIO_PIN(52), + BCM2835_GPIO_PIN(53), ++ BCM2835_GPIO_PIN(54), ++ BCM2835_GPIO_PIN(55), ++ BCM2835_GPIO_PIN(56), ++ BCM2835_GPIO_PIN(57), + }; + + /* one pin per group */ +@@ -203,6 +208,10 @@ static const char * const bcm2835_gpio_groups[] = { + "gpio51", + "gpio52", + "gpio53", ++ "gpio54", ++ "gpio55", ++ "gpio56", ++ "gpio57", + }; + + enum bcm2835_fsel { +@@ -353,6 +362,22 @@ static const struct gpio_chip bcm2835_gpio_chip = { + .can_sleep = false, + }; + ++static const struct gpio_chip bcm2711_gpio_chip = { ++ .label = "pinctrl-bcm2711", ++ .owner = THIS_MODULE, ++ .request = gpiochip_generic_request, ++ .free = gpiochip_generic_free, ++ .direction_input = bcm2835_gpio_direction_input, ++ .direction_output = bcm2835_gpio_direction_output, ++ .get_direction = bcm2835_gpio_get_direction, ++ .get = bcm2835_gpio_get, ++ .set = bcm2835_gpio_set, ++ .set_config = gpiochip_generic_config, ++ .base = -1, ++ .ngpio = BCM2711_NUM_GPIOS, ++ .can_sleep = false, ++}; ++ + static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc, + unsigned int bank, u32 mask) + { +@@ -399,7 +424,7 @@ static void bcm2835_gpio_irq_handler(struct irq_desc *desc) + bcm2835_gpio_irq_handle_bank(pc, 0, 0xf0000000); + bcm2835_gpio_irq_handle_bank(pc, 1, 0x00003fff); + break; +- case 2: /* IRQ2 covers GPIOs 46-53 */ ++ case 2: /* IRQ2 covers GPIOs 46-57 */ + bcm2835_gpio_irq_handle_bank(pc, 1, 0x003fc000); + break; + } +@@ -618,7 +643,7 @@ static struct irq_chip bcm2835_gpio_irq_chip = { + + static int bcm2835_pctl_get_groups_count(struct pinctrl_dev *pctldev) + { +- return ARRAY_SIZE(bcm2835_gpio_groups); ++ return BCM2835_NUM_GPIOS; + } + + static const char *bcm2835_pctl_get_group_name(struct pinctrl_dev *pctldev, +@@ -776,7 +801,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, + err = of_property_read_u32_index(np, "brcm,pins", i, &pin); + if (err) + goto out; +- if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) { ++ if (pin >= pc->pctl_desc.npins) { + dev_err(pc->dev, "%pOF: invalid brcm,pins value %d\n", + np, pin); + err = -EINVAL; +@@ -852,7 +877,7 @@ static int bcm2835_pmx_get_function_groups(struct pinctrl_dev *pctldev, + { + /* every pin can do every function */ + *groups = bcm2835_gpio_groups; +- *num_groups = ARRAY_SIZE(bcm2835_gpio_groups); ++ *num_groups = BCM2835_NUM_GPIOS; + + return 0; + } +@@ -1055,7 +1080,7 @@ static const struct pinconf_ops bcm2711_pinconf_ops = { + static const struct pinctrl_desc bcm2835_pinctrl_desc = { + .name = MODULE_NAME, + .pins = bcm2835_gpio_pins, +- .npins = ARRAY_SIZE(bcm2835_gpio_pins), ++ .npins = BCM2835_NUM_GPIOS, + .pctlops = &bcm2835_pctl_ops, + .pmxops = &bcm2835_pmx_ops, + .confops = &bcm2835_pinconf_ops, +@@ -1063,9 +1088,9 @@ static const struct pinctrl_desc bcm2835_pinctrl_desc = { + }; + + static const struct pinctrl_desc bcm2711_pinctrl_desc = { +- .name = MODULE_NAME, ++ .name = "pinctrl-bcm2711", + .pins = bcm2835_gpio_pins, +- .npins = ARRAY_SIZE(bcm2835_gpio_pins), ++ .npins = BCM2711_NUM_GPIOS, + .pctlops = &bcm2835_pctl_ops, + .pmxops = &bcm2835_pmx_ops, + .confops = &bcm2711_pinconf_ops, +@@ -1077,6 +1102,11 @@ static const struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = { + .npins = BCM2835_NUM_GPIOS, + }; + ++static const struct pinctrl_gpio_range bcm2711_pinctrl_gpio_range = { ++ .name = "pinctrl-bcm2711", ++ .npins = BCM2711_NUM_GPIOS, ++}; ++ + struct bcm_plat_data { + const struct gpio_chip *gpio_chip; + const struct pinctrl_desc *pctl_desc; +@@ -1090,9 +1120,9 @@ static const struct bcm_plat_data bcm2835_plat_data = { + }; + + static const struct bcm_plat_data bcm2711_plat_data = { +- .gpio_chip = &bcm2835_gpio_chip, ++ .gpio_chip = &bcm2711_gpio_chip, + .pctl_desc = &bcm2711_pinctrl_desc, +- .gpio_range = &bcm2835_pinctrl_gpio_range, ++ .gpio_range = &bcm2711_pinctrl_gpio_range, + }; + + static const struct of_device_id bcm2835_pinctrl_match[] = { +@@ -1118,8 +1148,8 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) + 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); ++ BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2711_NUM_GPIOS); ++ BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2711_NUM_GPIOS); + + pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL); + if (!pc) + +From patchwork Mon Jan 27 18:15:08 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Stefan Wahren +X-Patchwork-Id: 11353085 +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 BDFA01398 + for ; + Mon, 27 Jan 2020 18:16:18 +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 9B66F214AF + for ; + Mon, 27 Jan 2020 18:16:18 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="ezMQm6le" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B66F214AF +Authentication-Results: mail.kernel.org; + dmarc=none (p=none dis=none) header.from=i2se.com +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=DPuQWycqdw9CxoKuQR42+vWv5iNmyUIYkTHQf1KLxgY=; b=ezMQm6leJB6R6ZsKnfpCgXjitb + W3Nw1Je9MEi8SZ9v+eC3CeiTFqVt/5x1h0N8bH5ZGdptzjP+SrRIS6oD0h4pJFGg6ugBUnLmcef06 + eNSulzVLTX6qsyPkqj4pRr4fXRyP4R9Om3GidBwWl8vRQ0LLc8ssJkt/K9nW7BslGHjMmEwd+QSiF + t7aYAjYBf45g9TP/aPeAlsgEUzpwNrdiQB0+jY4cWlMTSrz+61Fp9Ay+NopbRoQ+ZY6VHVCHoXwma + eg91Z/Mc359cQ4CBaUn20N4gS5IUc0CMh77YTOYq3QHaJUuO5FR7ARenQTie073XFTCQtrkfCIXeJ + h8y1Bvlw==; +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 1iw8vl-0008F1-HZ; Mon, 27 Jan 2020 18:16:13 +0000 +Received: from mout.kundenserver.de ([212.227.126.134]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1iw8vL-0007pp-4e + for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 18:15:48 +0000 +Received: from localhost.localdomain ([37.4.249.152]) by + mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) + id 1MIdS1-1iqMAq2lZF-00EeIy; Mon, 27 Jan 2020 19:15:41 +0100 +From: Stefan Wahren +To: Nicolas Saenz Julienne , + Florian Fainelli , + Linus Walleij , Ray Jui , + Scott Branden +Subject: [RFC PATCH 4/4] ARM: dts: bcm2711-rpi-4-b: Add SoC GPIO labels +Date: Mon, 27 Jan 2020 19:15:08 +0100 +Message-Id: <1580148908-4863-5-git-send-email-stefan.wahren@i2se.com> +X-Mailer: git-send-email 2.7.4 +In-Reply-To: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com> +References: <1580148908-4863-1-git-send-email-stefan.wahren@i2se.com> +X-Provags-ID: V03:K1:Gxba3mqtzEfAZsLaIh9BPR5KGgNDsOM8n/SyTdefyB0S+Ix6nQ6 + 3ZLcgMmQ0ZYCLRjSx9LHkgciD9ISLplz152G/qC58KgorZhlZLhVE974IeKAkTW7W6RIHig + h04Lium+H3BT4cdz+bIAKz1RoTVdqSRp3Bov22Fv5E4IbNQGvAgEx4Sh7aDH+pVGti//bPm + sxDDXE5ZOXGV0qV3mvozA== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:cCaO9H+V7fw=:e54AxDo4xa1RNP7BrlXkUw + hcxiAvXNAIgIOvr2ULYOCL0TL9NzkdUBAFNQCWXg+9tQt4S1g6hU8gHkciuR6wa+2Cp8Xx5tX + +llHcigXOC2W2A3/H9CyAonFLfN2LtqKP65pY2L50CbaZwjnsBqXhx204sIbiRowV9mxvafPo + t2qbrWIi7u6FIMFVrCPP6wE54WKajQz0y/dLzyYY97zKFvnWCVnVi+wqat0odNyoSPsqVn0bZ + IosK/ArAU/cdn47p/tTAICkZ4LT3Hej8lWbLgs37gDw8DDTbDojBGQNroAepDuL3/RNn+lzON + kdG+mueLFX0OBuSSfviiSheetOwE1yiesBRvOGGH8SPAdosy99GUDu9JWlb+5Nu0T59IQTm7O + Fjvqcu1fiL9L6Qw24XdH9osD6cr2kE4395AH6pP7KLf3KbZClN203u6SfTB9Xw5mAK1mLTOJO + 8C2OC1qX/NFSNffy6qM68jxJ+dRjhB2kyFtiquL5w85hQ9A+0UHh47pQP+vii1XlpE/xYDuRX + VqTiy7fJn8xtcDs0VAoOVnelun1+ppzMdObQpGWaheuA29O4gvaKjA55oKwCw1zzpVOzHmLAg + FhqvMZv3NiqUlLpj85vqbQT9r4U6POpxLorzLyvoarWOy7nvAyVdepSLB7BhbJWwrIbzeiFNd + 2mNR6PTfFZbsMkXdj67sk75MnEgUMjxerASnkhv0xHqQXo/rbdc2HX7fC/1Ft04B1HJextbil + GrPQ6dSPe5SCpjQP6yd9yhLNoaLeNEHpY5Ds0M1hULtqYkJiubORBMvp9H1mmjV7o5UCHqlOW + S9QPe97AN6cfCJGvjb5uYcfneUnc1K0Bj8mmXat9B6fHaxA7pDEsAS1Cy0OgtFjH/t37B1P +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20200127_101547_491226_F9BAEAA0 +X-CRM114-Status: GOOD ( 13.91 ) +X-Spam-Score: 0.0 (/) +X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: + Content analysis details: (0.0 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, + no trust [212.227.126.134 listed in list.dnswl.org] + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record +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: Stefan Wahren , linux-gpio@vger.kernel.org, + bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, + devicetree@vger.kernel.org +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 labels for all the SoC GPIOs on the Raspberry Pi 4. + +Signed-off-by: Stefan Wahren +--- + arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 74 +++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +index 1b5a835..6607e2e 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +@@ -71,6 +71,80 @@ + }; + }; + ++&gpio { ++ /* ++ * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and ++ * the official GPU firmware DT blob. ++ * ++ * Legend: ++ * "NC" = not connected (no rail from the SoC) ++ * "FOO" = GPIO line named "FOO" on the schematic ++ * "FOO_N" = GPIO line named "FOO" on schematic, active low ++ */ ++ gpio-line-names = "ID_SDA", ++ "ID_SCL", ++ "SDA1", ++ "SCL1", ++ "GPIO_GCLK", ++ "GPIO5", ++ "GPIO6", ++ "SPI_CE1_N", ++ "SPI_CE0_N", ++ "SPI_MISO", ++ "SPI_MOSI", ++ "SPI_SCLK", ++ "GPIO12", ++ "GPIO13", ++ /* Serial port */ ++ "TXD1", ++ "RXD1", ++ "GPIO16", ++ "GPIO17", ++ "GPIO18", ++ "GPIO19", ++ "GPIO20", ++ "GPIO21", ++ "GPIO22", ++ "GPIO23", ++ "GPIO24", ++ "GPIO25", ++ "GPIO26", ++ "GPIO27", ++ "RGMII_MDIO", ++ "RGMIO_MDC", ++ /* Used by BT module */ ++ "CTS0", ++ "RTS0", ++ "TXD0", ++ "RXD0", ++ /* Used by Wifi */ ++ "SD1_CLK", ++ "SD1_CMD", ++ "SD1_DATA0", ++ "SD1_DATA1", ++ "SD1_DATA2", ++ "SD1_DATA3", ++ /* Shared with SPI flash */ ++ "PWM0_MISO", ++ "PWM1_MOSI", ++ "STATUS_LED_G_CLK", ++ "SPIFLASH_CE_N", ++ "SDA0", ++ "SCL0", ++ "RGMII_RXCLK", ++ "RGMII_RXCTL", ++ "RGMII_RXD0", ++ "RGMII_RXD1", ++ "RGMII_RXD2", ++ "RGMII_RXD3", ++ "RGMII_TXCLK", ++ "RGMII_TXCTL", ++ "RGMII_TXD0", ++ "RGMII_TXD1", ++ "RGMII_TXD2", ++ "RGMII_TXD3"; ++}; ++ + &pwm1 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>; diff --git a/kernel.spec b/kernel.spec index b5d8cd351..020058a95 100644 --- a/kernel.spec +++ b/kernel.spec @@ -825,6 +825,8 @@ Patch304: ARM-tegra-usb-no-reset.patch Patch310: Raspberry-Pi-4-PCIe-support.patch # https://patchwork.kernel.org/patch/11299997/ Patch312: bcm283x-gpu-drm-v3d-Add-ARCH_BCM2835-to-DRM_V3D-Kconfig.patch +# https://patchwork.kernel.org/cover/11353083/ +Patch313: arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch # Tegra bits Patch320: arm64-tegra-jetson-tx1-fixes.patch