* [PATCH v2 1/5] riscv: dts: thead: th1520: remove pclk for I2C1
2026-07-14 7:45 [PATCH v2 0/5] Add remaining IO expansions on Lichee Pi 4A Icenowy Zheng
@ 2026-07-14 7:45 ` Icenowy Zheng
2026-07-20 18:25 ` Drew Fustini
2026-07-14 7:45 ` [PATCH v2 2/5] riscv: dts: thead: Add TH1520 I2C nodes Icenowy Zheng
` (3 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Icenowy Zheng @ 2026-07-14 7:45 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, MoeLeak
Cc: devicetree, Albert Ou, linux-kernel, Palmer Dabbelt,
Icenowy Zheng, Paul Walmsley, linux-riscv
The I2C1 node added previously to the th1520.dtsi file has two clocks
set -- one "ref" clock (CLK_I2C1) and one "pclk" (CLK_PERI_APB_PCLK).
However, the CLK_I2C1 clock is just a clock gate with the
CLK_PERI_APB_PCLK clock as its input. In addition, when it's gated,
reading registers from the I2C controller returns fixed value (the last
read value) for all registers. These facts indicate that the CLK_I2C1
clock is the true APB clock fed into the I2C controller instead of a
dedicated reference clock.
Leave only the CLK_I2C1 clock as the `clocks` property of the I2C1
device node and remove `clock-names` property, which represents the I2C
controller only takes a single clock both as the APB clock and the
reference clock.
Fixes: 2f60e3516330 ("riscv: dts: thead: Add TH1520 I2C1 controller")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
arch/riscv/boot/dts/thead/th1520.dtsi | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index 94932c51b7e39..db23624696b73 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -415,8 +415,7 @@ i2c1: i2c@ffe7f24000 {
compatible = "thead,th1520-i2c", "snps,designware-i2c";
reg = <0xff 0xe7f24000 0x0 0x4000>;
interrupts = <45 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clk CLK_I2C1>, <&clk CLK_PERI_APB_PCLK>;
- clock-names = "ref", "pclk";
+ clocks = <&clk CLK_I2C1>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
--
2.52.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 1/5] riscv: dts: thead: th1520: remove pclk for I2C1
2026-07-14 7:45 ` [PATCH v2 1/5] riscv: dts: thead: th1520: remove pclk for I2C1 Icenowy Zheng
@ 2026-07-20 18:25 ` Drew Fustini
0 siblings, 0 replies; 15+ messages in thread
From: Drew Fustini @ 2026-07-20 18:25 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Conor Dooley, Albert Ou, devicetree, MoeLeak,
linux-kernel, linux-riscv, Guo Ren, Palmer Dabbelt,
Krzysztof Kozlowski, Paul Walmsley, Fu Wei
On Tue, Jul 14, 2026 at 03:45:11PM +0800, Icenowy Zheng wrote:
> The I2C1 node added previously to the th1520.dtsi file has two clocks
> set -- one "ref" clock (CLK_I2C1) and one "pclk" (CLK_PERI_APB_PCLK).
>
> However, the CLK_I2C1 clock is just a clock gate with the
> CLK_PERI_APB_PCLK clock as its input. In addition, when it's gated,
> reading registers from the I2C controller returns fixed value (the last
> read value) for all registers. These facts indicate that the CLK_I2C1
> clock is the true APB clock fed into the I2C controller instead of a
> dedicated reference clock.
>
> Leave only the CLK_I2C1 clock as the `clocks` property of the I2C1
> device node and remove `clock-names` property, which represents the I2C
> controller only takes a single clock both as the APB clock and the
> reference clock.
>
> Fixes: 2f60e3516330 ("riscv: dts: thead: Add TH1520 I2C1 controller")
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
> arch/riscv/boot/dts/thead/th1520.dtsi | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
> index 94932c51b7e39..db23624696b73 100644
> --- a/arch/riscv/boot/dts/thead/th1520.dtsi
> +++ b/arch/riscv/boot/dts/thead/th1520.dtsi
> @@ -415,8 +415,7 @@ i2c1: i2c@ffe7f24000 {
> compatible = "thead,th1520-i2c", "snps,designware-i2c";
> reg = <0xff 0xe7f24000 0x0 0x4000>;
> interrupts = <45 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&clk CLK_I2C1>, <&clk CLK_PERI_APB_PCLK>;
> - clock-names = "ref", "pclk";
> + clocks = <&clk CLK_I2C1>;
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> --
> 2.52.0
Reviewed-by: Drew Fustini <fustini@kernel.org>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 2/5] riscv: dts: thead: Add TH1520 I2C nodes
2026-07-14 7:45 [PATCH v2 0/5] Add remaining IO expansions on Lichee Pi 4A Icenowy Zheng
2026-07-14 7:45 ` [PATCH v2 1/5] riscv: dts: thead: th1520: remove pclk for I2C1 Icenowy Zheng
@ 2026-07-14 7:45 ` Icenowy Zheng
2026-07-20 18:26 ` Drew Fustini
2026-07-14 7:45 ` [PATCH v2 3/5] riscv: dts: thead: lpi4a: sort nodes Icenowy Zheng
` (2 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Icenowy Zheng @ 2026-07-14 7:45 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, MoeLeak
Cc: devicetree, Albert Ou, linux-kernel, Icenowy Zheng,
Palmer Dabbelt, Thomas Bonnefille, Paul Walmsley, Drew Fustini,
linux-riscv
From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Add nodes for the remaining five I2C controllers on the T-Head TH1520
RISCV SoC.
Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Reviewed-by: Drew Fustini <dfustini@tenstorrent.com>
[Icenowy: rebase and reword commit message to exclude I2C1]
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
arch/riscv/boot/dts/thead/th1520.dtsi | 50 +++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index db23624696b73..b01a94785d870 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -411,6 +411,16 @@ uart3: serial@ffe7f04000 {
status = "disabled";
};
+ i2c0: i2c@ffe7f20000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xe7f20000 0x0 0x4000>;
+ interrupts = <44 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
i2c1: i2c@ffe7f24000 {
compatible = "thead,th1520-i2c", "snps,designware-i2c";
reg = <0xff 0xe7f24000 0x0 0x4000>;
@@ -421,6 +431,16 @@ i2c1: i2c@ffe7f24000 {
status = "disabled";
};
+ i2c4: i2c@ffe7f28000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xe7f28000 0x0 0x4000>;
+ interrupts = <48 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C4>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
gpio@ffe7f34000 {
compatible = "snps,dw-apb-gpio";
reg = <0xff 0xe7f34000 0x0 0x1000>;
@@ -519,6 +539,16 @@ padctrl0_apsys: pinctrl@ffec007000 {
thead,pad-group = <3>;
};
+ i2c2: i2c@ffec00c000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xec00c000 0x0 0x4000>;
+ interrupts = <46 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C2>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
uart2: serial@ffec010000 {
compatible = "snps,dw-apb-uart";
reg = <0xff 0xec010000 0x0 0x4000>;
@@ -530,6 +560,16 @@ uart2: serial@ffec010000 {
status = "disabled";
};
+ i2c3: i2c@ffec014000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xec014000 0x0 0x4000>;
+ interrupts = <47 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C3>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
pwm: pwm@ffec01c000 {
compatible = "thead,th1520-pwm";
reg = <0xff 0xec01c000 0x0 0x4000>;
@@ -735,6 +775,16 @@ uart5: serial@fff7f0c000 {
status = "disabled";
};
+ i2c5: i2c@fff7f2c000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xf7f2c000 0x0 0x4000>;
+ interrupts = <49 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C5>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
timer4: timer@ffffc33000 {
compatible = "snps,dw-apb-timer";
reg = <0xff 0xffc33000 0x0 0x14>;
--
2.52.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 2/5] riscv: dts: thead: Add TH1520 I2C nodes
2026-07-14 7:45 ` [PATCH v2 2/5] riscv: dts: thead: Add TH1520 I2C nodes Icenowy Zheng
@ 2026-07-20 18:26 ` Drew Fustini
0 siblings, 0 replies; 15+ messages in thread
From: Drew Fustini @ 2026-07-20 18:26 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Conor Dooley, Albert Ou, devicetree, MoeLeak,
linux-kernel, linux-riscv, Guo Ren, Thomas Bonnefille,
Palmer Dabbelt, Krzysztof Kozlowski, Drew Fustini, Paul Walmsley,
Fu Wei
On Tue, Jul 14, 2026 at 03:45:12PM +0800, Icenowy Zheng wrote:
> From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
>
> Add nodes for the remaining five I2C controllers on the T-Head TH1520
> RISCV SoC.
>
> Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
> Reviewed-by: Drew Fustini <dfustini@tenstorrent.com>
> [Icenowy: rebase and reword commit message to exclude I2C1]
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
> arch/riscv/boot/dts/thead/th1520.dtsi | 50 +++++++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
Reviewed-by: Drew Fustini <fustini@kernel.org>
Thanks,
Drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 3/5] riscv: dts: thead: lpi4a: sort nodes
2026-07-14 7:45 [PATCH v2 0/5] Add remaining IO expansions on Lichee Pi 4A Icenowy Zheng
2026-07-14 7:45 ` [PATCH v2 1/5] riscv: dts: thead: th1520: remove pclk for I2C1 Icenowy Zheng
2026-07-14 7:45 ` [PATCH v2 2/5] riscv: dts: thead: Add TH1520 I2C nodes Icenowy Zheng
@ 2026-07-14 7:45 ` Icenowy Zheng
2026-07-20 18:26 ` Drew Fustini
2026-07-14 7:45 ` [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1 Icenowy Zheng
2026-07-14 7:45 ` [PATCH v2 5/5] riscv: dts: thead: Add remaining Lichee Pi 4A IO expansions Icenowy Zheng
4 siblings, 1 reply; 15+ messages in thread
From: Icenowy Zheng @ 2026-07-14 7:45 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, MoeLeak
Cc: devicetree, Albert Ou, linux-kernel, Palmer Dabbelt,
Icenowy Zheng, Paul Walmsley, linux-riscv
Although "D", "H" and "I" are earlier in the alphabet than "P", the DPU,
HDMI and I2C1 nodes were added after PADCTRL nodes in the Lichee Pi 4A
device tree; in addition the PADCTRL1 node is placed before the
PADCTRL0 one.
Sort the nodes in this device tree.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
.../boot/dts/thead/th1520-lichee-pi-4a.dts | 72 +++++++++----------
1 file changed, 36 insertions(+), 36 deletions(-)
diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
index af6f25ebbf607..74b120c6b063a 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
@@ -103,17 +103,31 @@ fan: pwm-fan {
};
-&padctrl1_apsys {
- i2c1_pins: i2c1-0 {
- i2c-pins {
- pins = "I2C1_SCL", "I2C1_SDA";
- function = "i2c";
- bias-pull-up = <2100>;
- drive-strength = <7>;
- input-enable;
- input-schmitt-enable;
- slew-rate = <0>;
- };
+&dpu {
+ status = "okay";
+};
+
+&hdmi {
+ status = "okay";
+};
+
+&hdmi_out_port {
+ hdmi_out_con: endpoint {
+ remote-endpoint = <&hdmi_con_in>;
+ };
+};
+
+&i2c1 {
+ clock-frequency = <400000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins>;
+ status = "okay";
+
+ ioexp2: gpio@18 {
+ compatible = "nxp,pca9557";
+ reg = <0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
};
};
@@ -153,17 +167,17 @@ rx-pins {
};
};
-&i2c1 {
- clock-frequency = <400000>;
- pinctrl-names = "default";
- pinctrl-0 = <&i2c1_pins>;
- status = "okay";
-
- ioexp2: gpio@18 {
- compatible = "nxp,pca9557";
- reg = <0x18>;
- gpio-controller;
- #gpio-cells = <2>;
+&padctrl1_apsys {
+ i2c1_pins: i2c1-0 {
+ i2c-pins {
+ pins = "I2C1_SCL", "I2C1_SDA";
+ function = "i2c";
+ bias-pull-up = <2100>;
+ drive-strength = <7>;
+ input-enable;
+ input-schmitt-enable;
+ slew-rate = <0>;
+ };
};
};
@@ -179,20 +193,6 @@ &sdio1 {
status = "okay";
};
-&dpu {
- status = "okay";
-};
-
-&hdmi {
- status = "okay";
-};
-
-&hdmi_out_port {
- hdmi_out_con: endpoint {
- remote-endpoint = <&hdmi_con_in>;
- };
-};
-
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins>;
--
2.52.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 3/5] riscv: dts: thead: lpi4a: sort nodes
2026-07-14 7:45 ` [PATCH v2 3/5] riscv: dts: thead: lpi4a: sort nodes Icenowy Zheng
@ 2026-07-20 18:26 ` Drew Fustini
0 siblings, 0 replies; 15+ messages in thread
From: Drew Fustini @ 2026-07-20 18:26 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Conor Dooley, Albert Ou, devicetree, MoeLeak,
linux-kernel, linux-riscv, Guo Ren, Palmer Dabbelt,
Krzysztof Kozlowski, Paul Walmsley, Fu Wei
On Tue, Jul 14, 2026 at 03:45:13PM +0800, Icenowy Zheng wrote:
> Although "D", "H" and "I" are earlier in the alphabet than "P", the DPU,
> HDMI and I2C1 nodes were added after PADCTRL nodes in the Lichee Pi 4A
> device tree; in addition the PADCTRL1 node is placed before the
> PADCTRL0 one.
>
> Sort the nodes in this device tree.
>
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
> .../boot/dts/thead/th1520-lichee-pi-4a.dts | 72 +++++++++----------
> 1 file changed, 36 insertions(+), 36 deletions(-)
Reviewed-by: Drew Fustini <fustini@kernel.org>
Thanks,
Drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1
2026-07-14 7:45 [PATCH v2 0/5] Add remaining IO expansions on Lichee Pi 4A Icenowy Zheng
` (2 preceding siblings ...)
2026-07-14 7:45 ` [PATCH v2 3/5] riscv: dts: thead: lpi4a: sort nodes Icenowy Zheng
@ 2026-07-14 7:45 ` Icenowy Zheng
2026-07-16 20:52 ` Drew Fustini
2026-07-14 7:45 ` [PATCH v2 5/5] riscv: dts: thead: Add remaining Lichee Pi 4A IO expansions Icenowy Zheng
4 siblings, 1 reply; 15+ messages in thread
From: Icenowy Zheng @ 2026-07-14 7:45 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, MoeLeak
Cc: devicetree, Albert Ou, linux-kernel, Palmer Dabbelt,
Icenowy Zheng, Paul Walmsley, Emil Renner Berthing, linux-riscv
From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Add labels for GPIOs on the IO expansion chip on the I2C1 bus.
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
[Icenowy: Splitted off the patch adding all 3 IO expansions]
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
index 74b120c6b063a..78f5979a56c14 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
@@ -128,6 +128,14 @@ ioexp2: gpio@18 {
reg = <0x18>;
gpio-controller;
#gpio-cells = <2>;
+ gpio-line-names = "",
+ "cam0_reset",
+ "cam1_reset",
+ "cam2_reset",
+ "wl_host_wake",
+ "bt_resetn",
+ "",
+ "bt_host_wake";
};
};
--
2.52.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1
2026-07-14 7:45 ` [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1 Icenowy Zheng
@ 2026-07-16 20:52 ` Drew Fustini
2026-07-17 4:11 ` Icenowy Zheng
0 siblings, 1 reply; 15+ messages in thread
From: Drew Fustini @ 2026-07-16 20:52 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Conor Dooley, Albert Ou, devicetree, MoeLeak,
linux-kernel, linux-riscv, Guo Ren, Palmer Dabbelt,
Krzysztof Kozlowski, Emil Renner Berthing, Paul Walmsley, Fu Wei
On Tue, Jul 14, 2026 at 03:45:14PM +0800, Icenowy Zheng wrote:
> From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
>
> Add labels for GPIOs on the IO expansion chip on the I2C1 bus.
>
> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> [Icenowy: Splitted off the patch adding all 3 IO expansions]
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
> arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> index 74b120c6b063a..78f5979a56c14 100644
> --- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> +++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> @@ -128,6 +128,14 @@ ioexp2: gpio@18 {
> reg = <0x18>;
> gpio-controller;
> #gpio-cells = <2>;
> + gpio-line-names = "",
> + "cam0_reset",
> + "cam1_reset",
> + "cam2_reset",
> + "wl_host_wake",
I am not sure the line name really matters all that, but it seems that
pin 4 is also used as a reset gpio:
wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&ioexp2 4 GPIO_ACTIVE_LOW>;
post-power-on-delay-ms = <200>;
};
Did you notice that too?
Thanks,
Drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1
2026-07-16 20:52 ` Drew Fustini
@ 2026-07-17 4:11 ` Icenowy Zheng
2026-07-20 16:56 ` Drew Fustini
0 siblings, 1 reply; 15+ messages in thread
From: Icenowy Zheng @ 2026-07-17 4:11 UTC (permalink / raw)
To: Drew Fustini, Icenowy Zheng
Cc: Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
MoeLeak, Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv,
devicetree, linux-kernel, Emil Renner Berthing
于 2026年7月17日 GMT+08:00 04:52:19,Drew Fustini <fustini@kernel.org> 写道:
>On Tue, Jul 14, 2026 at 03:45:14PM +0800, Icenowy Zheng wrote:
>> From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
>>
>> Add labels for GPIOs on the IO expansion chip on the I2C1 bus.
>>
>> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
>> [Icenowy: Splitted off the patch adding all 3 IO expansions]
>> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
>> ---
>> arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
>> index 74b120c6b063a..78f5979a56c14 100644
>> --- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
>> +++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
>> @@ -128,6 +128,14 @@ ioexp2: gpio@18 {
>> reg = <0x18>;
>> gpio-controller;
>> #gpio-cells = <2>;
>> + gpio-line-names = "",
>> + "cam0_reset",
>> + "cam1_reset",
>> + "cam2_reset",
>> + "wl_host_wake",
>
>I am not sure the line name really matters all that, but it seems that
>pin 4 is also used as a reset gpio:
The "host" here is subject, which means "this pins is used by the host to wake the wl".
Maybe I should take the schematics name, "wl_host_wake_dev"? Or use another name on the page for Wi-Fi, "wl_reg_on"?
Thanks,
Icenowy
>
> wifi_pwrseq: wifi-pwrseq {
> compatible = "mmc-pwrseq-simple";
> reset-gpios = <&ioexp2 4 GPIO_ACTIVE_LOW>;
> post-power-on-delay-ms = <200>;
> };
>
>Did you notice that too?
>
>Thanks,
>Drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1
2026-07-17 4:11 ` Icenowy Zheng
@ 2026-07-20 16:56 ` Drew Fustini
2026-07-20 17:28 ` Icenowy Zheng
0 siblings, 1 reply; 15+ messages in thread
From: Drew Fustini @ 2026-07-20 16:56 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Icenowy Zheng, Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, MoeLeak, Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv, devicetree, linux-kernel, Emil Renner Berthing
On Fri, Jul 17, 2026 at 12:11:23PM +0800, Icenowy Zheng wrote:
>
>
> 于 2026年7月17日 GMT+08:00 04:52:19,Drew Fustini <fustini@kernel.org> 写道:
> >On Tue, Jul 14, 2026 at 03:45:14PM +0800, Icenowy Zheng wrote:
> >> From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> >>
> >> Add labels for GPIOs on the IO expansion chip on the I2C1 bus.
> >>
> >> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> >> [Icenowy: Splitted off the patch adding all 3 IO expansions]
> >> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> >> ---
> >> arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 8 ++++++++
> >> 1 file changed, 8 insertions(+)
> >>
> >> diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> >> index 74b120c6b063a..78f5979a56c14 100644
> >> --- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> >> +++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> >> @@ -128,6 +128,14 @@ ioexp2: gpio@18 {
> >> reg = <0x18>;
> >> gpio-controller;
> >> #gpio-cells = <2>;
> >> + gpio-line-names = "",
> >> + "cam0_reset",
> >> + "cam1_reset",
> >> + "cam2_reset",
> >> + "wl_host_wake",
> >
> >I am not sure the line name really matters all that, but it seems that
> >pin 4 is also used as a reset gpio:
>
> The "host" here is subject, which means "this pins is used by the host to wake the wl".
>
> Maybe I should take the schematics name, "wl_host_wake_dev"? Or use another name on the page for Wi-Fi, "wl_reg_on"?
I thnk "wl_host_wake_dev" is slightly better in terms of searching the
PDF [1] and finding the "IO Expansion 2" section. This is minor change
so I can just fix up when applying if you are okay with that.
Thanks,
Drew
[1] https://dl.sipeed.com/shareURL/LICHEE/licheepi4a/02_Schematic
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1
2026-07-20 16:56 ` Drew Fustini
@ 2026-07-20 17:28 ` Icenowy Zheng
2026-07-20 18:27 ` Drew Fustini
0 siblings, 1 reply; 15+ messages in thread
From: Icenowy Zheng @ 2026-07-20 17:28 UTC (permalink / raw)
To: Drew Fustini
Cc: Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
MoeLeak, Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv,
devicetree, linux-kernel, Emil Renner Berthing
在 2026-07-20一的 09:56 -0700,Drew Fustini写道:
> On Fri, Jul 17, 2026 at 12:11:23PM +0800, Icenowy Zheng wrote:
> >
> >
> > 于 2026年7月17日 GMT+08:00 04:52:19,Drew Fustini <fustini@kernel.org>
> > 写道:
> > > On Tue, Jul 14, 2026 at 03:45:14PM +0800, Icenowy Zheng wrote:
> > > > From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> > > >
> > > > Add labels for GPIOs on the IO expansion chip on the I2C1 bus.
> > > >
> > > > Signed-off-by: Emil Renner Berthing
> > > > <emil.renner.berthing@canonical.com>
> > > > [Icenowy: Splitted off the patch adding all 3 IO expansions]
> > > > Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> > > > ---
> > > > arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 8 ++++++++
> > > > 1 file changed, 8 insertions(+)
> > > >
> > > > diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> > > > b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> > > > index 74b120c6b063a..78f5979a56c14 100644
> > > > --- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> > > > +++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> > > > @@ -128,6 +128,14 @@ ioexp2: gpio@18 {
> > > > reg = <0x18>;
> > > > gpio-controller;
> > > > #gpio-cells = <2>;
> > > > + gpio-line-names = "",
> > > > + "cam0_reset",
> > > > + "cam1_reset",
> > > > + "cam2_reset",
> > > > + "wl_host_wake",
> > >
> > > I am not sure the line name really matters all that, but it seems
> > > that
> > > pin 4 is also used as a reset gpio:
> >
> > The "host" here is subject, which means "this pins is used by the
> > host to wake the wl".
> >
> > Maybe I should take the schematics name, "wl_host_wake_dev"? Or use
> > another name on the page for Wi-Fi, "wl_reg_on"?
>
> I thnk "wl_host_wake_dev" is slightly better in terms of searching
> the
> PDF [1] and finding the "IO Expansion 2" section. This is minor
> change
> so I can just fix up when applying if you are okay with that.
Of course I am okay with this.
Thanks,
Icenowy
>
> Thanks,
> Drew
>
> [1] https://dl.sipeed.com/shareURL/LICHEE/licheepi4a/02_Schematic
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1
2026-07-20 17:28 ` Icenowy Zheng
@ 2026-07-20 18:27 ` Drew Fustini
0 siblings, 0 replies; 15+ messages in thread
From: Drew Fustini @ 2026-07-20 18:27 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
MoeLeak, Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv,
devicetree, linux-kernel, Emil Renner Berthing
On Tue, Jul 21, 2026 at 01:28:58AM +0800, Icenowy Zheng wrote:
> 在 2026-07-20一的 09:56 -0700,Drew Fustini写道:
> > On Fri, Jul 17, 2026 at 12:11:23PM +0800, Icenowy Zheng wrote:
> > >
> > >
> > > 于 2026年7月17日 GMT+08:00 04:52:19,Drew Fustini <fustini@kernel.org>
> > > 写道:
> > > > On Tue, Jul 14, 2026 at 03:45:14PM +0800, Icenowy Zheng wrote:
> > > > > From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> > > > >
> > > > > Add labels for GPIOs on the IO expansion chip on the I2C1 bus.
> > > > >
> > > > > Signed-off-by: Emil Renner Berthing
> > > > > <emil.renner.berthing@canonical.com>
> > > > > [Icenowy: Splitted off the patch adding all 3 IO expansions]
> > > > > Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> > > > > ---
> > > > > arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 8 ++++++++
> > > > > 1 file changed, 8 insertions(+)
> > > > >
> > > > > diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> > > > > b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> > > > > index 74b120c6b063a..78f5979a56c14 100644
> > > > > --- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> > > > > +++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> > > > > @@ -128,6 +128,14 @@ ioexp2: gpio@18 {
> > > > > reg = <0x18>;
> > > > > gpio-controller;
> > > > > #gpio-cells = <2>;
> > > > > + gpio-line-names = "",
> > > > > + "cam0_reset",
> > > > > + "cam1_reset",
> > > > > + "cam2_reset",
> > > > > + "wl_host_wake",
> > > >
> > > > I am not sure the line name really matters all that, but it seems
> > > > that
> > > > pin 4 is also used as a reset gpio:
> > >
> > > The "host" here is subject, which means "this pins is used by the
> > > host to wake the wl".
> > >
> > > Maybe I should take the schematics name, "wl_host_wake_dev"? Or use
> > > another name on the page for Wi-Fi, "wl_reg_on"?
> >
> > I thnk "wl_host_wake_dev" is slightly better in terms of searching
> > the
> > PDF [1] and finding the "IO Expansion 2" section. This is minor
> > change
> > so I can just fix up when applying if you are okay with that.
>
> Of course I am okay with this.
>
> Thanks,
> Icenowy
Great, I'll fixup on apply.
Reviewed-by: Drew Fustini <fustini@kernel.org>
Thanks,
Drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 5/5] riscv: dts: thead: Add remaining Lichee Pi 4A IO expansions
2026-07-14 7:45 [PATCH v2 0/5] Add remaining IO expansions on Lichee Pi 4A Icenowy Zheng
` (3 preceding siblings ...)
2026-07-14 7:45 ` [PATCH v2 4/5] riscv: dts: thead: Add IO labels for the IO expansion on I2C1 Icenowy Zheng
@ 2026-07-14 7:45 ` Icenowy Zheng
2026-07-20 18:28 ` Drew Fustini
4 siblings, 1 reply; 15+ messages in thread
From: Icenowy Zheng @ 2026-07-14 7:45 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, MoeLeak
Cc: devicetree, Albert Ou, linux-kernel, Palmer Dabbelt,
Icenowy Zheng, Paul Walmsley, Emil Renner Berthing, linux-riscv
From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Lichee Pi 4A has 3 I2C IO expansion chips onboard, connected to the
I2C0/1/3 busses. The I2C1 one is already added to the device tree, but
the I2C0/3 ones are not yet added.
Add device tree nodes for them.
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
[Icenowy: added commit description, enable SoC pull-up, remove I2C1 and
aliases]
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
.../boot/dts/thead/th1520-lichee-pi-4a.dts | 63 +++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
index 78f5979a56c14..75396cafb39dc 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
@@ -117,6 +117,23 @@ hdmi_out_con: endpoint {
};
};
+&i2c0 {
+ clock-frequency = <400000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c0_pins>;
+ status = "okay";
+
+ ioexp1: gpio@18 {
+ compatible = "nxp,pca9557";
+ reg = <0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-line-names = "cam0_dvdd12",
+ "cam0_avdd28",
+ "cam0_dovdd18";
+ };
+};
+
&i2c1 {
clock-frequency = <400000>;
pinctrl-names = "default";
@@ -139,6 +156,28 @@ ioexp2: gpio@18 {
};
};
+&i2c3 {
+ clock-frequency = <400000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c3_pins>;
+ status = "okay";
+
+ ioexp3: gpio@18 {
+ compatible = "nxp,pca9557";
+ reg = <0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-line-names = "tp0_rst",
+ "",
+ "",
+ "vcc5v_usb",
+ "vdd28_tp0",
+ "vdd33_lcd0",
+ "vdd18_lcd0",
+ "lcd0_reset";
+ };
+};
+
&padctrl0_apsys {
fan_pins: fan-0 {
pwm1-pins {
@@ -152,6 +191,18 @@ pwm1-pins {
};
};
+ i2c3_pins: i2c3-0 {
+ i2c-pins {
+ pins = "I2C3_SCL", "I2C3_SDA";
+ function = "i2c";
+ bias-pull-up = <2100>;
+ drive-strength = <7>;
+ input-enable;
+ input-schmitt-enable;
+ slew-rate = <0>;
+ };
+ };
+
uart0_pins: uart0-0 {
tx-pins {
pins = "UART0_TXD";
@@ -176,6 +227,18 @@ rx-pins {
};
&padctrl1_apsys {
+ i2c0_pins: i2c0-0 {
+ i2c-pins {
+ pins = "I2C0_SCL", "I2C0_SDA";
+ function = "i2c";
+ bias-pull-up = <2100>;
+ drive-strength = <7>;
+ input-enable;
+ input-schmitt-enable;
+ slew-rate = <0>;
+ };
+ };
+
i2c1_pins: i2c1-0 {
i2c-pins {
pins = "I2C1_SCL", "I2C1_SDA";
--
2.52.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 5/5] riscv: dts: thead: Add remaining Lichee Pi 4A IO expansions
2026-07-14 7:45 ` [PATCH v2 5/5] riscv: dts: thead: Add remaining Lichee Pi 4A IO expansions Icenowy Zheng
@ 2026-07-20 18:28 ` Drew Fustini
0 siblings, 0 replies; 15+ messages in thread
From: Drew Fustini @ 2026-07-20 18:28 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Conor Dooley, Albert Ou, devicetree, MoeLeak,
linux-kernel, linux-riscv, Guo Ren, Palmer Dabbelt,
Krzysztof Kozlowski, Emil Renner Berthing, Paul Walmsley, Fu Wei
On Tue, Jul 14, 2026 at 03:45:15PM +0800, Icenowy Zheng wrote:
> From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
>
> Lichee Pi 4A has 3 I2C IO expansion chips onboard, connected to the
> I2C0/1/3 busses. The I2C1 one is already added to the device tree, but
> the I2C0/3 ones are not yet added.
>
> Add device tree nodes for them.
>
> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> [Icenowy: added commit description, enable SoC pull-up, remove I2C1 and
> aliases]
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
> .../boot/dts/thead/th1520-lichee-pi-4a.dts | 63 +++++++++++++++++++
> 1 file changed, 63 insertions(+)
Reviewed-by: Drew Fustini <fustini@kernel.org>
Thanks,
Drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 15+ messages in thread