diff mbox series

[3/3] ARM: dts: sun8i: s3: switch PineCube to use OHCI/EHCI only

Message ID 20201122004011.1957325-2-icenowy@aosc.io
State New
Headers show
Series [1/3] ARM: dts: sun8i: v3s: add EHCI/OHCI0 device nodes | expand

Commit Message

Icenowy Zheng Nov. 22, 2020, 12:40 a.m. UTC
The PineCube board features a USB Type-A connector connected to the
SoC's USB pins.

As this is not designed for being used as a USB device, disable OTG
controller and route USB to OHCI/EHCI fixedly.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 arch/arm/boot/dts/sun8i-s3-pinecube.dts | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

Comments

Chen-Yu Tsai Nov. 23, 2020, 3:29 a.m. UTC | #1
On Sun, Nov 22, 2020 at 8:40 AM Icenowy Zheng <icenowy@aosc.io> wrote:
>

> The PineCube board features a USB Type-A connector connected to the

> SoC's USB pins.

>

> As this is not designed for being used as a USB device, disable OTG

> controller and route USB to OHCI/EHCI fixedly.


"Fixedly" does not mean what you likely intended here. "Permanently"
is probably closer.

However since the changes don't actually deal with the routing,
which IIRC is done in the PHY driver, I suggest just dropping
that part.


ChenYu

>

> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>

> ---

>  arch/arm/boot/dts/sun8i-s3-pinecube.dts | 17 ++++++++++++-----

>  1 file changed, 12 insertions(+), 5 deletions(-)

>

> diff --git a/arch/arm/boot/dts/sun8i-s3-pinecube.dts b/arch/arm/boot/dts/sun8i-s3-pinecube.dts

> index 4aa0ee897a0a..c4177c54ef29 100644

> --- a/arch/arm/boot/dts/sun8i-s3-pinecube.dts

> +++ b/arch/arm/boot/dts/sun8i-s3-pinecube.dts

> @@ -78,6 +78,12 @@ csi1_ep: endpoint {

>         };

>  };

>

> +&ehci0 {

> +       phys = <&usbphy 0>;

> +       phy-names = "usb";

> +       status = "okay";

> +};

> +

>  &emac {

>         phy-handle = <&int_mii_phy>;

>         phy-mode = "mii";

> @@ -158,6 +164,12 @@ &mmc1 {

>         status = "okay";

>  };

>

> +&ohci0 {

> +       phys = <&usbphy 0>;

> +       phy-names = "usb";

> +       status = "okay";

> +};

> +

>  &pio {

>         vcc-pd-supply = <&reg_dcdc3>;

>         vcc-pe-supply = <&reg_ldo3>;

> @@ -224,11 +236,6 @@ &uart2 {

>         status = "okay";

>  };

>

> -&usb_otg {

> -       dr_mode = "host";

> -       status = "okay";

> -};

> -

>  &usbphy {

>         usb0_vbus-supply = <&reg_vcc5v0>;

>         status = "okay";

> --

> 2.28.0

>

> --

> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.

> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com.

> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20201122004011.1957325-2-icenowy%40aosc.io.
Maxime Ripard Nov. 23, 2020, 11:43 a.m. UTC | #2
Hi,

On Sun, Nov 22, 2020 at 08:40:11AM +0800, Icenowy Zheng wrote:
> The PineCube board features a USB Type-A connector connected to the

> SoC's USB pins.

> 

> As this is not designed for being used as a USB device, disable OTG

> controller and route USB to OHCI/EHCI fixedly.


It's not designed to be used as one, but does it work? We've had a
number of boards where this happened in the past, and it was usable for
FEL, or any peripheral really.

If it did work, then this is a regression.

Also, you should explain why this is a good idea: if both can act as a
host, then why should we switch to the HCI controllers?

> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>

> ---

>  arch/arm/boot/dts/sun8i-s3-pinecube.dts | 17 ++++++++++++-----

>  1 file changed, 12 insertions(+), 5 deletions(-)

> 

> diff --git a/arch/arm/boot/dts/sun8i-s3-pinecube.dts b/arch/arm/boot/dts/sun8i-s3-pinecube.dts

> index 4aa0ee897a0a..c4177c54ef29 100644

> --- a/arch/arm/boot/dts/sun8i-s3-pinecube.dts

> +++ b/arch/arm/boot/dts/sun8i-s3-pinecube.dts

> @@ -78,6 +78,12 @@ csi1_ep: endpoint {

>  	};

>  };

>  

> +&ehci0 {

> +	phys = <&usbphy 0>;

> +	phy-names = "usb";


This is weird to me to have the PHY set in the DTSI for musb, but not
for the USB controllers.

Maxime
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/sun8i-s3-pinecube.dts b/arch/arm/boot/dts/sun8i-s3-pinecube.dts
index 4aa0ee897a0a..c4177c54ef29 100644
--- a/arch/arm/boot/dts/sun8i-s3-pinecube.dts
+++ b/arch/arm/boot/dts/sun8i-s3-pinecube.dts
@@ -78,6 +78,12 @@  csi1_ep: endpoint {
 	};
 };
 
+&ehci0 {
+	phys = <&usbphy 0>;
+	phy-names = "usb";
+	status = "okay";
+};
+
 &emac {
 	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
@@ -158,6 +164,12 @@  &mmc1 {
 	status = "okay";
 };
 
+&ohci0 {
+	phys = <&usbphy 0>;
+	phy-names = "usb";
+	status = "okay";
+};
+
 &pio {
 	vcc-pd-supply = <&reg_dcdc3>;
 	vcc-pe-supply = <&reg_ldo3>;
@@ -224,11 +236,6 @@  &uart2 {
 	status = "okay";
 };
 
-&usb_otg {
-	dr_mode = "host";
-	status = "okay";
-};
-
 &usbphy {
 	usb0_vbus-supply = <&reg_vcc5v0>;
 	status = "okay";