From patchwork Tue Jun 18 17:31:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 13702797 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 387A1C27C4F for ; Tue, 18 Jun 2024 17:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=6OBs4PindOmgv8UHdb5SG3claVFLiZWM8QbmIIwYyn8=; b=DHji31DiH4dxJ1gCL8akhCrzfs 1lb8/MgaaaiDCQHnXEI9XaojlVeu8wTPQhnrfDZDsD1f8xGWEoMPXFMAJ+ow58+EBjEL8dbLjavXp +b/+mgmuR8bHrqEYdT/ygtoFYCXtkdXnQLuRU3N8qMr6tU13CZ2QyG8I2PMRDM5S0hQKDOF3hapY2 gHM0yvjsqOWlMLDE2TTy5o2mbV3X8RTISgNMAfJ+uX/UKeu+Zxo8bg+TDwtc8CX2zJc+YxmmbDsMs mEShaFXiCuuHvfcnE/DWNORwUhxjrczRgk8R8thmkMBSbZ0Xo6kIq1litR9opTHX4TToRpgbf/4iG ropAxUjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJcg9-0000000G2PE-04VT; Tue, 18 Jun 2024 17:31:33 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJcg5-0000000G2Mg-23d8 for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2024 17:31:31 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45IHVQaR007033; Tue, 18 Jun 2024 12:31:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718731886; bh=6OBs4PindOmgv8UHdb5SG3claVFLiZWM8QbmIIwYyn8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Am2S/ph+sy+iwyjTJqBVAAwqwz/ZAeYKL3y+L06mZpEk//WQJlH4xGATJNSEGRz4d I45sbet+cR9zYkkZEAs5dQwA0q+9cqnVoiCh1VhK6FWKuOvurFKnu0NmFwSan8kWHa r+cKzkW47gy0QgDwKp8D5Vj3VX0VCZcAFM51s4tI= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45IHVQoV042987 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 18 Jun 2024 12:31:26 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 18 Jun 2024 12:31:25 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 18 Jun 2024 12:31:25 -0500 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45IHVPb5043311; Tue, 18 Jun 2024 12:31:25 -0500 From: Nishanth Menon To: Conor Dooley , Krzysztof Kozlowski , Rob Herring CC: , , , Tero Kristo , Vignesh Raghavendra , Nishanth Menon , Vaishnav Achath , Jared McArthur , Bryan Brattlof , Dhruva Gole Subject: [PATCH 2/3] arm64: dts: ti: k3-am62p: Add gpio-ranges properties Date: Tue, 18 Jun 2024 12:31:22 -0500 Message-ID: <20240618173123.2592074-3-nm@ti.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618173123.2592074-1-nm@ti.com> References: <20240618173123.2592074-1-nm@ti.com> MIME-Version: 1.0 Organization: Texas Instruments, Inc. X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240618_103129_656779_2F71CCD7 X-CRM114-Status: GOOD ( 12.04 ) 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 On the AM62P platform we have no single 1:1 relation regarding index of GPIO and pin controller. The GPIOs and pin controller registers have mapping and holes in the map. These have been extracted from the AM62P data sheet. Mux mode input is selected as it is bi-directional. In case a specific pull type or a specific pin level drive setting is desired, the board device tree files will have to explicitly mux those pins for the GPIO with the desired setting. Ref: AM62P Data sheet https://www.ti.com/lit/gpn/am62p Signed-off-by: Nishanth Menon Reviewed-by: Dhruva Gole --- Note: this generates a 'too large' warning for pinctrl-single,gpio-ranges - https://lore.kernel.org/r/20240618165102.2380159-1-nm@ti.com/ for more details arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 14 ++++++++++++++ arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi index eed06506f617..573c85486db1 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi @@ -258,7 +258,17 @@ main_pmx0: pinctrl@f4000 { #pinctrl-cells = <1>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0xffffffff>; + pinctrl-single,gpio-range = + <&main_pmx0_range 0 32 (PIN_INPUT | PIN_GPIO_MUX_MODE)>, + <&main_pmx0_range 33 92 (PIN_INPUT | PIN_GPIO_MUX_MODE)>, + <&main_pmx0_range 137 5 (PIN_INPUT | PIN_GPIO_MUX_MODE)>, + <&main_pmx0_range 143 3 (PIN_INPUT | PIN_GPIO_MUX_MODE)>, + <&main_pmx0_range 149 2 (PIN_INPUT | PIN_GPIO_MUX_MODE)>; bootph-all; + + main_pmx0_range: gpio-range { + #pinctrl-single,gpio-range-cells = <3>; + }; }; main_esm: esm@420000 { @@ -543,6 +553,8 @@ main_gpio0: gpio@600000 { power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 77 0>; clock-names = "gpio"; + gpio-ranges = <&main_pmx0 0 0 32>, <&main_pmx0 32 33 38>, + <&main_pmx0 70 72 22>; }; main_gpio1: gpio@601000 { @@ -560,6 +572,8 @@ main_gpio1: gpio@601000 { power-domains = <&k3_pds 78 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 78 0>; clock-names = "gpio"; + gpio-ranges = <&main_pmx0 0 94 32>, <&main_pmx0 42 137 5>, + <&main_pmx0 47 143 3>, <&main_pmx0 50 149 2>; }; sdhci0: mmc@fa10000 { diff --git a/arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi index b973b550eb9d..a27dd12b44ac 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi @@ -11,7 +11,15 @@ mcu_pmx0: pinctrl@4084000 { #pinctrl-cells = <1>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0xffffffff>; + pinctrl-single,gpio-range = + <&mcu_pmx_range 0 21 (PIN_INPUT | PIN_GPIO_MUX_MODE)>, + <&mcu_pmx_range 23 1 (PIN_INPUT | PIN_GPIO_MUX_MODE)>, + <&mcu_pmx_range 32 2 (PIN_INPUT | PIN_GPIO_MUX_MODE)>; bootph-all; + + mcu_pmx_range: gpio-range { + #pinctrl-single,gpio-range-cells = <3>; + }; }; mcu_esm: esm@4100000 { @@ -137,6 +145,8 @@ mcu_gpio0: gpio@4201000 { power-domains = <&k3_pds 79 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 79 0>; clock-names = "gpio"; + gpio-ranges = <&mcu_pmx0 0 0 21>, <&mcu_pmx0 21 23 1>, + <&mcu_pmx0 22 32 2>; }; mcu_rti0: watchdog@4880000 {