ARM: dts: rp1: Add a safe I2C SDA hold time
authorPhil Elwell <phil@raspberrypi.com>
Wed, 31 Jan 2024 17:44:02 +0000 (17:44 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:35 +0000 (11:35 +0000)
Failing to set a reasonable SDA hold time can cause SDA to change too
close to the falling edge of SCL. 300ns is the recommended minimum
interval between the two at 100kHz and 400kHz, and also seems to
work at 1MHz, so use that.

See: https://github.com/raspberrypi/linux/issues/5914

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
arch/arm/boot/dts/broadcom/rp1.dtsi

index 00e5c4c..05e4f7a 100644 (file)
                        clocks = <&rp1_clocks RP1_CLK_SYS>;
                        i2c-scl-rising-time-ns = <65>;
                        i2c-scl-falling-time-ns = <100>;
+                       i2c-sda-hold-time-ns = <300>;
                        status = "disabled";
                };
 
                        clocks = <&rp1_clocks RP1_CLK_SYS>;
                        i2c-scl-rising-time-ns = <65>;
                        i2c-scl-falling-time-ns = <100>;
+                       i2c-sda-hold-time-ns = <300>;
                        status = "disabled";
                };
 
                        clocks = <&rp1_clocks RP1_CLK_SYS>;
                        i2c-scl-rising-time-ns = <65>;
                        i2c-scl-falling-time-ns = <100>;
+                       i2c-sda-hold-time-ns = <300>;
                        status = "disabled";
                };
 
                        clocks = <&rp1_clocks RP1_CLK_SYS>;
                        i2c-scl-rising-time-ns = <65>;
                        i2c-scl-falling-time-ns = <100>;
+                       i2c-sda-hold-time-ns = <300>;
                        status = "disabled";
                };
 
                        clocks = <&rp1_clocks RP1_CLK_SYS>;
                        i2c-scl-rising-time-ns = <65>;
                        i2c-scl-falling-time-ns = <100>;
+                       i2c-sda-hold-time-ns = <300>;
                        status = "disabled";
                };
 
                        clocks = <&rp1_clocks RP1_CLK_SYS>;
                        i2c-scl-rising-time-ns = <65>;
                        i2c-scl-falling-time-ns = <100>;
+                       i2c-sda-hold-time-ns = <300>;
                        status = "disabled";
                };
 
                        clocks = <&rp1_clocks RP1_CLK_SYS>;
                        i2c-scl-rising-time-ns = <65>;
                        i2c-scl-falling-time-ns = <100>;
+                       i2c-sda-hold-time-ns = <300>;
                        status = "disabled";
                };