mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Conor Dooley <conor+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Tero Kristo <kristo@kernel.org>,
	Vaishnav Achath <vaishnav.a@ti.com>,
	Jared McArthur <j-mcarthur@ti.com>, Bryan Brattlof <bb@ti.com>,
	Dhruva Gole <d-gole@ti.com>, Nishanth Menon <nm@ti.com>
Subject: [PATCH V2 2/3] arm64: dts: ti: k3-am62p: Add gpio-ranges properties
Date: Thu, 27 Jun 2024 11:25:38 -0500	[thread overview]
Message-ID: <20240627162539.691223-3-nm@ti.com> (raw)
In-Reply-To: <20240627162539.691223-1-nm@ti.com>

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.

MCU pinctrl definition is shared as it is common between AM62P and
J722S, but that is not the case for main domain.

Ref: AM62P Data sheet https://www.ti.com/lit/gpn/am62p

Signed-off-by: Nishanth Menon <nm@ti.com>
---
Changes since V1:
 - Use PIN_GPIO_RANGE_IOPAD instead of PIN_GPIO_MUX_MODE
 - Refactored on top of next-20240626 (new common files)
 - Since the patch had to be refactored as well as new define used, I
   have skipped picking up Dhruva's Reviewed-by.

V1: https://lore.kernel.org/linux-arm-kernel/20240618173123.2592074-3-nm@ti.com/

 .../boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi  |  8 ++++++++
 arch/arm64/boot/dts/ti/k3-am62p-main.dtsi       | 17 +++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi
index 1d4e5fc8b4e0..e65db6ce02bf 100644
--- a/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi
@@ -12,7 +12,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_GPIO_RANGE_IOPAD>,
+			<&mcu_pmx_range 23 1 PIN_GPIO_RANGE_IOPAD>,
+			<&mcu_pmx_range 32 2 PIN_GPIO_RANGE_IOPAD>;
 		bootph-all;
+
+		mcu_pmx_range: gpio-range {
+			#pinctrl-single,gpio-range-cells = <3>;
+		};
 	};
 
 	mcu_esm: esm@4100000 {
diff --git a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi
index f8a7f0cbd327..57383bd2eaeb 100644
--- a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi
@@ -42,10 +42,27 @@ &inta_main_dmss {
 	ti,interrupt-ranges = <5 69 35>;
 };
 
+&main_pmx0 {
+	pinctrl-single,gpio-range =
+		<&main_pmx0_range 0 32 PIN_GPIO_RANGE_IOPAD>,
+		<&main_pmx0_range 33 92 PIN_GPIO_RANGE_IOPAD>,
+		<&main_pmx0_range 137 5 PIN_GPIO_RANGE_IOPAD>,
+		<&main_pmx0_range 143 3 PIN_GPIO_RANGE_IOPAD>,
+		<&main_pmx0_range 149 2 PIN_GPIO_RANGE_IOPAD>;
+
+	main_pmx0_range: gpio-range {
+		#pinctrl-single,gpio-range-cells = <3>;
+	};
+};
+
 &main_gpio0 {
+	gpio-ranges = <&main_pmx0 0 0 32>, <&main_pmx0 32 33 38>,
+			<&main_pmx0 70 72 22>;
 	ti,ngpio = <92>;
 };
 
 &main_gpio1 {
+	gpio-ranges = <&main_pmx0 0 94 32>, <&main_pmx0 42 137 5>,
+			<&main_pmx0 47 143 3>, <&main_pmx0 50 149 2>;
 	ti,ngpio = <52>;
 };
-- 
2.43.0


  parent reply	other threads:[~2024-06-27 16:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 16:25 [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: " Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 1/3] arm64: dts: ti: k3-pinctrl: Define a generic GPIO MUX Mode Nishanth Menon
2024-06-27 16:25 ` Nishanth Menon [this message]
2024-06-27 16:25 ` [PATCH V2 3/3] arm64: dts: ti: k3-j722s: Add gpio-ranges properties Nishanth Menon
2024-07-03  4:35 ` [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: " Vignesh Raghavendra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240627162539.691223-3-nm@ti.com \
    --to=nm@ti.com \
    --cc=bb@ti.com \
    --cc=conor+dt@kernel.org \
    --cc=d-gole@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=j-mcarthur@ti.com \
    --cc=kristo@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=vaishnav.a@ti.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®