Skip to contentSkip to conversation

rockchip: nanopi-r4s: Enable second usb port and fix crash

PATCH In review Justin Klaassen 2 participants 5 messages Jan 31, 2025 – Feb 28, 2025 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rockchip: nanopi-r4s: Enable second usb port and fix crash

The patch enables the second USB3.0 Type-A USB port on the NanoPi R4S board, which prevents a crash when initializing the usb system in U-Boot and allows both Type-A USB ports to be used for booting.

=> usb start
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: "Synchronous Abort" handler, esr 0x96000010, far 0x0

---

 arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi +5 -0
index 69800cc368d..931499b084c 100644
@@ -36,3 +36,8 @@
 		};
 	};
 };
+
+&u2phy1_host {
+	phy-supply = <&vdd_5v>;
+	status = "okay";
+};
Signature · 1 line
2.45.3
#1 lore raw

Hi all,

For reference this is the same issue I was attempting to fix [1] back in April 2024. Since [2] was merged the issue has manifested as a crash whenever the usb system is initialized on nanopi-r4s boards.

[1] https://lists.denx.de/pipermail/u-boot/2024-April/551383.html
[2]
https://source.denx.de/u-boot/u-boot/-/commit/cae4707f25105554f94ad5af1199c7c27edd75e1

Thanks,
Justin

Quoted 35 lines · Justin Klaassen

The patch enables the second USB3.0 Type-A USB port on the NanoPi R4S board, which prevents a crash when initializing the usb system in U-Boot and allows both Type-A USB ports to be used for booting.

=> usb start
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: "Synchronous Abort" handler, esr 0x96000010, far 0x0

---

arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi | 5 +++++

1 file changed, 5 insertions(+)
arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi +5 -1
index 69800cc368d..931499b084c 100644
@@ -36,3 +36,8 @@
 };
 };
 };
+
+&u2phy1_host {
+ phy-supply = <&vdd_5v>;
+ status = "okay";
+};
--

2.45.3

#2 lore raw
In reply to Justin Klaassen

Hi Justin,

Quoted 21 lines · Justin Klaassen

The patch enables the second USB3.0 Type-A USB port on the NanoPi R4S board, which prevents a crash when initializing the usb system in U-Boot and allows both Type-A USB ports to be used for booting.

=> usb start
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: "Synchronous Abort" handler, esr 0x96000010, far 0x0

---

  arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi | 5 +++++
  1 file changed, 5 insertions(+)
arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi +0 -0
index 69800cc368d..931499b084c 100644

arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi line 43

Quoted 8 lines
arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi +5 -0
@@ -36,3 +36,8 @@
  		};
  	};
  };
+
+&u2phy1_host {
+	phy-supply = <&vdd_5v>;
+	status = "okay";
+};

This was disabled in upstream kernel in dts/upstream/src/arm64/rockchip/rk3399-nanopi-r4s.dtsi

Can you also update the upstream kernel dts?

this u2phy1_host should always have the same status as usb_host1_ehci.

Thanks,

- Kever

#3 lore raw

Hi Kever,

Quoted 59 lines · Kever Yang

Hi Justin,

On 2025/2/1 01:06, Justin Klaassen wrote:

The patch enables the second USB3.0 Type-A USB port on the NanoPi R4S

board, which prevents a crash when initializing the usb system in U-Boot

and allows both Type-A USB ports to be used for booting.

=> usb start

starting USB...

Bus usb@fe380000: USB EHCI 1.00

Bus usb@fe3c0000: "Synchronous Abort" handler, esr 0x96000010, far 0x0

---

  arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi | 5 +++++
  1 file changed, 5 insertions(+)
arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi +0 -0

index 69800cc368d..931499b084c 100644

--- a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi

+++ b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi

arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi +5 -0
@@ -36,3 +36,8 @@
 
   };
 
   };
 
  };
 
+
 
+&u2phy1_host {
 
+ phy-supply = <&vdd_5v>;
 
+ status = "okay";
 
+};
Quoted 5 lines

This was disabled in upstream kernel in dts/upstream/src/arm64/rockchip/rk3399-nanopi-r4s.dtsi

Can you also update the upstream kernel dts?

I have sent a patch[1] to make the change upstream in the kernel dts.

[1] https://lore.kernel.org/all/[email protected]/

Quoted 9 lines

this u2phy1_host should always have the same status as usb_host1_ehci.

Thanks,

- Kever

Thanks,
Justin

Reviewed-by on v1 1/1
#4 lore raw
In reply to Justin Klaassen
Quoted 10 lines · Justin Klaassen

The patch enables the second USB3.0 Type-A USB port on the NanoPi R4S board, which prevents a crash when initializing the usb system in U-Boot and allows both Type-A USB ports to be used for booting.

=> usb start
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: "Synchronous Abort" handler, esr 0x96000010, far 0x0

Thanks,
- Kever

Quoted 19 lines

---

  arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi | 5 +++++
  1 file changed, 5 insertions(+)
arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi +5 -0
index 69800cc368d..931499b084c 100644
@@ -36,3 +36,8 @@
  		};
  	};
  };
+
+&u2phy1_host {
+	phy-supply = <&vdd_5v>;
+	status = "okay";
+};