[U-Boot] [PATCH] arm64: allwinner: a64: Disable ehci1 and ohci1 for bananapi, nanopi

Jagan Teki jagannadh.teki at gmail.com
Mon Jul 2 20:53:02 UTC 2018


During usb shutdown or 'usb reset' all the necessary clocks
on the specific controller will disable. Usually this shutdown
happen during U-Boot proper handoff to Linux.

There is an issue in Allwinner A64, is during OHCI1 shutdown
the controller is unable to access the register space
so the Linux boot hangs at this place.

This particular condition occur when we enable both the
controllers, so this patch will disable OHCI1 and EHCI1 for
bananapi-m64 and nanopi-a64 boards. It will re-enable the same
once the issue got fixed.

Log:
=> usb reset
resetting USB...

PHY0: mask = 0x101, usb_clk_cfg = 0x30202
sunxi_musb_exit: ahb_gate0  = 0x33004540, reset0_cfg = 0x33004540
EHCI failed to shut down host controller.
ehci_usb_remove: ahb_gate0  = 0x32004540, reset0_cfg = 0x32004540
ohci_usb_remove: ahb_gate0  = 0x22004540, reset0_cfg = 0x22004540
ohci_usb_remove: mask = 0x10000, usb_clk_cfg = 0x20202

PHY1: mask = 0x202, usb_clk_cfg = 0x0
ehci_usb_remove: ahb_gate0  = 0x20004540, reset0_cfg = 0x20004540

<< hang here >>

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
Note:
Reason for this patch, since we have week to release.
Hopefully this will fix in coming releases.

debugging:
=========
Allwinner A64 share common PHY between OTG & Host controller,
so it's job of OTG to shutdown the controller. But unfortunately
there is no shutdown call from command(usb reset) or handoff code
for OTG controller in gadget mode, UCLASS_USB_DEV_GENERIC.

So, we added glue code to shutdown musb, and it's shutdown
propely.

Then we found an issue of disabling OHCI1 gate clock
during OHCI0 shutdown. ohci driver is trying to clear BIT(16)
for OHCI0, but it also clears BIT(17), which is for OHCI1.
fortunately this is resolved when we clear usb_clk_cfg after
reset0_cfg and ahb_gate0, but OHCI1 still hang.

so, we still need to figure it out. Any help appreciated.

Above log reproduced on
https://github.com/amarula/u-boot-amarula/tree/sun-dev
repo since it has some fixes and improvements wrt mainline code.

 arch/arm/dts/sun50i-a64-bananapi-m64.dts | 8 --------
 arch/arm/dts/sun50i-a64-nanopi-a64.dts   | 8 --------
 2 files changed, 16 deletions(-)

diff --git a/arch/arm/dts/sun50i-a64-bananapi-m64.dts b/arch/arm/dts/sun50i-a64-bananapi-m64.dts
index dcde4a4881..32e3402998 100644
--- a/arch/arm/dts/sun50i-a64-bananapi-m64.dts
+++ b/arch/arm/dts/sun50i-a64-bananapi-m64.dts
@@ -72,10 +72,6 @@
 	status = "okay";
 };
 
-&ehci1 {
-	status = "okay";
-};
-
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c1_pins>;
@@ -120,10 +116,6 @@
 	status = "okay";
 };
 
-&ohci1 {
-	status = "okay";
-};
-
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
diff --git a/arch/arm/dts/sun50i-a64-nanopi-a64.dts b/arch/arm/dts/sun50i-a64-nanopi-a64.dts
index 778636c73a..ba36944caa 100644
--- a/arch/arm/dts/sun50i-a64-nanopi-a64.dts
+++ b/arch/arm/dts/sun50i-a64-nanopi-a64.dts
@@ -70,10 +70,6 @@
 	status = "okay";
 };
 
-&ehci1 {
-	status = "okay";
-};
-
 /* i2c1 connected with gpio headers like pine64, bananapi */
 &i2c1 {
 	pinctrl-names = "default";
@@ -100,10 +96,6 @@
 	status = "okay";
 };
 
-&ohci1 {
-	status = "okay";
-};
-
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
-- 
2.17.1



More information about the U-Boot mailing list