Skip to contentSkip to conversation

arm64: dts: imx8mn-evk: Pass GPIO_OPEN_DRAIN flag on i2c3 GPIOs

PATCH Applied Stefano Radaelli 3 participants 7 messages Oct 15 – Oct 27

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

PATCH 1/1 arm64: dts: imx8mn-evk: Pass GPIO_OPEN_DRAIN flag on i2c3 GPIOs

From: Stefano Radaelli <[email protected]>

scl-gpios and sda-gpios need GPIO_OPEN_DRAIN flag, otherwise the following run-time warning is seen:

gpio-146 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file

---
 arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +2 -2
index 3e590afa4fab..036afa0f6990 100644
@@ -287,8 +287,8 @@ &i2c3 {
 	pinctrl-names = "default", "gpio";
 	pinctrl-0 = <&pinctrl_i2c3>;
 	pinctrl-1 = <&pinctrl_i2c3_gpio>;
-	scl-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
-	sda-gpios = <&gpio5 19 GPIO_ACTIVE_HIGH>;
+	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	status = "okay";
 
 	pca6416: gpio@20 {
Signature · 1 line
2.47.3
#1 lore raw
Quoted 17 lines · Stefano Radaelli

From: Stefano Radaelli <[email protected]>

scl-gpios and sda-gpios need GPIO_OPEN_DRAIN flag, otherwise the following run-time warning is seen:

gpio-146 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file

---
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +0 -0
index 3e590afa4fab..036afa0f6990 100644

arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi &i2c3 { · line 291

Quoted 7 lines
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +2 -2
@@ -287,8 +287,8 @@ &i2c3 {
 	pinctrl-names = "default", "gpio";
 	pinctrl-0 = <&pinctrl_i2c3>;
 	pinctrl-1 = <&pinctrl_i2c3_gpio>;
-	scl-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
-	sda-gpios = <&gpio5 19 GPIO_ACTIVE_HIGH>;
+	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

I think ODE should be configured for pinctrl_i2c3_gpio.

Regards
Peng

Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +0 -0
 	status = "okay";
 
 	pca6416: gpio@20 {
Signature · 1 line
2.47.3
#2 lore raw
Quoted 28 lines · Peng Fan
Quoted 17 lines · Stefano Radaelli

From: Stefano Radaelli <[email protected]>

scl-gpios and sda-gpios need GPIO_OPEN_DRAIN flag, otherwise the following run-time warning is seen:

gpio-146 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file

---
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +0 -0
index 3e590afa4fab..036afa0f6990 100644

arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi &i2c3 { · line 291

Quoted 7 lines
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +2 -2
@@ -287,8 +287,8 @@ &i2c3 {
 	pinctrl-names = "default", "gpio";
 	pinctrl-0 = <&pinctrl_i2c3>;
 	pinctrl-1 = <&pinctrl_i2c3_gpio>;
-	scl-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
-	sda-gpios = <&gpio5 19 GPIO_ACTIVE_HIGH>;
+	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

I think ODE should be configured for pinctrl_i2c3_gpio.

Quoted 2 lines

Regards
Peng

Hi Peng,

I followed the same approach used in commit 2b1d5d054d29e08926f05cfa30e34d149644585e, as well as in the other i.MX DTS files that use GPIO_OPEN_DRAIN for I2C bus recovery.

Even in imx8mn-evk.dtsi itself, I2C2 uses the same configuration, with GPIO_OPEN_DRAIN specified in the GPIO properties and without ODE enabled in the pinctrl.

Wouldn't introducing a different configuration for I2C3 create some inconsistency and potentially cause confusion?

If enabling ODE in the pinctrl is the preferred approach, wouldn't it make more sense to address this in a separate follow-up patch, updating the existing I2C recovery pinctrl configurations consistently across the affected DTS files?

What do you think?

Best Regards,
Stefano

#3 lore raw
Quoted 45 lines · Stefano Radaelli
Quoted 28 lines · Peng Fan
Quoted 17 lines · Stefano Radaelli

From: Stefano Radaelli <[email protected]>

scl-gpios and sda-gpios need GPIO_OPEN_DRAIN flag, otherwise the following run-time warning is seen:

gpio-146 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file

---
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +0 -0
index 3e590afa4fab..036afa0f6990 100644

arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi &i2c3 { · line 291

Quoted 7 lines
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +2 -2
@@ -287,8 +287,8 @@ &i2c3 {
 	pinctrl-names = "default", "gpio";
 	pinctrl-0 = <&pinctrl_i2c3>;
 	pinctrl-1 = <&pinctrl_i2c3_gpio>;
-	scl-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
-	sda-gpios = <&gpio5 19 GPIO_ACTIVE_HIGH>;
+	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

I think ODE should be configured for pinctrl_i2c3_gpio.

Quoted 2 lines

Regards
Peng

Hi Peng,

I followed the same approach used in commit 2b1d5d054d29e08926f05cfa30e34d149644585e, as well as in the other i.MX DTS files that use GPIO_OPEN_DRAIN for I2C bus recovery.

Even in imx8mn-evk.dtsi itself, I2C2 uses the same configuration, with GPIO_OPEN_DRAIN specified in the GPIO properties and without ODE enabled in the pinctrl.

Wouldn't introducing a different configuration for I2C3 create some inconsistency and potentially cause confusion?

Quoted 6 lines

If enabling ODE in the pinctrl is the preferred approach, wouldn't it make more sense to address this in a separate follow-up patch, updating the existing I2C recovery pinctrl configurations consistently across the affected DTS files?

What do you think?

w/o GPIO_OPEN_DRAIN, there is risk that GPIO emulated I2C is not using open drain mode.

Enabling ODE in pad will not make the warning disappear (:, so still need the flag.

It is fine to add the flag in your path.

I will fixes all the wrong usage for the GPIO I2C pad settings.

Regards
Peng

Quoted 5 lines

Best Regards,
Stefano

Reviewed-by
#5 lore raw
Quoted 11 lines · Peng Fan
Quoted 8 lines · Stefano Radaelli

From: Stefano Radaelli <[email protected]>

scl-gpios and sda-gpios need GPIO_OPEN_DRAIN flag, otherwise the following run-time warning is seen:

gpio-146 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file

After reading the gpiolib and i2c-core-base code, it is ok to just set the flag for scl/sda-gpios. It is not a must update PAD with ODE for Linux.

#6 lore raw
In reply to Stefano Radaelli

From: Frank Li <[email protected]>

Quoted 4 lines · Stefano Radaelli

scl-gpios and sda-gpios need GPIO_OPEN_DRAIN flag, otherwise the following run-time warning is seen:

gpio-146 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file

Applied to imx/dt-intend, will see in linux-next after v7.4-rc1, thanks!

[1/1] arm64: dts: imx8mn-evk: Pass GPIO_OPEN_DRAIN flag on i2c3 GPIOs

      commit: c68b3adfc4bcc4bbb0e6c4b65263eeeee4c37b97

Best regards,
--
Frank Li <[email protected]>