Skip to contentSkip to conversation

Add Additional Functionality to Indiedroid Nova

PATCH Applied Chris Morgan 2 participants 5 messages Sep 18, 2023 – Oct 4, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Add Additional Functionality to Indiedroid Nova

From: Chris Morgan <[email protected]>

Update the Indiedroid Nova device tree to benefit from hardware that has recently been enabled in the mainline kernel. This includes enabling the PCI Express bus to activate the RTL8111 ethernet controller, the USB-A 2.0 ports (USB 3.0 still pending), and the ADC controller with the boot and recovery buttons.

Changes from V1:
- Correct node names for adc buttons.

Chris Morgan (3):
arm64: dts: rockchip: add PCIe to rk3588s-indiedroid-nova
arm64: dts: rockchip: add USB2 to rk3588s-indiedroid
arm64: dts: rockchip: Add saradc node to Indiedroid Nova

 .../dts/rockchip/rk3588s-indiedroid-nova.dts  | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/3 arm64: dts: rockchip: add PCIe to rk3588s-indiedroid-nova

From: Chris Morgan <[email protected]>

Add the necessary nodes to the Indiedroid Nova to activate the PCI express port that is used by the RTL8111 ethernet controller.

---
 .../dts/rockchip/rk3588s-indiedroid-nova.dts     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts +16 -0
index d1503a4b233a..646f49cc9e53 100644
@@ -109,6 +109,10 @@ vcc5v0_usbdcin: vcc5v0-usbdcin-regulator {
 	};
 };
 
+&combphy0_ps {
+	status = "okay";
+};
+
 &cpu_l0 {
 	cpu-supply = <&vdd_cpu_lit_s0>;
 };
@@ -348,6 +352,12 @@ i2s0_8ch_p0_0: endpoint {
 	};
 };
 
+&pcie2x1l2 {
+	pinctrl-0 = <&rtl8111_perstb>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
 &pinctrl {
 	bluetooth-pins {
 		bt_reset: bt-reset {
@@ -366,6 +376,12 @@ bt_wake_host: bt-wake-host {
 		};
 	};
 
+	ethernet-pins {
+		rtl8111_perstb: rtl8111-perstb {
+			rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
 	hym8563 {
 
 		hym8563_int: hym8563-int {
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 2/3 arm64: dts: rockchip: add USB2 to rk3588s-indiedroid

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Enable USB2 (EHCI and OCHI mode) support for the Indiedroid Nova. This adds support for USB for the 4 full size USB-A ports. Note that USB 3 (the two blue full-size USB-A ports) is still outstanding, as is support for USB on the USB-C ports. The controller is not yet supported for these ports.

---
 .../dts/rockchip/rk3588s-indiedroid-nova.dts  | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts +34 -0
index 646f49cc9e53..1e2336d3065b 100644
@@ -751,6 +751,24 @@ &tsadc {
 	status = "okay";
 };
 
+&u2phy2 {
+	status = "okay";
+};
+
+&u2phy2_host {
+	phy-supply = <&vcc5v0_usb>;
+	status = "okay";
+};
+
+&u2phy3 {
+	status = "okay";
+};
+
+&u2phy3_host {
+	phy-supply = <&vcc5v0_usb>;
+	status = "okay";
+};
+
 &uart2 {
 	pinctrl-0 = <&uart2m0_xfer>;
 	status = "okay";
@@ -775,3 +793,19 @@ bluetooth {
 		pinctrl-names = "default";
 	};
 };
+
+&usb_host0_ehci {
+	status = "okay";
+};
+
+&usb_host0_ohci {
+	status = "okay";
+};
+
+&usb_host1_ehci {
+	status = "okay";
+};
+
+&usb_host1_ohci {
+	status = "okay";
+};
Signature · 1 line
2.34.1
#3 lore raw

PATCH v2 3/3 arm64: dts: rockchip: Add saradc node to Indiedroid Nova

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add ADC support for the Indiedroid Nova, as well as the two ADC buttons found on the device. The buttons are documented as "boot" and "recovery". The boot button is used by the bootloader to boot into USB recovery mode. The recovery button use is currently unknown.

---
 .../dts/rockchip/rk3588s-indiedroid-nova.dts  | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts +34 -0
index 1e2336d3065b..60f00ceb630e 100644
@@ -3,6 +3,7 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/usb/pd.h>
 #include "rk3588s.dtsi"
@@ -11,6 +12,34 @@ / {
 	model = "Indiedroid Nova";
 	compatible = "indiedroid,nova", "rockchip,rk3588s";
 
+	adc-keys-0 {
+		compatible = "adc-keys";
+		io-channel-names = "buttons";
+		io-channels = <&saradc 0>;
+		keyup-threshold-microvolt = <1800000>;
+		poll-interval = <100>;
+
+		button-boot {
+			label = "boot";
+			linux,code = <KEY_PROG1>;
+			press-threshold-microvolt = <18000>;
+		};
+	};
+
+	adc-keys-1 {
+		compatible = "adc-keys";
+		io-channel-names = "buttons";
+		io-channels = <&saradc 1>;
+		keyup-threshold-microvolt = <1800000>;
+		poll-interval = <100>;
+
+		button-recovery {
+			label = "recovery";
+			linux,code = <KEY_PROG2>;
+			press-threshold-microvolt = <18000>;
+		};
+	};
+
 	aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
@@ -410,6 +439,11 @@ typec5v_pwren: typec5v-pwren {
 	};
 };
 
+&saradc {
+	vref-supply = <&vcca_1v8_s0>;
+	status = "okay";
+};
+
 /* HS400 modes seemed to cause io errors. */
 &sdhci {
 	bus-width = <8>;
Signature · 1 line
2.34.1
maintainer Applied
#4 lore raw
In reply to Chris Morgan
Quoted 9 lines · Chris Morgan

From: Chris Morgan <[email protected]>

Update the Indiedroid Nova device tree to benefit from hardware that has recently been enabled in the mainline kernel. This includes enabling the PCI Express bus to activate the RTL8111 ethernet controller, the USB-A 2.0 ports (USB 3.0 still pending), and the ADC controller with the boot and recovery buttons.

[...]

Applied, thanks!

[1/3] arm64: dts: rockchip: add PCIe to rk3588s-indiedroid-nova

      commit: f5fb02c7125e3564aa773f54add37655d09e64f1
[2/3] arm64: dts: rockchip: add USB2 to rk3588s-indiedroid
      commit: aee432b50f6e15886bddcb6f92028265db4b254e
[3/3] arm64: dts: rockchip: Add saradc node to Indiedroid Nova
      commit: f48a288a4a65bc8c3830b4295afb98101f234412

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>