Skip to contentSkip to conversation

J7200: Add I2C support

PATCH Applied Vignesh Raghavendra 4 participants 6 messages Sep 23, 2020 – Sep 24, 2020

Subsystems (2)
lore
Share & tools
lore

Vignesh Raghavendra

author maintainer
#0 lore raw

v2 cover J7200: Add I2C support

Add I2C and I2C IO expanders nodes for J7200

v2:
Align reg address format with that of file's (s/0x0/0x00)

Vignesh Raghavendra (2):
arm64: dts: ti: j7200: Add I2C nodes
arm64: dts: ti: k3-j7200-common-proc-board: Add I2C IO expanders

 .../dts/ti/k3-j7200-common-proc-board.dts     | 49 ++++++++++++
 arch/arm64/boot/dts/ti/k3-j7200-main.dtsi     | 77 +++++++++++++++++++
 .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi      | 33 ++++++++
 3 files changed, 159 insertions(+)
Signature · 1 line
2.28.0
author maintainer
#1 lore raw

PATCH v2 1/2 arm64: dts: ti: j7200: Add I2C nodes

J7200 has 7 I2Cs in main domain, 2 I2Cs in MCU and 1 in wakeup domain. Add DT nodes for the same.

---
 arch/arm64/boot/dts/ti/k3-j7200-main.dtsi     | 77 +++++++++++++++++++
 .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi      | 33 ++++++++
 2 files changed, 110 insertions(+)
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi +77 -0
index 3df49577b06a..f44f0b83d12a 100644
@@ -233,4 +233,81 @@ main_uart9: serial@2890000 {
 		clocks = <&k3_clks 286 2>;
 		clock-names = "fclk";
 	};
+
+	main_i2c0: i2c@2000000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x2000000 0x00 0x100>;
+		interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 187 1>;
+		power-domains = <&k3_pds 187 TI_SCI_PD_SHARED>;
+	};
+
+	main_i2c1: i2c@2010000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x2010000 0x00 0x100>;
+		interrupts = <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 188 1>;
+		power-domains = <&k3_pds 188 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	main_i2c2: i2c@2020000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x2020000 0x00 0x100>;
+		interrupts = <GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 189 1>;
+		power-domains = <&k3_pds 189 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	main_i2c3: i2c@2030000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x2030000 0x00 0x100>;
+		interrupts = <GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 190 1>;
+		power-domains = <&k3_pds 190 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	main_i2c4: i2c@2040000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x2040000 0x00 0x100>;
+		interrupts = <GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 191 1>;
+		power-domains = <&k3_pds 191 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	main_i2c5: i2c@2050000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x2050000 0x00 0x100>;
+		interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 192 1>;
+		power-domains = <&k3_pds 192 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	main_i2c6: i2c@2060000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x2060000 0x00 0x100>;
+		interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 193 1>;
+		power-domains = <&k3_pds 193 TI_SCI_PD_EXCLUSIVE>;
+	};
 };
arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi +33 -0
index ec2745e0768e..a43385d8feca 100644
@@ -92,4 +92,37 @@ wkup_gpio_intr: interrupt-controller2 {
 		ti,sci-dev-id = <137>;
 		ti,interrupt-ranges = <16 960 16>;
 	};
+
+	mcu_i2c0: i2c@40b00000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x40b00000 0x00 0x100>;
+		interrupts = <GIC_SPI 852 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 194 1>;
+		power-domains = <&k3_pds 194 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	mcu_i2c1: i2c@40b10000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x40b10000 0x00 0x100>;
+		interrupts = <GIC_SPI 853 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 195 1>;
+		power-domains = <&k3_pds 195 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	wkup_i2c0: i2c@42120000 {
+		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+		reg = <0x00 0x42120000 0x00 0x100>;
+		interrupts = <GIC_SPI 896 IRQ_TYPE_LEVEL_HIGH>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-names = "fck";
+		clocks = <&k3_clks 197 1>;
+		power-domains = <&k3_pds 197 TI_SCI_PD_SHARED>;
+	};
 };
Signature · 1 line
2.28.0
author maintainer
#2 lore raw

PATCH v2 2/2 arm64: dts: ti: k3-j7200-common-proc-board: Add I2C IO expanders

In reply to Vignesh Raghavendra

Add DT nodes for I2C GPIO expanders on main_i2c0 and main_i2c1 and also add the pinmux corresponding to these I2C instances.

---
 .../dts/ti/k3-j7200-common-proc-board.dts     | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +49 -0
index e27069317c4e..26ad2e46009e 100644
@@ -14,6 +14,22 @@ chosen {
 	};
 };
 
+&main_pmx0 {
+	main_i2c0_pins_default: main-i2c0-pins-default {
+		pinctrl-single,pins = <
+			J721E_IOPAD(0xd4, PIN_INPUT_PULLUP, 0) /* (V3) I2C0_SCL */
+			J721E_IOPAD(0xd8, PIN_INPUT_PULLUP, 0) /* (W2) I2C0_SDA */
+		>;
+	};
+
+	main_i2c1_pins_default: main-i2c1-pins-default {
+		pinctrl-single,pins = <
+			J721E_IOPAD(0xdc, PIN_INPUT_PULLUP, 3) /* (U3) ECAP0_IN_APWM_OUT.I2C1_SCL */
+			J721E_IOPAD(0xe0, PIN_INPUT_PULLUP, 3) /* (T3) EXT_REFCLK1.I2C1_SDA */
+		>;
+	};
+};
+
 &wkup_uart0 {
 	/* Wakeup UART is used by System firmware */
 	status = "disabled";
@@ -62,3 +78,36 @@ &main_uart9 {
 	/* UART not brought out */
 	status = "disabled";
 };
+
+&main_i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_i2c0_pins_default>;
+	clock-frequency = <400000>;
+
+	exp1: gpio@20 {
+		compatible = "ti,tca6416";
+		reg = <0x20>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+
+	exp2: gpio@22 {
+		compatible = "ti,tca6424";
+		reg = <0x22>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+};
+
+&main_i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_i2c1_pins_default>;
+	clock-frequency = <400000>;
+
+	exp4: gpio@20 {
+		compatible = "ti,tca6408";
+		reg = <0x20>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+};
Signature · 1 line
2.28.0
Reviewed-by on the v2 series
#3 lore raw
In reply to Vignesh Raghavendra

Hi,

Quoted 5 lines · Vignesh Raghavendra

Add I2C and I2C IO expanders nodes for J7200

v2:
Align reg address format with that of file's (s/0x0/0x00)

Quoted 9 lines

Vignesh Raghavendra (2):
arm64: dts: ti: j7200: Add I2C nodes
arm64: dts: ti: k3-j7200-common-proc-board: Add I2C IO expanders

 .../dts/ti/k3-j7200-common-proc-board.dts     | 49 ++++++++++++
 arch/arm64/boot/dts/ti/k3-j7200-main.dtsi     | 77 +++++++++++++++++++
 .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi      | 33 ++++++++
 3 files changed, 159 insertions(+)

Thanks,
Faiz

maintainer Applied
#5 lore raw
In reply to Vignesh Raghavendra
Quoted 10 lines · Vignesh Raghavendra

Add I2C and I2C IO expanders nodes for J7200

v2:
Align reg address format with that of file's (s/0x0/0x00)

Vignesh Raghavendra (2):
arm64: dts: ti: j7200: Add I2C nodes
arm64: dts: ti: k3-j7200-common-proc-board: Add I2C IO expanders

[...]

Hi Vignesh Raghavendra,

I have applied the following to branch ti-k3-dts-next on [1]. Thank you!

[1/2] arm64: dts: ti: j7200: Add I2C nodes

      commit: afc0406bd8a797d8d5066e935eb7c098cf9449de
[2/2] arm64: dts: ti: k3-j7200-common-proc-board: Add I2C IO expanders
      commit: ef0b69464cc5182b35e8b4a7b0652f5ccef9c70a

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent up the chain during the next merge window (or sooner if it is a relevant bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/nmenon/linux.git

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D