[PATCH v2] arm64: dts: rockchip: Adjust the HDMI DDC IO driver strength for rk3588

Andy Yan posted 1 patch 6 months, 3 weeks ago
.../dts/rockchip/rk3588-base-pinctrl.dtsi     | 20 +++++------
.../dts/rockchip/rk3588-extra-pinctrl.dtsi    |  5 +--
.../boot/dts/rockchip/rockchip-pinconf.dtsi   | 35 +++++++++++++++++++
3 files changed, 48 insertions(+), 12 deletions(-)
[PATCH v2] arm64: dts: rockchip: Adjust the HDMI DDC IO driver strength for rk3588
Posted by Andy Yan 6 months, 3 weeks ago
From: Andy Yan <andy.yan@rock-chips.com>

For the RK3588 HDMI controller, the falling edge of DDC SDA and SCL
almost coincide and cannot be adjusted by HDMI registrer, resulting
in poor compatibility of DDC communication.

An improvement of the compatibility of DDC can be done by increasing
the driver strength of SCL and decreasing the driver strength of SDA
to increase the slope of the falling edge.

It should be noted that the maximum driving strength of hdmim0_tx1_scl
is only 3, which is different from that of the other IOs.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

---

Changes in v2:
- Correct the max drive level of hdmim0_tx1_scl.

 .../dts/rockchip/rk3588-base-pinctrl.dtsi     | 20 +++++------
 .../dts/rockchip/rk3588-extra-pinctrl.dtsi    |  5 +--
 .../boot/dts/rockchip/rockchip-pinconf.dtsi   | 35 +++++++++++++++++++
 3 files changed, 48 insertions(+), 12 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi
index 7f874c77410c..6584d73660f6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi
@@ -578,14 +578,14 @@ hdmim0_tx0_hpd: hdmim0-tx0-hpd {
 		hdmim0_tx0_scl: hdmim0-tx0-scl {
 			rockchip,pins =
 				/* hdmim0_tx0_scl */
-				<4 RK_PB7 5 &pcfg_pull_none>;
+				<4 RK_PB7 5 &pcfg_pull_none_drv_level_5_smt>;
 		};
 
 		/omit-if-no-ref/
 		hdmim0_tx0_sda: hdmim0-tx0-sda {
 			rockchip,pins =
 				/* hdmim0_tx0_sda */
-				<4 RK_PC0 5 &pcfg_pull_none>;
+				<4 RK_PC0 5 &pcfg_pull_none_drv_level_1_smt>;
 		};
 
 		/omit-if-no-ref/
@@ -640,14 +640,14 @@ hdmim1_tx0_hpd: hdmim1-tx0-hpd {
 		hdmim1_tx0_scl: hdmim1-tx0-scl {
 			rockchip,pins =
 				/* hdmim1_tx0_scl */
-				<0 RK_PD5 11 &pcfg_pull_none>;
+				<0 RK_PD5 11 &pcfg_pull_none_drv_level_5_smt>;
 		};
 
 		/omit-if-no-ref/
 		hdmim1_tx0_sda: hdmim1-tx0-sda {
 			rockchip,pins =
 				/* hdmim1_tx0_sda */
-				<0 RK_PD4 11 &pcfg_pull_none>;
+				<0 RK_PD4 11 &pcfg_pull_none_drv_level_1_smt>;
 		};
 
 		/omit-if-no-ref/
@@ -668,14 +668,14 @@ hdmim1_tx1_hpd: hdmim1-tx1-hpd {
 		hdmim1_tx1_scl: hdmim1-tx1-scl {
 			rockchip,pins =
 				/* hdmim1_tx1_scl */
-				<3 RK_PC6 5 &pcfg_pull_none>;
+				<3 RK_PC6 5 &pcfg_pull_none_drv_level_5_smt>;
 		};
 
 		/omit-if-no-ref/
 		hdmim1_tx1_sda: hdmim1-tx1-sda {
 			rockchip,pins =
 				/* hdmim1_tx1_sda */
-				<3 RK_PC5 5 &pcfg_pull_none>;
+				<3 RK_PC5 5 &pcfg_pull_none_drv_level_1_smt>;
 		};
 		/omit-if-no-ref/
 		hdmim2_rx_cec: hdmim2-rx-cec {
@@ -709,14 +709,14 @@ hdmim2_rx_sda: hdmim2-rx-sda {
 		hdmim2_tx0_scl: hdmim2-tx0-scl {
 			rockchip,pins =
 				/* hdmim2_tx0_scl */
-				<3 RK_PC7 5 &pcfg_pull_none>;
+				<3 RK_PC7 5 &pcfg_pull_none_drv_level_5_smt>;
 		};
 
 		/omit-if-no-ref/
 		hdmim2_tx0_sda: hdmim2-tx0-sda {
 			rockchip,pins =
 				/* hdmim2_tx0_sda */
-				<3 RK_PD0 5 &pcfg_pull_none>;
+				<3 RK_PD0 5 &pcfg_pull_none_drv_level_1_smt>;
 		};
 
 		/omit-if-no-ref/
@@ -730,14 +730,14 @@ hdmim2_tx1_cec: hdmim2-tx1-cec {
 		hdmim2_tx1_scl: hdmim2-tx1-scl {
 			rockchip,pins =
 				/* hdmim2_tx1_scl */
-				<1 RK_PA4 5 &pcfg_pull_none>;
+				<1 RK_PA4 5 &pcfg_pull_none_drv_level_5_smt>;
 		};
 
 		/omit-if-no-ref/
 		hdmim2_tx1_sda: hdmim2-tx1-sda {
 			rockchip,pins =
 				/* hdmim2_tx1_sda */
-				<1 RK_PA3 5 &pcfg_pull_none>;
+				<1 RK_PA3 5 &pcfg_pull_none_drv_level_1_smt>;
 		};
 
 		/omit-if-no-ref/
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-extra-pinctrl.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-extra-pinctrl.dtsi
index 244c66faa161..fb48ddc04bcb 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra-pinctrl.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra-pinctrl.dtsi
@@ -160,14 +160,15 @@ hdmim0_tx1_cec: hdmim0-tx1-cec {
 		hdmim0_tx1_scl: hdmim0-tx1-scl {
 			rockchip,pins =
 				/* hdmim0_tx1_scl */
-				<2 RK_PB5 4 &pcfg_pull_none>;
+				<2 RK_PB5 4 &pcfg_pull_none_drv_level_3_smt>;
 		};
 
 		/omit-if-no-ref/
 		hdmim0_tx1_sda: hdmim0-tx1-sda {
 			rockchip,pins =
 				/* hdmim0_tx1_sda */
-				<2 RK_PB4 4 &pcfg_pull_none>;
+				<2 RK_PB4 4 &pcfg_pull_none_drv_level_1_smt>;
+
 		};
 	};
 
diff --git a/arch/arm64/boot/dts/rockchip/rockchip-pinconf.dtsi b/arch/arm64/boot/dts/rockchip/rockchip-pinconf.dtsi
index 5c645437b507..b0475b7c655a 100644
--- a/arch/arm64/boot/dts/rockchip/rockchip-pinconf.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rockchip-pinconf.dtsi
@@ -332,6 +332,41 @@ pcfg_pull_none_drv_level_0_smt: pcfg-pull-none-drv-level-0-smt {
 		input-schmitt-enable;
 	};
 
+	/omit-if-no-ref/
+	pcfg_pull_none_drv_level_1_smt: pcfg-pull-none-drv-level-1-smt {
+		bias-disable;
+		drive-strength = <1>;
+		input-schmitt-enable;
+	};
+
+	/omit-if-no-ref/
+	pcfg_pull_none_drv_level_2_smt: pcfg-pull-none-drv-level-2-smt {
+		bias-disable;
+		drive-strength = <2>;
+		input-schmitt-enable;
+	};
+
+	/omit-if-no-ref/
+	pcfg_pull_none_drv_level_3_smt: pcfg-pull-none-drv-level-3-smt {
+		bias-disable;
+		drive-strength = <3>;
+		input-schmitt-enable;
+	};
+
+	/omit-if-no-ref/
+	pcfg_pull_none_drv_level_4_smt: pcfg-pull-none-drv-level-4-smt {
+		bias-disable;
+		drive-strength = <4>;
+		input-schmitt-enable;
+	};
+
+	/omit-if-no-ref/
+	pcfg_pull_none_drv_level_5_smt: pcfg-pull-none-drv-level-5-smt {
+		bias-disable;
+		drive-strength = <5>;
+		input-schmitt-enable;
+	};
+
 	/omit-if-no-ref/
 	pcfg_output_high: pcfg-output-high {
 		output-high;
-- 
2.43.0

base-commit: 897af18e5d75e7ebf137044d57fed6522c46ae74
branch: linux-rockchip-next
Re: [PATCH v2] arm64: dts: rockchip: Adjust the HDMI DDC IO driver strength for rk3588
Posted by Heiko Stuebner 6 months, 1 week ago
On Thu, 22 May 2025 10:05:24 +0800, Andy Yan wrote:
> For the RK3588 HDMI controller, the falling edge of DDC SDA and SCL
> almost coincide and cannot be adjusted by HDMI registrer, resulting
> in poor compatibility of DDC communication.
> 
> An improvement of the compatibility of DDC can be done by increasing
> the driver strength of SCL and decreasing the driver strength of SDA
> to increase the slope of the falling edge.
> 
> [...]

Applied, thanks!

[1/1] arm64: dts: rockchip: Adjust the HDMI DDC IO driver strength for rk3588
      commit: af9feb0b85f92d2972061224839c5fea5ee39f6d

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>
Re: [PATCH v2] arm64: dts: rockchip: Adjust the HDMI DDC IO driver strength for rk3588
Posted by Nicolas Frattaroli 6 months, 2 weeks ago
On Thursday, 22 May 2025 04:05:24 Central European Summer Time Andy Yan wrote:
> From: Andy Yan <andy.yan@rock-chips.com>
> 
> For the RK3588 HDMI controller, the falling edge of DDC SDA and SCL
> almost coincide and cannot be adjusted by HDMI registrer, resulting
> in poor compatibility of DDC communication.
> 
> An improvement of the compatibility of DDC can be done by increasing
> the driver strength of SCL and decreasing the driver strength of SDA
> to increase the slope of the falling edge.
> 
> It should be noted that the maximum driving strength of hdmim0_tx1_scl
> is only 3, which is different from that of the other IOs.
> 
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> 
> ---
> 
> Changes in v2:
> - Correct the max drive level of hdmim0_tx1_scl.
> 
>  .../dts/rockchip/rk3588-base-pinctrl.dtsi     | 20 +++++------
>  .../dts/rockchip/rk3588-extra-pinctrl.dtsi    |  5 +--
>  .../boot/dts/rockchip/rockchip-pinconf.dtsi   | 35 +++++++++++++++++++
>  3 files changed, 48 insertions(+), 12 deletions(-)
> 

Tested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

Quickly tested this on both HDMI ports of a ROCK 5T with an HDMI capture
card on the other end. While I didn't originally have any issues to begin
with, this patch does not introduce any new ones, so seems good to me.
Re:Re: [PATCH v2] arm64: dts: rockchip: Adjust the HDMI DDC IO driver strength for rk3588
Posted by Andy Yan 6 months, 2 weeks ago
Hello Nicolas,

At 2025-05-27 19:53:56, "Nicolas Frattaroli" <nicolas.frattaroli@collabora.com> wrote:
>On Thursday, 22 May 2025 04:05:24 Central European Summer Time Andy Yan wrote:
>> From: Andy Yan <andy.yan@rock-chips.com>
>> 
>> For the RK3588 HDMI controller, the falling edge of DDC SDA and SCL
>> almost coincide and cannot be adjusted by HDMI registrer, resulting
>> in poor compatibility of DDC communication.
>> 
>> An improvement of the compatibility of DDC can be done by increasing
>> the driver strength of SCL and decreasing the driver strength of SDA
>> to increase the slope of the falling edge.
>> 
>> It should be noted that the maximum driving strength of hdmim0_tx1_scl
>> is only 3, which is different from that of the other IOs.
>> 
>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>> 
>> ---
>> 
>> Changes in v2:
>> - Correct the max drive level of hdmim0_tx1_scl.
>> 
>>  .../dts/rockchip/rk3588-base-pinctrl.dtsi     | 20 +++++------
>>  .../dts/rockchip/rk3588-extra-pinctrl.dtsi    |  5 +--
>>  .../boot/dts/rockchip/rockchip-pinconf.dtsi   | 35 +++++++++++++++++++
>>  3 files changed, 48 insertions(+), 12 deletions(-)
>> 
>
>Tested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
>
>Quickly tested this on both HDMI ports of a ROCK 5T with an HDMI capture
>card on the other end. While I didn't originally have any issues to begin
>with, this patch does not introduce any new ones, so seems good to me.


Thanks for yout test.

I sent this patch because someone from the community reported to me that his board
couldn't successfully establish ddc communication when running the mainline kernel.
After conducting extensive comparisons, it was discovered that there were differences
in the IO drive strength configuration between mainline code and the downstream code. 
Then, I recalled that during the chip bringup process and when conducting the SI test, 
we had encountered this problem before, and we did the fix by adjusting DDC IO drive strength.
>