linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/9] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub
       [not found] <20230118044418.875-1-linux.amoon@gmail.com>
@ 2023-01-18  4:44 ` Anand Moon
  2023-01-18  8:26   ` Neil Armstrong
  2023-01-18  4:44 ` [PATCH v2 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2 Anand Moon
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Anand Moon @ 2023-01-18  4:44 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl
  Cc: linux-amlogic, Matthias Kaehlcke, Alexander Stein, Johan Hovold,
	devicetree, linux-arm-kernel, linux-kernel

On Odroid c1 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 usb hub.

Add usb hub regulator as per the schematic.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
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.
---
 arch/arm/boot/dts/meson8b-odroidc1.dts | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
index 04356bc639fa..d1f9ce4742a8 100644
--- a/arch/arm/boot/dts/meson8b-odroidc1.dts
+++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
@@ -281,19 +281,6 @@ &gpio_ao {
 			  "J7 Header Pin 6", "J7 Header Pin 5",
 			  "J7 Header Pin 7", "HDMI_CEC",
 			  "SYS_LED", "", "";
-
-	/*
-	 * WARNING: The USB Hub on the Odroid-C1/C1+ 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.
-	 */
-	usb-hub {
-		gpio-hog;
-		gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
-		output-high;
-		line-name = "usb-hub-reset";
-	};
 };
 
 &ir_receiver {
@@ -381,5 +368,16 @@ &usb1_phy {
 };
 
 &usb1 {
+	dr_mode = "host";
+	#address-cells = <1>;
+	#size-cells = <0>;
 	status = "okay";
+
+	hub@1 {
+		/* Genesys Logic GL852G usb hub */
+		compatible = "usb5e3,610";
+		reg = <1>;
+		vdd-supply = <&p5v0>;
+		reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
+	};
 };
-- 
2.38.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
       [not found] <20230118044418.875-1-linux.amoon@gmail.com>
  2023-01-18  4:44 ` [PATCH v2 2/9] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub Anand Moon
@ 2023-01-18  4:44 ` Anand Moon
  2023-01-18  8:27   ` Neil Armstrong
  2023-01-18  4:44 ` [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4 Anand Moon
  2023-01-18  4:44 ` [PATCH v2 9/9] arm64: defconfig: Enable USB onboard HUB driver Anand Moon
  3 siblings, 1 reply; 11+ messages in thread
From: Anand Moon @ 2023-01-18  4:44 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl
  Cc: linux-amlogic, Matthias Kaehlcke, Alexander Stein, Johan Hovold,
	devicetree, linux-arm-kernel, linux-kernel

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.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
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  | 26 ++++++++-----------
 1 file changed, 11 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..01356437a077 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,16 @@ &usb0 {
 };
 
 &usb1 {
+	dr_mode = "host";
+	#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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4
       [not found] <20230118044418.875-1-linux.amoon@gmail.com>
  2023-01-18  4:44 ` [PATCH v2 2/9] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub Anand Moon
  2023-01-18  4:44 ` [PATCH v2 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2 Anand Moon
@ 2023-01-18  4:44 ` Anand Moon
  2023-01-18  8:29   ` Neil Armstrong
  2023-01-18  4:44 ` [PATCH v2 9/9] arm64: defconfig: Enable USB onboard HUB driver Anand Moon
  3 siblings, 1 reply; 11+ messages in thread
From: Anand Moon @ 2023-01-18  4:44 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl
  Cc: linux-amlogic, Matthias Kaehlcke, Alexander Stein, Johan Hovold,
	devicetree, linux-arm-kernel, linux-kernel

On Odroid c4 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.

USB hub is combination of USB 2.0 and USB 3.0 root hub so
use peer-hub node to link then.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
v2: - fix the compatible string.
    - Fix the hub node to use peer-hub to link the usb 2.0 and usb 3.0.
---
 .../boot/dts/amlogic/meson-sm1-odroid-c4.dts  | 36 ++++++++++++-------
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
index 8c30ce63686e..d04768a66bfe 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
@@ -26,20 +26,30 @@ led-blue {
 	sound {
 		model = "ODROID-C4";
 	};
-};
 
-&gpio {
-	/*
-	 * WARNING: The USB Hub on the Odroid-C4 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 = <GPIOH_4 GPIO_ACTIVE_HIGH>;
-		output-high;
-		line-name = "usb-hub-reset";
+	/* USB hub supports both USB 2.0 and USB 3.0 root hub */
+	usb-hub {
+		dr_mode = "host";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/* 2.0 hub on port 1 */
+		hub_2_0: hub@1 {
+			compatible = "usb2109,2817";
+			reg = <1>;
+			peer-hub = <&hub_3_0>;
+			reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
+			vdd-supply = <&vcc_5v>;
+		};
+
+		/* 3.1 hub on port 4 */
+		hub_3_0: hub@2 {
+			compatible = "usb2109,817";
+			reg = <2>;
+			peer-hub = <&hub_2_0>;
+			reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
+			vdd-supply = <&vcc_5v>;
+		};
 	};
 };
 
-- 
2.38.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 9/9] arm64: defconfig: Enable USB onboard HUB driver
       [not found] <20230118044418.875-1-linux.amoon@gmail.com>
                   ` (2 preceding siblings ...)
  2023-01-18  4:44 ` [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4 Anand Moon
@ 2023-01-18  4:44 ` Anand Moon
  2023-01-18  8:29   ` Neil Armstrong
  3 siblings, 1 reply; 11+ messages in thread
From: Anand Moon @ 2023-01-18  4:44 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: linux-amlogic, Matthias Kaehlcke, Alexander Stein, Johan Hovold,
	linux-arm-kernel, linux-kernel

Enable the USB onboard HUB driver, used on Amlogic boards.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
v2: - none
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 851e8f9be06d..42c3528a2473 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -923,6 +923,7 @@ CONFIG_USB_SERIAL_CP210X=m
 CONFIG_USB_SERIAL_FTDI_SIO=m
 CONFIG_USB_SERIAL_OPTION=m
 CONFIG_USB_HSIC_USB3503=y
+CONFIG_USB_ONBOARD_HUB=m
 CONFIG_NOP_USB_XCEIV=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_RENESAS_USBHS_UDC=m
-- 
2.38.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/9] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub
  2023-01-18  4:44 ` [PATCH v2 2/9] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub Anand Moon
@ 2023-01-18  8:26   ` Neil Armstrong
  0 siblings, 0 replies; 11+ messages in thread
From: Neil Armstrong @ 2023-01-18  8:26 UTC (permalink / raw)
  To: Anand Moon, Rob Herring, Krzysztof Kozlowski, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl
  Cc: linux-amlogic, Matthias Kaehlcke, Alexander Stein, Johan Hovold,
	devicetree, linux-arm-kernel, linux-kernel

On 18/01/2023 05:44, Anand Moon wrote:
> On Odroid c1 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 usb hub.
> 
> Add usb hub regulator as per the schematic.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> 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.
> ---
>   arch/arm/boot/dts/meson8b-odroidc1.dts | 24 +++++++++++-------------
>   1 file changed, 11 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
> index 04356bc639fa..d1f9ce4742a8 100644
> --- a/arch/arm/boot/dts/meson8b-odroidc1.dts
> +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
> @@ -281,19 +281,6 @@ &gpio_ao {
>   			  "J7 Header Pin 6", "J7 Header Pin 5",
>   			  "J7 Header Pin 7", "HDMI_CEC",
>   			  "SYS_LED", "", "";
> -
> -	/*
> -	 * WARNING: The USB Hub on the Odroid-C1/C1+ 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.
> -	 */
> -	usb-hub {
> -		gpio-hog;
> -		gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
> -		output-high;
> -		line-name = "usb-hub-reset";
> -	};
>   };
>   
>   &ir_receiver {
> @@ -381,5 +368,16 @@ &usb1_phy {
>   };
>   
>   &usb1 {
> +	dr_mode = "host";
> +	#address-cells = <1>;
> +	#size-cells = <0>;
>   	status = "okay";
> +
> +	hub@1 {
> +		/* Genesys Logic GL852G usb hub */
> +		compatible = "usb5e3,610";
> +		reg = <1>;
> +		vdd-supply = <&p5v0>;
> +		reset-gpio = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
> +	};
>   };

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2
  2023-01-18  4:44 ` [PATCH v2 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2 Anand Moon
@ 2023-01-18  8:27   ` Neil Armstrong
  0 siblings, 0 replies; 11+ messages in thread
From: Neil Armstrong @ 2023-01-18  8:27 UTC (permalink / raw)
  To: Anand Moon, Rob Herring, Krzysztof Kozlowski, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl
  Cc: linux-amlogic, Matthias Kaehlcke, Alexander Stein, Johan Hovold,
	devicetree, linux-arm-kernel, linux-kernel

On 18/01/2023 05:44, 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.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> 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  | 26 ++++++++-----------
>   1 file changed, 11 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..01356437a077 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,16 @@ &usb0 {
>   };
>   
>   &usb1 {
> +	dr_mode = "host";
> +	#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>;
> +	};
>   };

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4
  2023-01-18  4:44 ` [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4 Anand Moon
@ 2023-01-18  8:29   ` Neil Armstrong
  2023-01-18 11:55     ` Anand Moon
  0 siblings, 1 reply; 11+ messages in thread
From: Neil Armstrong @ 2023-01-18  8:29 UTC (permalink / raw)
  To: Anand Moon, Rob Herring, Krzysztof Kozlowski, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl
  Cc: linux-amlogic, Matthias Kaehlcke, Alexander Stein, Johan Hovold,
	devicetree, linux-arm-kernel, linux-kernel

On 18/01/2023 05:44, Anand Moon wrote:
> On Odroid c4 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.
> 
> USB hub is combination of USB 2.0 and USB 3.0 root hub so
> use peer-hub node to link then.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> v2: - fix the compatible string.
>      - Fix the hub node to use peer-hub to link the usb 2.0 and usb 3.0.
> ---
>   .../boot/dts/amlogic/meson-sm1-odroid-c4.dts  | 36 ++++++++++++-------
>   1 file changed, 23 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> index 8c30ce63686e..d04768a66bfe 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> @@ -26,20 +26,30 @@ led-blue {
>   	sound {
>   		model = "ODROID-C4";
>   	};
> -};
>   
> -&gpio {
> -	/*
> -	 * WARNING: The USB Hub on the Odroid-C4 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 = <GPIOH_4 GPIO_ACTIVE_HIGH>;
> -		output-high;
> -		line-name = "usb-hub-reset";
> +	/* USB hub supports both USB 2.0 and USB 3.0 root hub */
> +	usb-hub {
> +		dr_mode = "host";

Is this really needed ?

> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		/* 2.0 hub on port 1 */
> +		hub_2_0: hub@1 {
> +			compatible = "usb2109,2817";
> +			reg = <1>;
> +			peer-hub = <&hub_3_0>;
> +			reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
> +			vdd-supply = <&vcc_5v>;
> +		};
> +
> +		/* 3.1 hub on port 4 */
> +		hub_3_0: hub@2 {
> +			compatible = "usb2109,817";
> +			reg = <2>;
> +			peer-hub = <&hub_2_0>;
> +			reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
> +			vdd-supply = <&vcc_5v>;
> +		};

The final discussion in v1 was to drop this /usb-hub node and move the
hub_2_0 & hub_3_0 node under the dwc3 node.

Neil

>   	};
>   };
>   


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 9/9] arm64: defconfig: Enable USB onboard HUB driver
  2023-01-18  4:44 ` [PATCH v2 9/9] arm64: defconfig: Enable USB onboard HUB driver Anand Moon
@ 2023-01-18  8:29   ` Neil Armstrong
  0 siblings, 0 replies; 11+ messages in thread
From: Neil Armstrong @ 2023-01-18  8:29 UTC (permalink / raw)
  To: Anand Moon, Catalin Marinas, Will Deacon
  Cc: linux-amlogic, Matthias Kaehlcke, Alexander Stein, Johan Hovold,
	linux-arm-kernel, linux-kernel

On 18/01/2023 05:44, Anand Moon wrote:
> Enable the USB onboard HUB driver, used on Amlogic boards.
> 
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> v2: - none
> ---
>   arch/arm64/configs/defconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index 851e8f9be06d..42c3528a2473 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -923,6 +923,7 @@ CONFIG_USB_SERIAL_CP210X=m
>   CONFIG_USB_SERIAL_FTDI_SIO=m
>   CONFIG_USB_SERIAL_OPTION=m
>   CONFIG_USB_HSIC_USB3503=y
> +CONFIG_USB_ONBOARD_HUB=m
>   CONFIG_NOP_USB_XCEIV=y
>   CONFIG_USB_GADGET=y
>   CONFIG_USB_RENESAS_USBHS_UDC=m

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4
  2023-01-18  8:29   ` Neil Armstrong
@ 2023-01-18 11:55     ` Anand Moon
  2023-01-18 13:24       ` neil.armstrong
  0 siblings, 1 reply; 11+ messages in thread
From: Anand Moon @ 2023-01-18 11:55 UTC (permalink / raw)
  To: neil.armstrong
  Cc: Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, linux-amlogic, Matthias Kaehlcke,
	Alexander Stein, Johan Hovold, devicetree, linux-arm-kernel,
	linux-kernel

Hi Neil,

Thanks for your review comments.

On Wed, 18 Jan 2023 at 13:59, Neil Armstrong <neil.armstrong@linaro.org> wrote:
>
> On 18/01/2023 05:44, Anand Moon wrote:
> > On Odroid c4 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.
> >
> > USB hub is combination of USB 2.0 and USB 3.0 root hub so
> > use peer-hub node to link then.
> >
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> > v2: - fix the compatible string.
> >      - Fix the hub node to use peer-hub to link the usb 2.0 and usb 3.0.
> > ---
> >   .../boot/dts/amlogic/meson-sm1-odroid-c4.dts  | 36 ++++++++++++-------
> >   1 file changed, 23 insertions(+), 13 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> > index 8c30ce63686e..d04768a66bfe 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> > +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> > @@ -26,20 +26,30 @@ led-blue {
> >       sound {
> >               model = "ODROID-C4";
> >       };
> > -};
> >
> > -&gpio {
> > -     /*
> > -      * WARNING: The USB Hub on the Odroid-C4 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 = <GPIOH_4 GPIO_ACTIVE_HIGH>;
> > -             output-high;
> > -             line-name = "usb-hub-reset";
> > +     /* USB hub supports both USB 2.0 and USB 3.0 root hub */
> > +     usb-hub {
> > +             dr_mode = "host";
>
> Is this really needed ?
>
I got carried forward from the other device tree binding,
If not needed I will drop this.

> > +             #address-cells = <1>;
> > +             #size-cells = <0>;
> > +
> > +             /* 2.0 hub on port 1 */
> > +             hub_2_0: hub@1 {
> > +                     compatible = "usb2109,2817";
> > +                     reg = <1>;
> > +                     peer-hub = <&hub_3_0>;
> > +                     reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
> > +                     vdd-supply = <&vcc_5v>;
> > +             };
> > +
> > +             /* 3.1 hub on port 4 */
> > +             hub_3_0: hub@2 {
> > +                     compatible = "usb2109,817";
> > +                     reg = <2>;
> > +                     peer-hub = <&hub_2_0>;
> > +                     reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
> > +                     vdd-supply = <&vcc_5v>;
> > +             };
>
> The final discussion in v1 was to drop this /usb-hub node and move the
> hub_2_0 & hub_3_0 node under the dwc3 node.
>

Yes, but It did not work back then, since these are two different events
USB node will try to bring the PHY and dwc2 and dwc2 nodes up.
USB hub supports the reset of the USB hub and links the power supply
to the ports.
This works on this board.

> Neil
>
Thanks

-Anand

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4
  2023-01-18 11:55     ` Anand Moon
@ 2023-01-18 13:24       ` neil.armstrong
  2023-01-19  7:26         ` Anand Moon
  0 siblings, 1 reply; 11+ messages in thread
From: neil.armstrong @ 2023-01-18 13:24 UTC (permalink / raw)
  To: Anand Moon
  Cc: Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, linux-amlogic, Matthias Kaehlcke,
	Alexander Stein, Johan Hovold, devicetree, linux-arm-kernel,
	linux-kernel

On 18/01/2023 12:55, Anand Moon wrote:
> Hi Neil,
> 
> Thanks for your review comments.
> 
> On Wed, 18 Jan 2023 at 13:59, Neil Armstrong <neil.armstrong@linaro.org> wrote:
>>
>> On 18/01/2023 05:44, Anand Moon wrote:
>>> On Odroid c4 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.
>>>
>>> USB hub is combination of USB 2.0 and USB 3.0 root hub so
>>> use peer-hub node to link then.
>>>
>>> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
>>> ---
>>> v2: - fix the compatible string.
>>>       - Fix the hub node to use peer-hub to link the usb 2.0 and usb 3.0.
>>> ---
>>>    .../boot/dts/amlogic/meson-sm1-odroid-c4.dts  | 36 ++++++++++++-------
>>>    1 file changed, 23 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
>>> index 8c30ce63686e..d04768a66bfe 100644
>>> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
>>> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
>>> @@ -26,20 +26,30 @@ led-blue {
>>>        sound {
>>>                model = "ODROID-C4";
>>>        };
>>> -};
>>>
>>> -&gpio {
>>> -     /*
>>> -      * WARNING: The USB Hub on the Odroid-C4 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 = <GPIOH_4 GPIO_ACTIVE_HIGH>;
>>> -             output-high;
>>> -             line-name = "usb-hub-reset";
>>> +     /* USB hub supports both USB 2.0 and USB 3.0 root hub */
>>> +     usb-hub {
>>> +             dr_mode = "host";
>>
>> Is this really needed ?
>>
> I got carried forward from the other device tree binding,
> If not needed I will drop this.
> 
>>> +             #address-cells = <1>;
>>> +             #size-cells = <0>;
>>> +
>>> +             /* 2.0 hub on port 1 */
>>> +             hub_2_0: hub@1 {
>>> +                     compatible = "usb2109,2817";
>>> +                     reg = <1>;
>>> +                     peer-hub = <&hub_3_0>;
>>> +                     reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
>>> +                     vdd-supply = <&vcc_5v>;
>>> +             };
>>> +
>>> +             /* 3.1 hub on port 4 */
>>> +             hub_3_0: hub@2 {
>>> +                     compatible = "usb2109,817";
>>> +                     reg = <2>;
>>> +                     peer-hub = <&hub_2_0>;
>>> +                     reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
>>> +                     vdd-supply = <&vcc_5v>;
>>> +             };
>>
>> The final discussion in v1 was to drop this /usb-hub node and move the
>> hub_2_0 & hub_3_0 node under the dwc3 node.
>>
> 
> Yes, but It did not work back then, since these are two different events
> USB node will try to bring the PHY and dwc2 and dwc2 nodes up.
> USB hub supports the reset of the USB hub and links the power supply
> to the ports.
> This works on this board.

Forget the dwc2 node, the dwc2 since GXL is device mode only, so you need to put both
nodes in the dwc3 node which is host-only.

Neil

> 
>> Neil
>>
> Thanks
> 
> -Anand


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4
  2023-01-18 13:24       ` neil.armstrong
@ 2023-01-19  7:26         ` Anand Moon
  0 siblings, 0 replies; 11+ messages in thread
From: Anand Moon @ 2023-01-19  7:26 UTC (permalink / raw)
  To: neil.armstrong
  Cc: Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, linux-amlogic, Matthias Kaehlcke,
	Alexander Stein, Johan Hovold, devicetree, linux-arm-kernel,
	linux-kernel

Hi Neil,

On Wed, 18 Jan 2023 at 18:54, <neil.armstrong@linaro.org> wrote:
>
> On 18/01/2023 12:55, Anand Moon wrote:
> > Hi Neil,
> >
> > Thanks for your review comments.
> >
> > On Wed, 18 Jan 2023 at 13:59, Neil Armstrong <neil.armstrong@linaro.org> wrote:
> >>
> >> On 18/01/2023 05:44, Anand Moon wrote:
> >>> On Odroid c4 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.
> >>>
> >>> USB hub is combination of USB 2.0 and USB 3.0 root hub so
> >>> use peer-hub node to link then.
> >>>
> >>> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> >>> ---
> >>> v2: - fix the compatible string.
> >>>       - Fix the hub node to use peer-hub to link the usb 2.0 and usb 3.0.
> >>> ---
> >>>    .../boot/dts/amlogic/meson-sm1-odroid-c4.dts  | 36 ++++++++++++-------
> >>>    1 file changed, 23 insertions(+), 13 deletions(-)
> >>>
> >>> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> >>> index 8c30ce63686e..d04768a66bfe 100644
> >>> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> >>> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts
> >>> @@ -26,20 +26,30 @@ led-blue {
> >>>        sound {
> >>>                model = "ODROID-C4";
> >>>        };
> >>> -};
> >>>
> >>> -&gpio {
> >>> -     /*
> >>> -      * WARNING: The USB Hub on the Odroid-C4 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 = <GPIOH_4 GPIO_ACTIVE_HIGH>;
> >>> -             output-high;
> >>> -             line-name = "usb-hub-reset";
> >>> +     /* USB hub supports both USB 2.0 and USB 3.0 root hub */
> >>> +     usb-hub {
> >>> +             dr_mode = "host";
> >>
> >> Is this really needed ?
> >>
> > I got carried forward from the other device tree binding,
> > If not needed I will drop this.
> >
> >>> +             #address-cells = <1>;
> >>> +             #size-cells = <0>;
> >>> +
> >>> +             /* 2.0 hub on port 1 */
> >>> +             hub_2_0: hub@1 {
> >>> +                     compatible = "usb2109,2817";
> >>> +                     reg = <1>;
> >>> +                     peer-hub = <&hub_3_0>;
> >>> +                     reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
> >>> +                     vdd-supply = <&vcc_5v>;
> >>> +             };
> >>> +
> >>> +             /* 3.1 hub on port 4 */
> >>> +             hub_3_0: hub@2 {
> >>> +                     compatible = "usb2109,817";
> >>> +                     reg = <2>;
> >>> +                     peer-hub = <&hub_2_0>;
> >>> +                     reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
> >>> +                     vdd-supply = <&vcc_5v>;
> >>> +             };
> >>
> >> The final discussion in v1 was to drop this /usb-hub node and move the
> >> hub_2_0 & hub_3_0 node under the dwc3 node.
> >>
> >
> > Yes, but It did not work back then, since these are two different events
> > USB node will try to bring the PHY and dwc2 and dwc2 nodes up.
> > USB hub supports the reset of the USB hub and links the power supply
> > to the ports.
> > This works on this board.
>
> Forget the dwc2 node, the dwc2 since GXL is device mode only, so you need to put both
> nodes in the dwc3 node which is host-only.
>
> Neil
>
Ok, I will move this node under dwc3 node, in the next version.

> >
> >> Neil

Thanks
-Anand

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-01-19  7:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230118044418.875-1-linux.amoon@gmail.com>
2023-01-18  4:44 ` [PATCH v2 2/9] ARM: dts: amlogic: Used onboard usb hub reset to enable usb hub Anand Moon
2023-01-18  8:26   ` Neil Armstrong
2023-01-18  4:44 ` [PATCH v2 3/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c2 Anand Moon
2023-01-18  8:27   ` Neil Armstrong
2023-01-18  4:44 ` [PATCH v2 7/9] arm64: dts: amlogic: Used onboard usb hub reset on odroid c4 Anand Moon
2023-01-18  8:29   ` Neil Armstrong
2023-01-18 11:55     ` Anand Moon
2023-01-18 13:24       ` neil.armstrong
2023-01-19  7:26         ` Anand Moon
2023-01-18  4:44 ` [PATCH v2 9/9] arm64: defconfig: Enable USB onboard HUB driver Anand Moon
2023-01-18  8:29   ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).