* [PATCH v2 1/2] riscv: dts: thead: Add TH1520 I2C1 controller
2026-05-08 11:44 [PATCH v2 0/2] riscv: dts: thead: Enable Lichee Pi 4A WiFi MoeLeak
@ 2026-05-08 11:44 ` MoeLeak
2026-05-27 13:14 ` Drew Fustini
2026-05-08 11:44 ` [PATCH v2 2/2] riscv: dts: thead: Enable WiFi on Lichee Pi 4A MoeLeak
2026-05-27 13:21 ` [PATCH v2 0/2] riscv: dts: thead: Enable Lichee Pi 4A WiFi Drew Fustini
2 siblings, 1 reply; 6+ messages in thread
From: MoeLeak @ 2026-05-08 11:44 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, linux-riscv,
devicetree, linux-kernel, MoeLeak
Describe the TH1520 I2C1 controller so boards can enable devices attached
to that bus.
The controller is disabled by default because pinmuxing and connected
peripherals are board-specific.
Signed-off-by: MoeLeak <i@leak.moe>
---
arch/riscv/boot/dts/thead/th1520.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index 5e91dc1d2b9b..94932c51b7e3 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -411,6 +411,17 @@ uart3: serial@ffe7f04000 {
status = "disabled";
};
+ 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";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
gpio@ffe7f34000 {
compatible = "snps,dw-apb-gpio";
reg = <0xff 0xe7f34000 0x0 0x1000>;
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/2] riscv: dts: thead: Add TH1520 I2C1 controller
2026-05-08 11:44 ` [PATCH v2 1/2] riscv: dts: thead: Add TH1520 I2C1 controller MoeLeak
@ 2026-05-27 13:14 ` Drew Fustini
0 siblings, 0 replies; 6+ messages in thread
From: Drew Fustini @ 2026-05-27 13:14 UTC (permalink / raw)
To: MoeLeak
Cc: Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, devicetree, linux-kernel
On Fri, May 08, 2026 at 07:44:13PM +0800, MoeLeak wrote:
> Describe the TH1520 I2C1 controller so boards can enable devices attached
> to that bus.
>
> The controller is disabled by default because pinmuxing and connected
> peripherals are board-specific.
>
> Signed-off-by: MoeLeak <i@leak.moe>
> ---
> arch/riscv/boot/dts/thead/th1520.dtsi | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Reviewed-by: Drew Fustini <fustini@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] riscv: dts: thead: Enable WiFi on Lichee Pi 4A
2026-05-08 11:44 [PATCH v2 0/2] riscv: dts: thead: Enable Lichee Pi 4A WiFi MoeLeak
2026-05-08 11:44 ` [PATCH v2 1/2] riscv: dts: thead: Add TH1520 I2C1 controller MoeLeak
@ 2026-05-08 11:44 ` MoeLeak
2026-05-27 13:19 ` Drew Fustini
2026-05-27 13:21 ` [PATCH v2 0/2] riscv: dts: thead: Enable Lichee Pi 4A WiFi Drew Fustini
2 siblings, 1 reply; 6+ messages in thread
From: MoeLeak @ 2026-05-08 11:44 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, linux-riscv,
devicetree, linux-kernel, MoeLeak
The Lichee Pi 4A has an RTL8723DS WiFi module connected to the TH1520
SDIO1 controller. The module reset line is driven through a PCA9557 GPIO
expander on the I2C1 bus.
Enable I2C1 for the GPIO expander and configure SDIO1 as a non-removable
4-bit SDIO bus using an mmc-pwrseq-simple reset sequence so the WiFi
device can be powered and enumerated.
Signed-off-by: MoeLeak <i@leak.moe>
---
arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 47 +++++++++++++++++++++++
1 file changed, 47 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 7cb7d28683bc..af6f25ebbf60 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
@@ -4,6 +4,7 @@
*/
#include "th1520-lichee-module-4a.dtsi"
+#include <dt-bindings/gpio/gpio.h>
/ {
model = "Sipeed Lichee Pi 4A";
@@ -40,6 +41,12 @@ hdmi_con_in: endpoint {
};
};
+ wifi_pwrseq: wifi-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&ioexp2 4 GPIO_ACTIVE_LOW>;
+ post-power-on-delay-ms = <200>;
+ };
+
thermal-zones {
cpu-thermal {
polling-delay = <1000>;
@@ -96,6 +103,20 @@ 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>;
+ };
+ };
+};
+
&padctrl0_apsys {
fan_pins: fan-0 {
pwm1-pins {
@@ -132,6 +153,32 @@ 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>;
+ };
+};
+
+&sdio1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ bus-width = <4>;
+ max-frequency = <198000000>;
+ cap-sdio-irq;
+ keep-power-in-suspend;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ non-removable;
+ status = "okay";
+};
+
&dpu {
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2 2/2] riscv: dts: thead: Enable WiFi on Lichee Pi 4A
2026-05-08 11:44 ` [PATCH v2 2/2] riscv: dts: thead: Enable WiFi on Lichee Pi 4A MoeLeak
@ 2026-05-27 13:19 ` Drew Fustini
0 siblings, 0 replies; 6+ messages in thread
From: Drew Fustini @ 2026-05-27 13:19 UTC (permalink / raw)
To: MoeLeak
Cc: Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, devicetree, linux-kernel
On Fri, May 08, 2026 at 07:44:14PM +0800, MoeLeak wrote:
> The Lichee Pi 4A has an RTL8723DS WiFi module connected to the TH1520
> SDIO1 controller. The module reset line is driven through a PCA9557 GPIO
> expander on the I2C1 bus.
>
> Enable I2C1 for the GPIO expander and configure SDIO1 as a non-removable
> 4-bit SDIO bus using an mmc-pwrseq-simple reset sequence so the WiFi
> device can be powered and enumerated.
>
> Signed-off-by: MoeLeak <i@leak.moe>
> ---
> arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 47 +++++++++++++++++++++++
> 1 file changed, 47 insertions(+)
Reviewed-by: Drew Fustini <fustini@kernel.org>
Thanks for fixing up previous revision.
Drew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/2] riscv: dts: thead: Enable Lichee Pi 4A WiFi
2026-05-08 11:44 [PATCH v2 0/2] riscv: dts: thead: Enable Lichee Pi 4A WiFi MoeLeak
2026-05-08 11:44 ` [PATCH v2 1/2] riscv: dts: thead: Add TH1520 I2C1 controller MoeLeak
2026-05-08 11:44 ` [PATCH v2 2/2] riscv: dts: thead: Enable WiFi on Lichee Pi 4A MoeLeak
@ 2026-05-27 13:21 ` Drew Fustini
2 siblings, 0 replies; 6+ messages in thread
From: Drew Fustini @ 2026-05-27 13:21 UTC (permalink / raw)
To: MoeLeak
Cc: Guo Ren, Fu Wei, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, devicetree, linux-kernel
On Fri, May 08, 2026 at 07:44:12PM +0800, MoeLeak wrote:
> Enable the RTL8723DS WiFi module on the Sipeed Lichee Pi 4A.
>
> The module is connected to the TH1520 SDIO1 controller, while its reset
> line is controlled through a PCA9557 GPIO expander on I2C1. Add the I2C1
> controller to the TH1520 SoC description first, then enable the board
> specific I2C1, GPIO expander, MMC power sequencing, and SDIO1 wiring.
>
> Thanks to Drew for the detailed review and for pointing out the missing
> commit message, recipient list, revision notes, and patch split. This v2
> series follows that feedback.
>
> Changes in v2:
> - Split the TH1520 I2C1 controller addition into a separate patch.
> - Add commit messages describing why the changes are needed.
> - Add revision number to the patch subjects.
> - Add MAINTAINERS-derived To/Cc recipients from get_maintainer.pl.
>
> Signed-off-by: MoeLeak <i@leak.moe>
> ---
> MoeLeak (2):
> riscv: dts: thead: Add TH1520 I2C1 controller
> riscv: dts: thead: Enable WiFi on Lichee Pi 4A
>
> arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 47 +++++++++++++++++++++++
> arch/riscv/boot/dts/thead/th1520.dtsi | 11 ++++++
> 2 files changed, 58 insertions(+)
Both patches have been applied to thead-dt-for-next [1] [2].
Thanks,
Drew
[1] https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git/commit/?h=thead-dt-for-next&id=2f60e351633044dee88b63fb1600e284d2476e9c
[2] https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git/commit/?h=thead-dt-for-next&id=a20241c08385c875c4d0deb6c8ffc15f13f5b388
^ permalink raw reply [flat|nested] 6+ messages in thread