From patchwork Sat May 8 14:19:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kettenis X-Patchwork-Id: 12246077 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-22.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3581C433ED for ; Sat, 8 May 2021 14:23:47 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 6EFEC61001 for ; Sat, 8 May 2021 14:23:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EFEC61001 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=openbsd.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=za/vzF6R5RiY75AfbyH5uoNpDNRPuos7pCDSAuMAmdM=; b=Unvow14DUZSvWBGpcRIsrpJxq Unxe8W+CgNJ4zcK82WsYYPE/vOlcT5/xry58fhqkgn0pwpN/7hbpdRSrmv2sbKTaeiwjZd0xgSWCH KBI4kMhPHUA0F2LS7PWb/RhE9macKaWlae0IKCXEttMzI0bN4QCueQILgVCo1/ZpxBKqwgOx1ZNM1 9pmWZK4NUz5H8V1CgZbqOn/cmPEj0Jwti95nn1vv9jpRKAvi2dyEJJiwHt5VE8+kwoLgS3VpK2q70 Mvfk062ZnPnbLpbfVwfoWKmt3uJZOlLmCQikOuTgerg1UP7J+SsxnVwUB/kAmfbWbX9jTYhYbbE2/ 4ZcJ8smlw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfNqN-009hYp-K8; Sat, 08 May 2021 14:22:12 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfNq3-009hWG-Mh for linux-arm-kernel@desiato.infradead.org; Sat, 08 May 2021 14:21:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=mlLITEVIX1J2CrUaps2vNBRMgMLRcJToUJxuWV7RQus=; b=aVD+q+G2mAVO5EbWpXb+vylVa3 KSc75XXUA2KxbfxY5cribQk3Zt5Gt7f39d8vdRxw++H8RAfGapVXkFaQx4ccHOE/tHkFX89rRFlJR D+MQO3Oqon7QfPqDXjk79w2EAHidXJu374x+0LYiS0Tsg1wsp5pW/xLPHHeXxNjmFqSaS70jJLnab I96QDYjI2omh/pg1FruwXitGzIPcFuSqej3JyY2AF/u96SFUklog9ugaxcqNa3SLcRDDAGQusj3Ii WpCkpfGMorU5Dc0VsJdhYAvsGyM4waV32LYV7iTKZjOQm54TZdzBnno7YUphO1Fvlxi+y3Gm5bqRm SG1JhSFg==; Received: from lb1-smtp-cloud7.xs4all.net ([194.109.24.24]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfNpy-007ahr-Or for linux-arm-kernel@lists.infradead.org; Sat, 08 May 2021 14:21:50 +0000 Received: from copland.sibelius.xs4all.nl ([83.163.83.176]) by smtp-cloud7.xs4all.net with ESMTP id fNoalDe3DyEWwfNomlAKKF; Sat, 08 May 2021 16:20:33 +0200 From: Mark Kettenis To: devicetree@vger.kernel.org Cc: Mark Kettenis , Hector Martin , Linus Walleij , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple,pinctrl Date: Sat, 8 May 2021 16:19:55 +0200 Message-Id: <20210508142000.85116-2-kettenis@openbsd.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210508142000.85116-1-kettenis@openbsd.org> References: <20210508142000.85116-1-kettenis@openbsd.org> MIME-Version: 1.0 X-CMAE-Envelope: MS4xfJbBo0WR8jeK3a86fYGKdaBC75+g5JT/G3Gl4amapTK5Rr69w2wT+p6ejBp4gUyFHR3/l1QzJvmajoCcEyLsti4apB2M7k5sE7uzuy4oT9ooKUTBkg6I y8HeKLApG382pioLX6mQSGlaKhPxOqZbMHDRIaqklb7tpwvqF9blqa1VPH71rB3XpoIfEk8lNhT94vTIwmHCBcc4fFlVjPcqOJeH5SWNDQcbGIzFwHitXMVJ oOMZrr3BG+Fev5SVpL7Sq1xmDg44HKyBbGV+EaEINs8OR9yYoR7OczbyqbJc97KVPVGfWdhf4OQLiLaIiuali5nncRn1GMeEhGI3yUBqX4O8yCBZEjW+XJ4U F1ZbzAjvAZB2xOxRVLpSotJe9IduDSuoH7josdzpfIwhy8/Ggi6wMP6XOI0Ex6EOiEpceUhozirV725DMsU5/tMjVXCVh01sBH3igCuf4ojhAnmAhCKRkSCh wvxdHtXQqsruqm8k X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210508_072146_976150_475194A8 X-CRM114-Status: GOOD ( 15.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Apple GPIO controller is a simple combined pin and GPIO conroller present on Apple ARM SoC platforms, including various iPhone and iPad devices and the "Apple Silicon" Macs. Signed-off-by: Mark Kettenis --- .../bindings/pinctrl/apple,pinctrl.yaml | 103 ++++++++++++++++++ MAINTAINERS | 2 + include/dt-bindings/pinctrl/apple.h | 13 +++ 3 files changed, 118 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml create mode 100644 include/dt-bindings/pinctrl/apple.h diff --git a/Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml new file mode 100644 index 000000000000..cc7805ca6ba1 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml @@ -0,0 +1,103 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/apple,pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple GPIO controller + +maintainers: + - Mark Kettenis + +description: | + The Apple GPIO controller is a simple combined pin and GPIO conroller + present on Apple ARM SoC platforms, including various iPhone and iPad + devices and the "Apple Silicon" Macs. + +properties: + compatible: + items: + - const: apple,t8103-pinctrl + - const: apple,pinctrl + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + gpio-controller: true + + '#gpio-cells': + const: 2 + + gpio-ranges: + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 7 + + interrupt-controller: true + +patternProperties: + '-pins$': + type: object + $ref: pinmux-node.yaml# + + properties: + pinmux: + description: + Values are constructed from pin number and alternate function + configuration number using the APPLE_PINMUX() helper macro + defined in include/dt-bindings/pinctrl/apple.h. + + required: + - pinmux + + additionalProperties: false + +required: + - compatible + - reg + - gpio-controller + - '#gpio-cells' + - gpio-ranges + +additionalProperties: false + +examples: + - | + #include + #include + + soc { + #address-cells = <2>; + #size-cells = <2>; + + pinctrl: pinctrl@23c100000 { + compatible = "apple,t8103-pinctrl", "apple,pinctrl"; + reg = <0x2 0x3c100000 0x0 0x100000>; + clocks = <&gpio_clk>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 0 212>; + + interrupt-controller; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + + pcie_pins: pcie-pins { + pinmux = , + , + ; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index ad0e9be66885..7327c9b778f1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1654,9 +1654,11 @@ C: irc://chat.freenode.net/asahi-dev T: git https://github.com/AsahiLinux/linux.git F: Documentation/devicetree/bindings/arm/apple.yaml F: Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml +F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml F: arch/arm64/boot/dts/apple/ F: drivers/irqchip/irq-apple-aic.c F: include/dt-bindings/interrupt-controller/apple-aic.h +F: include/dt-bindings/pinctrl/apple.h ARM/ARTPEC MACHINE SUPPORT M: Jesper Nilsson diff --git a/include/dt-bindings/pinctrl/apple.h b/include/dt-bindings/pinctrl/apple.h new file mode 100644 index 000000000000..ea0a6f466592 --- /dev/null +++ b/include/dt-bindings/pinctrl/apple.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ OR MIT */ +/* + * This header provides constants for Apple pinctrl bindings. + */ + +#ifndef _DT_BINDINGS_PINCTRL_APPLE_H +#define _DT_BINDINGS_PINCTRL_APPLE_H + +#define APPLE_PINMUX(pin, func) ((pin) | ((func) << 16)) +#define APPLE_PIN(pinmux) ((pinmux) & 0xffff) +#define APPLE_FUNC(pinmux) ((pinmux) >> 16) + +#endif /* _DT_BINDINGS_PINCTRL_APPLE_H */ From patchwork Sat May 8 14:19:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kettenis X-Patchwork-Id: 12246075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EC84C433ED for ; Sat, 8 May 2021 14:23:35 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 BBCFA61152 for ; Sat, 8 May 2021 14:23:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBCFA61152 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=openbsd.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UpMJ9xZFkb/E7udA6wK5F3JzyqUdL0rmEmegSgR+2xI=; b=FsNp2OIOKGEtiec5jL+kCTviF jjXBOkhBNZghfiyELP0scfQng2LW2i8eQV1hV6xQLmSz7mQUmN2OZRgIm0qiJFI5VUlPaGlpkOMRd Dc+hVTu+yI6w8M8inqnbQuxtTMUuRFYwxybNqK5Q4uzJCBmCMkyPO1xf4nRAhKG6l2WBcNbT66O+1 MSHtVyVXiXEDB0kANSZDpCZCLXdKeXwUSO2P8nNCK87GE0Frjbj2debOrmZbTtjF/e9l90S2unh2f OrkG4+77FDkGbO+eFpNoNzx8iSbJJ6vbyi47WZnayq3UC8Nuz0xQucnxb+gvL2ZoEOCGU2sNrC4k+ pCQgd7PKw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfNqB-009hXK-J3; Sat, 08 May 2021 14:21:59 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfNpv-009hVj-Vg for linux-arm-kernel@desiato.infradead.org; Sat, 08 May 2021 14:21:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=U9zR7AnZH0on6HjgVShYM4f4ckWaYksbeFILAhNlk3o=; b=3vuF2Q8//GykwgEuozVjpbXx/s 16Myi6eMjOeljCeWBETegXKRGmddJ2ki7av84dpGfCF2dcbfEa0fLPFuPMg8KN1fiIP9o3xBibh0L vflEdcA1Eh+n+ZBxCx0lJEY9hdukSCuIIUQY5lQXDcyaTAvPz26yFqWOiY7M+xscn3i96Npbppinq nNDJg5J6+RCKUyaFRvXlTRE1TQ3xwv18Cl7ERa05OfKsWD/9jwbuWXdqvgleW1rzWAh6suB1RSsNq bHZ/al1GA9Dcruyuk6pf1yc/fMc9lzM6C/tuiEFsGMuFTNx4OgaEYPVctyVVYr2StAaRlAwAIkTow mFwrP/NA==; Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfNpt-007aiS-5H for linux-arm-kernel@lists.infradead.org; Sat, 08 May 2021 14:21:42 +0000 Received: from copland.sibelius.xs4all.nl ([83.163.83.176]) by smtp-cloud7.xs4all.net with ESMTP id fNoalDe3DyEWwfNoslAKLA; Sat, 08 May 2021 16:20:39 +0200 From: Mark Kettenis To: devicetree@vger.kernel.org Cc: Mark Kettenis , Hector Martin , Linus Walleij , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] arm64: apple: Add pinctrl nodes Date: Sat, 8 May 2021 16:19:56 +0200 Message-Id: <20210508142000.85116-3-kettenis@openbsd.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210508142000.85116-1-kettenis@openbsd.org> References: <20210508142000.85116-1-kettenis@openbsd.org> MIME-Version: 1.0 X-CMAE-Envelope: MS4xfAyluYZHFpNZjlq+A5zPoFVB/AwwVNe0wvSw18aJIBxgBIUO298752rbLucgpSok4Vum8QYFd4IORCZ8HQveGjpnARYVzMlLdOmvpkKMFpPbHr7qpi3m BMt7KcEh9BSJOqIHkeQF193a0dg1mxcma66oWeR739sE+A3QUDVgBUb1Sc4HQ+xz9cSEN3AJreLEN4YR1cN8gNpT69rJq568u4oWi4HJAFyBoDhWajS+GG/g xQgRnuur0BF3D7zYqLYmZ2LWNS597TQpam/mecxzpRUWz9/GnW4Z4dWb9d979QeFYdQf+wNdeENJxQWLtrU3yO2mRgglJlY5BdoDx5/qeVjX+1cPEPWly4W+ tZKft8NKKgdXr07sP4jHk8SBO6HqTkKHJzxTpMffeZcljg2B+VFbcbX5zmvKRiiAToV6JcuKVGY5RvcOH1yqFDwvfR6PNagBrjpU42Ea0Joo2hdiv7oIyamZ eDyKK1jNTnAwuadP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210508_072141_361622_42FA8225 X-CRM114-Status: GOOD ( 10.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add pinctrl nodes corresponding to the gpio,t8101 nodes in the Apple device tree for the Mac mini (M1, 2020). Clock references are left out at the moment and will be added once the appropriate bindings have been settled upon. Signed-off-by: Mark Kettenis --- arch/arm64/boot/dts/apple/t8103.dtsi | 83 ++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi index a1e22a2ea2e5..503a76fc30e6 100644 --- a/arch/arm64/boot/dts/apple/t8103.dtsi +++ b/arch/arm64/boot/dts/apple/t8103.dtsi @@ -9,6 +9,7 @@ #include #include +#include / { compatible = "apple,t8103", "apple,arm-platform"; @@ -131,5 +132,87 @@ aic: interrupt-controller@23b100000 { interrupt-controller; reg = <0x2 0x3b100000 0x0 0x8000>; }; + + pinctrl_ap: pinctrl@23c100000 { + compatible = "apple,t8103-pinctrl", "apple,pinctrl"; + reg = <0x2 0x3c100000 0x0 0x100000>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_ap 0 0 212>; + + interrupt-controller; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + + pcie_pins: pcie-pins { + pinmux = , + , + ; + }; + }; + + pinctrl_aop: pinctrl@24a820000 { + compatible = "apple,t8103-pinctrl", "apple,pinctrl"; + reg = <0x2 0x4a820000 0x0 0x4000>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_aop 0 0 42>; + + interrupt-controller; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + }; + + pinctrl_nub: pinctrl@23d1f0000 { + compatible = "apple,t8103-pinctrl", "apple,pinctrl"; + reg = <0x2 0x3d1f0000 0x0 0x4000>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_nub 0 0 23>; + + interrupt-controller; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + }; + + pinctrl_smc: pinctrl@23e820000 { + compatible = "apple,t8103-pinctrl", "apple,pinctrl"; + reg = <0x2 0x3e820000 0x0 0x4000>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl_smc 0 0 16>; + + interrupt-controller; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + }; }; };