Skip to contentSkip to conversation

riscv: dts: thead: Enable WiFi on Lichee Pi 4A

PATCH Superseded MoeLeak 2 participants 2 messages Apr 26 – Apr 30

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

MoeLeak

author
#0 lore raw

PATCH 1/1 riscv: dts: thead: Enable WiFi on Lichee Pi 4A

---
 .../boot/dts/thead/th1520-lichee-pi-4a.dts    | 47 +++++++++++++++++++
 arch/riscv/boot/dts/thead/th1520.dtsi         | 11 +++++
 2 files changed, 58 insertions(+)
arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts +47 -0
index 7cb7d28683bc..af6f25ebbf60 100644
@@ -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";
 };
arch/riscv/boot/dts/thead/th1520.dtsi +11 -0
index 5e91dc1d2b9b..94932c51b7e3 100644
@@ -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>;
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 1 line · MoeLeak

There needs to be proper commit message with a description of why the change is being made. Please run scripts/checkpatch.pl before resending as this would have called out the missing commit message.

Also please review Documentation/process/submitting-patches.rst or visit
https://docs.kernel.org/process/submitting-patches.html

Please include revision number in the patch Subject: and also after the '---' line in the patch so it is easier for a reviewer to know what changed.

In addition, the To: and Cc: fields are missing several addresses per MAINTAINERS. Please run scripts/get_maintainer.pl and make sure to include the recommended addresses. For example:

./scripts/get_maintainer.pl -norolestats --separator="," <patch>

However, I have been using the wonderful b4 script for awhile now and it makes the above much easier:

https://b4.docs.kernel.org/en/latest/contributor/overview.html

My flow would be something like:

b4 prep -n your-patch-topic # create new branch for your patch b4 prep --edit-cover # creates the cover letter
b4 prep --auto-to-cc # this adds all the necessary people and lists b4 prep --check # this runs checkpatch
b4 send --reflect # emails just yourself to review before sending b4 send # actually posts your patch to the lists

You don't have to use it for this patch but keep it in mind as it can prevent mistakes and save a lot time.

Quoted 4 lines
---
 .../boot/dts/thead/th1520-lichee-pi-4a.dts    | 47 +++++++++++++++++++
 arch/riscv/boot/dts/thead/th1520.dtsi         | 11 +++++
 2 files changed, 58 insertions(+)

I think these should be split into two separate patches. The first patch would add the i2c node in th1520.dtsi and the second patch would make the changes to th1520-lichee-pi-4a.dts.

Thanks,
Drew