From patchwork Mon Jan 23 19:27:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 13112851 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 0BB3FC05027 for ; Mon, 23 Jan 2023 19:29:14 +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=Kh/E+uKXtwRjqMPIdtbI+eKRMX1ngVHhgfGw68afXIY=; b=t+eJoe/LaiGdxX KUvQWqXVNKZieF6LwV1fsCGHsXpFP4Hspd8uH63yiJ57UlOJnGW74nPRvbLRveRMe91BUrEcoygJD 9mFxFyXuigqzHX5eC8dZuRXKDyEgJbjpC2bQHhBObzXdA/zAjVyPOcGOgEEnti37cEDaYHPY5mbJU li26Ily5kVciCzI9D60+un+QW5qQmfn+pM2J/Hfg/Nt72oEYKsbicAA8KbvwzCvyFrwJEqmOzOxD7 je9D8Oa7Ox6IeLc0/aOKOLeMnY9nGnpBF6QZWc9VKDWQVh69wVfB4Uye1fxbW090oyFq7QFO4B6ue EWYeHaXt9jdH9x4im1UQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pK2Tl-001Abx-1O; Mon, 23 Jan 2023 19:27:41 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pK2Th-001AaM-SR for linux-arm-kernel@lists.infradead.org; Mon, 23 Jan 2023 19:27:39 +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 0B38061016; Mon, 23 Jan 2023 19:27:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3A6AC433EF; Mon, 23 Jan 2023 19:27:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674502051; bh=gN7dGTSGQ84b3lMvbLQkJHVM/lyRHLz0LB7y7N9w5nI=; h=From:To:Cc:Subject:Date:From; b=l4zcAqjnoY51f08wiAEUnRjkxxxR2Y+FxXauJ6GOxDSlxBskqGKdl4BVE6etH6xSD +4JTca8ESu/AHzsu9JwVCTD8Uk12vazLt6eFXxJToMX4zkl43PVFUbaDI0bR1xi+Eh lDBx0GSm4VlJzV7GA57IPpUnZhWZ2U5pafDyl7Sus3sfyu8tc6ualetwx3H5o0IXc9 Zzml3Hau/1jTbwq2TiSJuInvK7Xv9ZPZ517ZmCmG8u6EnHsyFzEggzF2N5uq0cKWFk 6/r1AKckzpXYGmLjmYLCI7Bblt0WYtPpyIdMf8wFBHSd0cH3eS1j/65qZgXJ3CXAJe uPACb8hGkxgGw== 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: [PATCH 1/2] arm64: dts: add pinctrl-single property for Stratix10/Agilex Date: Mon, 23 Jan 2023 13:27:11 -0600 Message-Id: <20230123192712.84537-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_112737_999521_EB05F38E X-CRM114-Status: GOOD ( 10.87 ) 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 --- .../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:27:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 13112850 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 E500DC38142 for ; Mon, 23 Jan 2023 19:28:56 +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=umLDobBdL6y9GhmXRmBDSm8OVNMevVkayejHkRL3YWM=; b=ozqu/ZZTbT4cva utv634iIPk5M45p0XwMXydTlkvp/rWMCy9o6JN/Mgefmg4+UWDkRlrU93pov6WUiqhKItB7FLG0FQ HJBqCNCX5w+p/bFoOYOW1WszSPwUQIMAMsuF5AWCBwAjNbRKvT5ksOxnxFuzvlJ5E05wKeyrQQ3Pn zEBuPnkv0ni9BR4DtR0WOdUVXlPFfNcTeXDmSWuK9WpsUJ3JxKglDWwvoZOlGKKjiD1T9W3Ux1w/4 q74TTV7q1PJsLw6my3ZP1gvAkHEev20p/k4aWUGMCiEApZDC+pdCUNOHfLQI69n5Y4kKy6+OiLcgI GE5dH0UeC9Zqv9S77XIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pK2Tu-001Adu-1Z; Mon, 23 Jan 2023 19:27:50 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pK2Tr-001Acv-6j for linux-arm-kernel@lists.infradead.org; Mon, 23 Jan 2023 19:27:48 +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 4DB84B80DCC; Mon, 23 Jan 2023 19:27:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31174C433EF; Mon, 23 Jan 2023 19:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674502055; bh=iHUFBzI7vwSyFrXPgj6xKsiimjzcAXL3MD7/sNnMm90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I/WglcTIJ2/ruypkn4L/jlvObxSyJsMoDHUuwojvWO0s9skNXJ3stboc2NwpvzTuy jehv+yN3edGctD2K83FPjQyi3YyzXrQ3aWbKvlnwYgVqyc9WKjiLtj4pTo1WidNOno Thiihn4p9pwqTSC4Amq11a1VV69RoeB2F8EJ71v+7f6jwvitwppayWVRNSBAFWlFh+ GWHzxsuv43v5RSJkBWjvsx1y5U5MGSadtboUQJWcxNyQbmsmYpxiS3Eb4Fg9Xv6rzC PZnwum3yfeU+7mJ5UQZiOirOmW3yO2TEUjGky0vdM7i7w/CxJJgSalkoBeSztL2Xvp tiMKTtJWFOjNQ== 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: [PATCH 2/2] arm64: dts: stratix10: add i2c pins for pinctrl Date: Mon, 23 Jan 2023 13:27:12 -0600 Message-Id: <20230123192712.84537-2-dinguyen@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123192712.84537-1-dinguyen@kernel.org> References: <20230123192712.84537-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_112747_415422_B32F1D26 X-CRM114-Status: GOOD ( 12.95 ) 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 --- .../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..beda04b9380b 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>;