2023-01-21 18:09:48

by Anand Moon

[permalink] [raw]
Subject: [PATCH v3 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2

On Odroid c2 previously use gpio-hog to reset the usb hub,
switch to used on-board usb hub reset to enable the usb hub
and enable power to hub.

Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Anand Moon <[email protected]>
---
v3 - Add rev by Neil.
droped dr_mode
v2 - drop the vendor name from compatible string.
- move the hub node to USB controller node.
- drop the usb_otg_pwr since it only liked to OTG port
and link p5v0 to the vdd-supply.
---
.../boot/dts/amlogic/meson-gxbb-odroidc2.dts | 25 ++++++++-----------
1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index 201596247fd9..70b10934a811 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -250,21 +250,6 @@ eth_phy0: ethernet-phy@0 {
};
};

-&gpio_ao {
- /*
- * WARNING: The USB Hub on the Odroid-C2 needs a reset signal
- * to be turned high in order to be detected by the USB Controller
- * This signal should be handled by a USB specific power sequence
- * in order to reset the Hub when USB bus is powered down.
- */
- hog-0 {
- gpio-hog;
- gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
- output-high;
- line-name = "usb-hub-reset";
- };
-};
-
&hdmi_tx {
status = "okay";
pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
@@ -414,5 +399,15 @@ &usb0 {
};

&usb1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
status = "okay";
+
+ hub@1 {
+ /* Genesys Logic GL852G USB 2.0 hub */
+ compatible = "usb5e3,610";
+ reg = <1>;
+ vdd-supply = <&p5v0>;
+ reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
+ };
};
--
2.38.1


2023-08-02 22:19:48

by Ben Wolsieffer

[permalink] [raw]
Subject: Re: [PATCH v3 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2

On Sat, Jan 21, 2023 at 05:56:31PM +0000, Anand Moon wrote:
> On Odroid c2 previously use gpio-hog to reset the usb hub,
> switch to used on-board usb hub reset to enable the usb hub
> and enable power to hub.
>
> Reviewed-by: Neil Armstrong <[email protected]>
> Signed-off-by: Anand Moon <[email protected]>
> ---
> v3 - Add rev by Neil.
> droped dr_mode
> v2 - drop the vendor name from compatible string.
> - move the hub node to USB controller node.
> - drop the usb_otg_pwr since it only liked to OTG port
> and link p5v0 to the vdd-supply.
> ---
> .../boot/dts/amlogic/meson-gxbb-odroidc2.dts | 25 ++++++++-----------
> 1 file changed, 10 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> index 201596247fd9..70b10934a811 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> @@ -250,21 +250,6 @@ eth_phy0: ethernet-phy@0 {
> };
> };
>
> -&gpio_ao {
> - /*
> - * WARNING: The USB Hub on the Odroid-C2 needs a reset signal
> - * to be turned high in order to be detected by the USB Controller
> - * This signal should be handled by a USB specific power sequence
> - * in order to reset the Hub when USB bus is powered down.
> - */
> - hog-0 {
> - gpio-hog;
> - gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
> - output-high;
> - line-name = "usb-hub-reset";
> - };
> -};
> -
> &hdmi_tx {
> status = "okay";
> pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
> @@ -414,5 +399,15 @@ &usb0 {
> };
>
> &usb1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> status = "okay";
> +
> + hub@1 {
> + /* Genesys Logic GL852G USB 2.0 hub */
> + compatible = "usb5e3,610";
> + reg = <1>;
> + vdd-supply = <&p5v0>;
> + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
> + };
> };
> --
> 2.38.1
>

Hello,

This patch breaks USB support on the ODROID-C2. As soon as the
onboard_usb_hub module is loaded, all USB devices disconnect.
Blacklisting onboard_usb_hub makes USB work as expected.

I tried to reproduce the problem by manually toggling the reset line,
but the problem seems to be specific to this driver. When reset is
asserted manually, the devices disconnect, but they all enumerate again
as soon as reset is released.

Also, I have been unable to make USB work again (until the next reboot)
even after unloading onboard_usb_hub.

Ben

2023-08-05 22:44:04

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v3 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2

On 02/08/2023 23:06, Ben Wolsieffer wrote:
> On Sat, Jan 21, 2023 at 05:56:31PM +0000, Anand Moon wrote:
>> On Odroid c2 previously use gpio-hog to reset the usb hub,
>> switch to used on-board usb hub reset to enable the usb hub
>> and enable power to hub.
>>

...

>> + hub@1 {
>> + /* Genesys Logic GL852G USB 2.0 hub */
>> + compatible = "usb5e3,610";
>> + reg = <1>;
>> + vdd-supply = <&p5v0>;
>> + reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
>> + };
>> };
>> --
>> 2.38.1
>>
>
> Hello,
>
> This patch breaks USB support on the ODROID-C2. As soon as the
> onboard_usb_hub module is loaded, all USB devices disconnect.
> Blacklisting onboard_usb_hub makes USB work as expected.
>
> I tried to reproduce the problem by manually toggling the reset line,
> but the problem seems to be specific to this driver. When reset is
> asserted manually, the devices disconnect, but they all enumerate again
> as soon as reset is released.
>
> Also, I have been unable to make USB work again (until the next reboot)
> even after unloading onboard_usb_hub.

Wasn't this patch made exactly to fix USB support, not break it? I might
be missing something but maybe this was not tested at all?

Best regards,
Krzysztof


2023-08-06 01:28:16

by Ben Wolsieffer

[permalink] [raw]
Subject: Re: [PATCH v3 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2

On Sat, Aug 05, 2023 at 11:30:21PM +0200, Krzysztof Kozlowski wrote:
> On 02/08/2023 23:06, Ben Wolsieffer wrote:
> >
> > Hello,
> >
> > This patch breaks USB support on the ODROID-C2. As soon as the
> > onboard_usb_hub module is loaded, all USB devices disconnect.
> > Blacklisting onboard_usb_hub makes USB work as expected.
> >
> > I tried to reproduce the problem by manually toggling the reset line,
> > but the problem seems to be specific to this driver. When reset is
> > asserted manually, the devices disconnect, but they all enumerate again
> > as soon as reset is released.
> >
> > Also, I have been unable to make USB work again (until the next reboot)
> > even after unloading onboard_usb_hub.
>
> Wasn't this patch made exactly to fix USB support, not break it? I might
> be missing something but maybe this was not tested at all?
>
> Best regards,
> Krzysztof
>

I have been using USB on the ODROID-C2 for several years without issues.
It looks to me that this patch was designed to make reset control for
the hub more elegant, rather than fix a specific issue. The same change
was applied to several devices, so it seems plausible that it was not
tested on all of them.

Thanks, Ben

2023-08-06 06:26:33

by Anand Moon

[permalink] [raw]
Subject: Re: [PATCH v3 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2

Hi Ben,

On Sun, 6 Aug 2023 at 05:35, Ben Wolsieffer <[email protected]> wrote:
>
> On Sat, Aug 05, 2023 at 11:30:21PM +0200, Krzysztof Kozlowski wrote:
> > On 02/08/2023 23:06, Ben Wolsieffer wrote:
> > >
> > > Hello,
> > >
> > > This patch breaks USB support on the ODROID-C2. As soon as the
> > > onboard_usb_hub module is loaded, all USB devices disconnect.
> > > Blacklisting onboard_usb_hub makes USB work as expected.
> > >
> > > I tried to reproduce the problem by manually toggling the reset line,
> > > but the problem seems to be specific to this driver. When reset is
> > > asserted manually, the devices disconnect, but they all enumerate again
> > > as soon as reset is released.
> > >
> > > Also, I have been unable to make USB work again (until the next reboot)
> > > even after unloading onboard_usb_hub.
> >
> > Wasn't this patch made exactly to fix USB support, not break it? I might
> > be missing something but maybe this was not tested at all?
> >
> > Best regards,
> > Krzysztof
> >
>
> I have been using USB on the ODROID-C2 for several years without issues.
> It looks to me that this patch was designed to make reset control for
> the hub more elegant, rather than fix a specific issue. The same change
> was applied to several devices, so it seems plausible that it was not
> tested on all of them.
>

We tried to fix quite a few issues in the past but still, we could not
resolve core issues.
Will try to resolve these issues in the future.
I have tested these changes at my end on Odroid C1+, Odroid C2, and Odroid C4,

> Thanks, Ben

Thanks
-Anand