Skip to contentSkip to conversation

ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors

PATCH New Peter Robinson 2 participants 5 messages Jul 13, 2018 – May 27, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors

The i2c2 bus has a external plug which enables the easy connection of external "bricks" with sensors of various kinds, while i2c4 on the Extended/Full boards has a pair of on board motion sensors, accelerometer and magnetometer on one chip and gyroscope on another so it makes sense to enable these i2c buses for use. Tested on UDOO Neo Full.

---
 .../arm/boot/dts/imx6sx-udoo-neo-extended.dts |  7 +++++++
 arch/arm/boot/dts/imx6sx-udoo-neo-full.dts    |  7 +++++++
 arch/arm/boot/dts/imx6sx-udoo-neo.dtsi        | 19 +++++++++++++++++++
 3 files changed, 33 insertions(+)
arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts +7 -0
index 42bfc8f8f7f6b..9ef424f48c523 100644
@@ -52,3 +52,10 @@
 		reg = <0x80000000 0x40000000>;
 	};
 };
+
+&i2c4 { /* Onboard Motion sensors */
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c4>;
+	clock-frequency = <100000>;
+	status = "okay";
+};
arch/arm/boot/dts/imx6sx-udoo-neo-full.dts +7 -0
index c84c877f09d49..a3d3b731ac9ed 100644
@@ -67,3 +67,10 @@
 		};
 	};
 };
+
+&i2c4 { /* Onboard Motion sensors */
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c4>;
+	clock-frequency = <100000>;
+	status = "okay";
+};
arch/arm/boot/dts/imx6sx-udoo-neo.dtsi +19 -0
index 53b3eac94f0de..dad8611cc2851 100644
@@ -225,6 +225,13 @@
 	};
 };
 
+&i2c2 { /* Brick snap in sensors connector */
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c2>;
+	clock-frequency = <100000>;
+	status = "okay";
+};
+
 &iomuxc {
 	pinctrl_bt_reg: btreggrp {
 		fsl,pins =
@@ -256,6 +263,18 @@
 			<MX6SX_PAD_GPIO1_IO01__I2C1_SDA		0x4001b8b1>;
 	};
 
+	pinctrl_i2c2: i2c2grp {
+		fsl,pins =
+			<MX6SX_PAD_GPIO1_IO03__I2C2_SDA          0x4001b8b1>,
+			<MX6SX_PAD_GPIO1_IO02__I2C2_SCL          0x4001b8b1>;
+	};
+
+	pinctrl_i2c4: i2c4grp {
+		fsl,pins =
+			<MX6SX_PAD_USB_H_DATA__I2C4_SDA		0x4001b8b1>,
+			<MX6SX_PAD_USB_H_STROBE__I2C4_SCL	0x4001b8b1>;
+	};
+
 	pinctrl_uart1: uart1grp {
 		fsl,pins =
 			<MX6SX_PAD_GPIO1_IO04__UART1_TX		0x1b0b1>,
Signature · 1 line
2.17.1
reviewer
#1 lore raw

PATCH 1/1 ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors

Hi Peter,

arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts line 61

Quoted 6 lines · Peter Robinson

+&i2c4 { /* Onboard Motion sensors */

arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts +5 -0
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c4>;
+       clock-frequency = <100000>;
+       status = "okay";
+};

Would it be possible to add i2c4 to the common dtsi file instead?

I haven't checked the schematics, but if it is only the imx6sx-udoo-neo-basic.dts that does not have the i2c4 node, then maybe you could add i2c4 to the dtsi and disable it inside imx6sx-udoo-neo-basic.dts?

#2 lore raw

PATCH 1/1 ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors

Hi Fabio,

Quoted 11 lines · Fabio Estevam

Hi Peter,

arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts line 61

Quoted 6 lines · Peter Robinson

+&i2c4 { /* Onboard Motion sensors */

arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts +5 -0
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c4>;
+       clock-frequency = <100000>;
+       status = "okay";
+};
Quoted 6 lines

Would it be possible to add i2c4 to the common dtsi file instead?

I haven't checked the schematics, but if it is only the imx6sx-udoo-neo-basic.dts that does not have the i2c4 node, then maybe you could add i2c4 to the dtsi and disable it inside imx6sx-udoo-neo-basic.dts?

Enabling it to turn around and then disable it again seemed counter intuitive to me hence the way I did, the WiFi in done that way even though it's not on all boards and I would imagine it would cause errors on the devices where there isn't wifi although I don't have those model(s) to verify.

Peter

reviewer
#3 lore raw

PATCH 1/1 ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors

Hi Peter,

Quoted 1 line · Peter Robinson

Enabling it to turn around and then disable it again seemed counter

Other option would be to put i2c4 with status = "disabled" in the common file and enable i2c4 on the two dts files that suport it.

Quoted 4 lines

intuitive to me hence the way I did, the WiFi in done that way even though it's not on all boards and I would imagine it would cause errors on the devices where there isn't wifi although I don't have those model(s) to verify.

If the Wifi is not present, then it will not be probed, so it would not cause problems.

#4 lore raw

Hi Fabio,

Quoted 4 lines
Quoted 1 line

Enabling it to turn around and then disable it again seemed counter

Other option would be to put i2c4 with status = "disabled" in the common file and enable i2c4 on the two dts files that suport it.

I've (finally) revisited this again and also got bluetooth working, will send a new series out shortly.

Peter

Quoted 7 lines
Quoted 4 lines

intuitive to me hence the way I did, the WiFi in done that way even though it's not on all boards and I would imagine it would cause errors on the devices where there isn't wifi although I don't have those model(s) to verify.

If the Wifi is not present, then it will not be probed, so it would not cause problems.