From patchwork Mon Jan 23 19:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 13112860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C5B88C38142 for ; Mon, 23 Jan 2023 19:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=Yfn1OXty/7cz8VqdsGkIwLEpnWBmuZXMLD6EG3yqNN4=; b=KrjCTfDNnrSxSt 98I6zCrSxF4bAmn5ElcmPI9jyoFr/QTDhLu+5UTH8L2DfxtV1bsnVYubN4OpZsClZRhb92TyhiVN0 UruHz+zp2s7ynCeeMvjnpYnaUGlfX1iKFU83UDXkLp8UyuFEeUd5EtcXbTh3xUGjtmilAffKMJ25/ kXRNEb7DMOv0j+k271RNqTdGDEn99ZCUiwXKMVu6bjDf91xaaci2hlVvslHqbSl0628ZIH/kJxZY+ 88gxVTsVm4ff+XOTPu2hwnRY71YMCU65GEjCHUYTQ5h28jlt3eobFhNyPQ0FqmWnImcobCyFzs3Lx MUYyiuWVWWdZ031diiaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pK2k8-001CjF-TT; Mon, 23 Jan 2023 19:44:36 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pK2k6-001Cid-1p for linux-arm-kernel@lists.infradead.org; Mon, 23 Jan 2023 19:44:35 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BF88E61013; Mon, 23 Jan 2023 19:44:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0EC0C433EF; Mon, 23 Jan 2023 19:44:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674503071; bh=A3F2Us4U9A9SphSNyF7g028y1yOEU3fnZ7QEfYvsrjI=; h=From:To:Cc:Subject:Date:From; b=YmZahcQ7YATmtCpVikAqDlzvB+0Jv1DUKMWzEiHCecflNDNSDVpCE8MnKKHDEv6V6 xMkWxU7J4auwQetkGo383oQ1bUWg+nfT1aF3+fs7yuJVY2V2+TgHMccxbfrsJ/QVQL EpKC+3KezRhA9hOlL6d+cpBBsgV2ty/qLPPD8LBJkmsDua+hH8LRjcr5IN2rulrbMG kZKsnbaE7O9EXUIBcDKQ7yBjuD64ob1Mai/wgVZozWwGLzMBPlbO9FpLXQksgYXB/p xDgiioaGdc+MfpgfLsyr2FaXif6ClRmFUPcRWY9eqCoVov769PHnHwK0l+PnNAgvlK Hl0Fi5FSmYxKQ== From: Dinh Nguyen To: robh+dt@kernel.org, mark.rutland@arm.com, krzysztof.kozlowski@linaro.org Cc: dinguyen@kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCHv2 1/2] arm64: dts: add pinctrl-single property for Stratix10/Agilex Date: Mon, 23 Jan 2023 13:44:20 -0600 Message-Id: <20230123194421.95315-1-dinguyen@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230123_114434_166513_389608BE X-CRM114-Status: GOOD ( 10.57 ) 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 Stratix10/Agilex has a pin control IP that can make use of the pinctrl-single driver. Add the pinctrl-single dts property for the Stratix10/Agilex platforms. Signed-off-by: Dinh Nguyen --- v2: no changes --- .../arm64/boot/dts/altera/socfpga_stratix10.dtsi | 16 ++++++++++++++++ arch/arm64/boot/dts/intel/socfpga_agilex.dtsi | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi index 55c5e1fdddc7..b488e8d185f3 100644 --- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi @@ -353,6 +353,22 @@ pdma: dma-controller@ffda0000 { reset-names = "dma", "dma-ocp"; }; + pinctrl0: pinctrl@ffd13000 { + compatible = "pinctrl-single"; + reg = <0xffd13000 0xA0>; + #pinctrl-cells = <1>; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0x0000000f>; + }; + + pinctrl1: pinctrl@ffd13100 { + compatible = "pinctrl-single"; + reg = <0xffd13100 0x20>; + #pinctrl-cells = <1>; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0x0000000f>; + }; + rst: rstmgr@ffd11000 { #reset-cells = <1>; compatible = "altr,stratix10-rst-mgr"; diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi index 849b46dd8098..f22302a19796 100644 --- a/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +++ b/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi @@ -357,6 +357,21 @@ pdma: dma-controller@ffda0000 { clock-names = "apb_pclk"; }; + pinctrl0: pinctrl@ffd13000 { + compatible = "pinctrl-single"; + #pinctrl-cells = <1>; + reg = <0xffd13000 0xa0>; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0x0000000f>; + }; + + pinctrl1: pinconf@ffd13100 { + compatible = "pinctrl-single"; + #pinctrl-cells = <1>; + reg = <0xffd13100 0x20>; + pinctrl-single,register-width = <32>; + }; + rst: rstmgr@ffd11000 { #reset-cells = <1>; compatible = "altr,stratix10-rst-mgr"; From patchwork Mon Jan 23 19:44:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 13112859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 58A2DC05027 for ; Mon, 23 Jan 2023 19:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=oYwsiHfroh6V/alyOBv6HLu4yCQFN4SSM5uceq75Wtw=; b=W3aVZL1jL0H3Nz bDpcdTdU7y74pZZJOqhVQ/PROqZu/NasGjtCpda8QdUUK3EcMXXDEneoQNfA3wr6rGJ8Wt6s/0KOC sdlFIM2zc2F4Qchx9MmvLfN5ej1Bp4SnPsGmavPk355nsKD7oQ6uLM2eqL9XpSYfmD+06B8gQfrHl aXns9pO+gaOfB8C52TFB3TUFqmYNiAAj/49f9CrzxAKNVEi/bREfhBGHRXdLK5Sgwq3bMWWiKMRng sFNL/73p6Y70yObUxUR76J9AOzxnM3WuqEXMbXG+WiXUlvJt4WFnOH07S7JxgTuxG1QEr3nlKXpxY 9P3A6W+kVjikkxK15ucQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pK2kG-001Ck8-Cs; Mon, 23 Jan 2023 19:44:44 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pK2k9-001CjE-0s for linux-arm-kernel@lists.infradead.org; Mon, 23 Jan 2023 19:44:38 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7D02DB80E7A; Mon, 23 Jan 2023 19:44:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA34CC433D2; Mon, 23 Jan 2023 19:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674503074; bh=VOEQUr0wbEkh6FSKhmAlE5+/ZJFXs80SLobiQIy6iLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nt3/TkaxiNp0ice0Ko/LxM+mDEyMINhtcBcr8TO79pvsU12++PUgCdSjHLIkM4vdw rA4wz88Yi6+idZ262y4NQqnC00GrYmDDQh4n4J0460k7Ai2g50A92T+QfM86Pu/0OM zr+ixunr+f2srory+RWBAT/h28+Muwka/5WJfIHWSZrw76j+DLXlr1/nvi9u6PdOsl oaRdfKEqypgD6QRAKUlYJGtYc4OyeNFBbOQsjgckQmJQ57QB+j2899inJ/tpoSmwv2 ZVaP4TjdAuKMLvUXIhzQsBPzHRtzA/gNNGufyot8ciRiZNrSkS9RjGIJFR/RfMd7xN smfA09To0tNyA== From: Dinh Nguyen To: robh+dt@kernel.org, mark.rutland@arm.com, krzysztof.kozlowski@linaro.org Cc: dinguyen@kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCHv2 2/2] arm64: dts: stratix10: add i2c pins for pinctrl Date: Mon, 23 Jan 2023 13:44:21 -0600 Message-Id: <20230123194421.95315-2-dinguyen@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123194421.95315-1-dinguyen@kernel.org> References: <20230123194421.95315-1-dinguyen@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230123_114437_227654_56E11D03 X-CRM114-Status: GOOD ( 12.64 ) 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 the I2C pins definition to the Stratix10 devkit. This allows for the I2C driver to use pinctrl on the pins to allow for GPIO recovery. Signed-off-by: Dinh Nguyen --- v2: remove underscores in node names --- .../dts/altera/socfpga_stratix10_socdk.dts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts index 17752ca743e5..38ae674f2f02 100644 --- a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts @@ -65,6 +65,22 @@ sdmmca-ecc@ff8c8c00 { }; }; +&pinctrl0 { + i2c1_pmx_func: i2c1-pmx-func { + pinctrl-single,pins = < + 0x78 0x4 /* I2C1_SDA (IO6-B) PIN30SEL) */ + 0x7c 0x4 /* I2C1_SCL (IO7-B) PIN31SEL */ + >; + }; + + i2c1_pmx_func_gpio: i2c1-pmx-func-gpio { + pinctrl-single,pins = < + 0x78 0x8 /* I2C1_SDA (IO6-B) PIN30SEL) */ + 0x7c 0x8 /* I2C1_SCL (IO7-B) PIN31SEL */ + >; + }; +}; + &gpio1 { status = "okay"; }; @@ -131,6 +147,13 @@ &i2c1 { i2c-sda-falling-time-ns = <890>; /* hcnt */ i2c-sdl-falling-time-ns = <890>; /* lcnt */ + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c1_pmx_func>; + pinctrl-1 = <&i2c1_pmx_func_gpio>; + + scl-gpios = <&portb 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&portb 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + adc@14 { compatible = "lltc,ltc2497"; reg = <0x14>;