linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] arm: Aspeed DT & config updates for USB
@ 2018-06-29  3:50 Benjamin Herrenschmidt
  2018-06-29  3:51 ` [PATCH 1/7] arm: dts: aspeed: Add aspeed G4 USB pinmux Benjamin Herrenschmidt
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-06-29  3:50 UTC (permalink / raw)
  To: linux-arm-kernel

This updates the device-tree of the Aspeed SoC to better define
the pinmux for the USB host and to add the missing "Virtual Hub"
USB device.

We also enable USB device in the defconfigs and configure a
port as device on the evaluation board.

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

* [PATCH 1/7] arm: dts: aspeed: Add aspeed G4 USB pinmux
  2018-06-29  3:50 [PATCH 0/7] arm: Aspeed DT & config updates for USB Benjamin Herrenschmidt
@ 2018-06-29  3:51 ` Benjamin Herrenschmidt
  2018-07-16  5:17   ` Andrew Jeffery
  2018-06-29  3:51 ` [PATCH 2/7] arm: dts: aspeed: Add aspeed G5 USB host pinmux Benjamin Herrenschmidt
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-06-29  3:51 UTC (permalink / raw)
  To: linux-arm-kernel

Set the default pinmux for EHCI so boards don't have to do
it an document why it is not set for UHCI.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/arm/boot/dts/aspeed-g4.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
index 75df1573380e..1d7ffa9fdb11 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
@@ -113,6 +113,8 @@
 			reg = <0x1e6a1000 0x100>;
 			interrupts = <5>;
 			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usb2h_default>;
 			status = "disabled";
 		};
 
@@ -123,6 +125,10 @@
 			#ports = <3>;
 			clocks = <&syscon ASPEED_CLK_GATE_USBUHCICLK>;
 			status = "disabled";
+			/*
+			 * No default pinmux, it will follow EHCI, use an explicit pinmux
+			 * override if you don't enable EHCI
+			 */
 		};
 
 		apb {
-- 
2.17.1

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

* [PATCH 2/7] arm: dts: aspeed: Add aspeed G5 USB host pinmux
  2018-06-29  3:50 [PATCH 0/7] arm: Aspeed DT & config updates for USB Benjamin Herrenschmidt
  2018-06-29  3:51 ` [PATCH 1/7] arm: dts: aspeed: Add aspeed G4 USB pinmux Benjamin Herrenschmidt
@ 2018-06-29  3:51 ` Benjamin Herrenschmidt
  2018-07-16  5:23   ` Andrew Jeffery
  2018-06-29  3:51 ` [PATCH 3/7] arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub Benjamin Herrenschmidt
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-06-29  3:51 UTC (permalink / raw)
  To: linux-arm-kernel

Set the default pinmux for EHCIs so boards don't have to do
it an document why it is not set for UHCI.

Remove the properties from the AST2500 EVB board which are
now redundant

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/arm/boot/dts/aspeed-ast2500-evb.dts | 6 ------
 arch/arm/boot/dts/aspeed-g5.dtsi         | 8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/aspeed-ast2500-evb.dts b/arch/arm/boot/dts/aspeed-ast2500-evb.dts
index ede11c597673..2bff1b253842 100644
--- a/arch/arm/boot/dts/aspeed-ast2500-evb.dts
+++ b/arch/arm/boot/dts/aspeed-ast2500-evb.dts
@@ -82,18 +82,12 @@
 
 &ehci0 {
 	status = "okay";
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_usb2ah_default>;
 };
 
 &ehci1 {
 	status = "okay";
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_usb2bh_default>;
 };
 
 &uhci {
 	status = "okay";
-
-	/* No pinctrl, this follows the above EHCI settings */
 };
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
index 17f2714d18a7..dfdc239b86f6 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
@@ -148,6 +148,8 @@
 			reg = <0x1e6a1000 0x100>;
 			interrupts = <5>;
 			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usb2ah_default>;
 			status = "disabled";
 		};
 
@@ -156,6 +158,8 @@
 			reg = <0x1e6a3000 0x100>;
 			interrupts = <13>;
 			clocks = <&syscon ASPEED_CLK_GATE_USBPORT2CLK>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usb2bh_default>;
 			status = "disabled";
 		};
 
@@ -166,6 +170,10 @@
 			#ports = <2>;
 			clocks = <&syscon ASPEED_CLK_GATE_USBUHCICLK>;
 			status = "disabled";
+			/*
+			 * No default pinmux, it will follow EHCI, use an explicit pinmux
+			 * override if you don't enable EHCI
+			 */
 		};
 
 		apb {
-- 
2.17.1

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

* [PATCH 3/7] arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub
  2018-06-29  3:50 [PATCH 0/7] arm: Aspeed DT & config updates for USB Benjamin Herrenschmidt
  2018-06-29  3:51 ` [PATCH 1/7] arm: dts: aspeed: Add aspeed G4 USB pinmux Benjamin Herrenschmidt
  2018-06-29  3:51 ` [PATCH 2/7] arm: dts: aspeed: Add aspeed G5 USB host pinmux Benjamin Herrenschmidt
@ 2018-06-29  3:51 ` Benjamin Herrenschmidt
  2018-07-16  5:34   ` Andrew Jeffery
  2018-06-29  3:51 ` [PATCH 4/7] arm: dts: aspeed: Add Aspeed 54 " Benjamin Herrenschmidt
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-06-29  3:51 UTC (permalink / raw)
  To: linux-arm-kernel

This adds the (disabled by default) device node for the
Aspeed virtual hub,a long with clocks and pinmux.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/arm/boot/dts/aspeed-g4.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
index 1d7ffa9fdb11..54524564037c 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
@@ -131,6 +131,16 @@
 			 */
 		};
 
+		vhub: usb-vhub at 1e6a0000 {
+			compatible = "aspeed,ast2400-usb-vhub";
+			reg = <0x1e6a0000 0x300>;
+			interrupts = <5>;
+			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usb2d_default>;
+			status = "disabled";
+		};
+
 		apb {
 			compatible = "simple-bus";
 			#address-cells = <1>;
-- 
2.17.1

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

* [PATCH 4/7] arm: dts: aspeed: Add Aspeed 54 USB Virtual Hub
  2018-06-29  3:50 [PATCH 0/7] arm: Aspeed DT & config updates for USB Benjamin Herrenschmidt
                   ` (2 preceding siblings ...)
  2018-06-29  3:51 ` [PATCH 3/7] arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub Benjamin Herrenschmidt
@ 2018-06-29  3:51 ` Benjamin Herrenschmidt
  2018-07-16  5:36   ` Andrew Jeffery
  2018-06-29  3:51 ` [PATCH 5/7] arm: configs: Add USB gadget to Aspeed G4 defconfig Benjamin Herrenschmidt
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-06-29  3:51 UTC (permalink / raw)
  To: linux-arm-kernel

This adds the (disabled by default) device node for the
Aspeed virtual hub,a long with clocks and pinmux.

This also adds the missing pinmux definition for it
(the kernel driver already knows about it).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/arm/boot/dts/aspeed-g5.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
index dfdc239b86f6..6274d3eaf374 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
@@ -176,6 +176,16 @@
 			 */
 		};
 
+		vhub: usb-vhub at 1e6a0000 {
+			compatible = "aspeed,ast2500-usb-vhub";
+			reg = <0x1e6a0000 0x300>;
+			interrupts = <5>;
+			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usb2ad_default>;
+			status = "disabled";
+		};
+
 		apb {
 			compatible = "simple-bus";
 			#address-cells = <1>;
@@ -1425,6 +1435,11 @@
 		groups = "USB2AH";
 	};
 
+	pinctrl_usb2ad_default: usb2ad_default {
+		function = "USB2AD";
+		groups = "USB2AD";
+	};
+
 	pinctrl_usb11bhid_default: usb11bhid_default {
 		function = "USB11BHID";
 		groups = "USB11BHID";
-- 
2.17.1

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

* [PATCH 5/7] arm: configs: Add USB gadget to Aspeed G4 defconfig
  2018-06-29  3:50 [PATCH 0/7] arm: Aspeed DT & config updates for USB Benjamin Herrenschmidt
                   ` (3 preceding siblings ...)
  2018-06-29  3:51 ` [PATCH 4/7] arm: dts: aspeed: Add Aspeed 54 " Benjamin Herrenschmidt
@ 2018-06-29  3:51 ` Benjamin Herrenschmidt
  2018-07-16  5:37   ` Andrew Jeffery
  2018-06-29  3:51 ` [PATCH 6/7] arm: configs: Add USB gadget to Aspeed G5 defconfig Benjamin Herrenschmidt
  2018-06-29  3:51 ` [PATCH 7/7] arm: dts: aspeed: Enable vhub on port A of AST2500 EVB Benjamin Herrenschmidt
  6 siblings, 1 reply; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-06-29  3:51 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the vhub driver is upstream and the device-trees
updated, let's enable this by default.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/arm/configs/aspeed_g4_defconfig | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/configs/aspeed_g4_defconfig b/arch/arm/configs/aspeed_g4_defconfig
index 95946dee9c77..be714ea088ed 100644
--- a/arch/arm/configs/aspeed_g4_defconfig
+++ b/arch/arm/configs/aspeed_g4_defconfig
@@ -138,6 +138,23 @@ CONFIG_USB_DYNAMIC_MINORS=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_GADGET=y
+CONFIG_U_SERIAL_CONSOLE=y
+CONFIG_USB_ASPEED_VHUB=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_CONFIGFS_SERIAL=y
+CONFIG_USB_CONFIGFS_ACM=y
+CONFIG_USB_CONFIGFS_OBEX=y
+CONFIG_USB_CONFIGFS_NCM=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_ECM_SUBSET=y
+CONFIG_USB_CONFIGFS_RNDIS=y
+CONFIG_USB_CONFIGFS_EEM=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS_F_LB_SS=y
+CONFIG_USB_CONFIGFS_F_FS=y
+CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_USB_CONFIGFS_F_PRINTER=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_CLASS_FLASH=y
-- 
2.17.1

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

* [PATCH 6/7] arm: configs: Add USB gadget to Aspeed G5 defconfig
  2018-06-29  3:50 [PATCH 0/7] arm: Aspeed DT & config updates for USB Benjamin Herrenschmidt
                   ` (4 preceding siblings ...)
  2018-06-29  3:51 ` [PATCH 5/7] arm: configs: Add USB gadget to Aspeed G4 defconfig Benjamin Herrenschmidt
@ 2018-06-29  3:51 ` Benjamin Herrenschmidt
  2018-07-16  5:38   ` Andrew Jeffery
  2018-06-29  3:51 ` [PATCH 7/7] arm: dts: aspeed: Enable vhub on port A of AST2500 EVB Benjamin Herrenschmidt
  6 siblings, 1 reply; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-06-29  3:51 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the vhub driver is upstream and the device-trees
updated, let's enable this by default.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/arm/configs/aspeed_g5_defconfig | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/configs/aspeed_g5_defconfig b/arch/arm/configs/aspeed_g5_defconfig
index 8c7ea033cdc2..38e9b2d43df3 100644
--- a/arch/arm/configs/aspeed_g5_defconfig
+++ b/arch/arm/configs/aspeed_g5_defconfig
@@ -140,6 +140,23 @@ CONFIG_USB_DYNAMIC_MINORS=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_GADGET=y
+CONFIG_U_SERIAL_CONSOLE=y
+CONFIG_USB_ASPEED_VHUB=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_CONFIGFS_SERIAL=y
+CONFIG_USB_CONFIGFS_ACM=y
+CONFIG_USB_CONFIGFS_OBEX=y
+CONFIG_USB_CONFIGFS_NCM=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_ECM_SUBSET=y
+CONFIG_USB_CONFIGFS_RNDIS=y
+CONFIG_USB_CONFIGFS_EEM=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS_F_LB_SS=y
+CONFIG_USB_CONFIGFS_F_FS=y
+CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_USB_CONFIGFS_F_PRINTER=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_CLASS_FLASH=y
-- 
2.17.1

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

* [PATCH 7/7] arm: dts: aspeed: Enable vhub on port A of AST2500 EVB
  2018-06-29  3:50 [PATCH 0/7] arm: Aspeed DT & config updates for USB Benjamin Herrenschmidt
                   ` (5 preceding siblings ...)
  2018-06-29  3:51 ` [PATCH 6/7] arm: configs: Add USB gadget to Aspeed G5 defconfig Benjamin Herrenschmidt
@ 2018-06-29  3:51 ` Benjamin Herrenschmidt
  2018-07-16  5:39   ` Andrew Jeffery
  6 siblings, 1 reply; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-06-29  3:51 UTC (permalink / raw)
  To: linux-arm-kernel

This is an eval board, it makes sense to enable many
functions by default. This changes the device-tree to
set port A to be a USB device and leave port B as a
host, along with a little comment explaining how to
change it.

(the vhub device can only exist on port A on this SoC)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/arm/boot/dts/aspeed-ast2500-evb.dts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/aspeed-ast2500-evb.dts b/arch/arm/boot/dts/aspeed-ast2500-evb.dts
index 2bff1b253842..2375449c02d0 100644
--- a/arch/arm/boot/dts/aspeed-ast2500-evb.dts
+++ b/arch/arm/boot/dts/aspeed-ast2500-evb.dts
@@ -80,7 +80,13 @@
 	};
 };
 
-&ehci0 {
+/*
+ * Enable port A as device (via the virtual hub) and port B as
+ * host by default on the eval board. This can be easily changed
+ * by replacing the override below with &ehci0 { ... } to enable
+ * host on both ports.
+ */
+&vhub {
 	status = "okay";
 };
 
-- 
2.17.1

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

* [PATCH 1/7] arm: dts: aspeed: Add aspeed G4 USB pinmux
  2018-06-29  3:51 ` [PATCH 1/7] arm: dts: aspeed: Add aspeed G4 USB pinmux Benjamin Herrenschmidt
@ 2018-07-16  5:17   ` Andrew Jeffery
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Jeffery @ 2018-07-16  5:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> Set the default pinmux for EHCI so boards don't have to do
> it an document why it is not set for UHCI.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  arch/arm/boot/dts/aspeed-g4.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
> index 75df1573380e..1d7ffa9fdb11 100644
> --- a/arch/arm/boot/dts/aspeed-g4.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g4.dtsi
> @@ -113,6 +113,8 @@
>  			reg = <0x1e6a1000 0x100>;
>  			interrupts = <5>;
>  			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&pinctrl_usb2h_default>;
>  			status = "disabled";
>  		};
>  
> @@ -123,6 +125,10 @@
>  			#ports = <3>;
>  			clocks = <&syscon ASPEED_CLK_GATE_USBUHCICLK>;
>  			status = "disabled";
> +			/*
> +			 * No default pinmux, it will follow EHCI, use an explicit pinmux
> +			 * override if you don't enable EHCI
> +			 */

This is only part of the story on the AST2400 which has 3 USB ports:

* Port 1 is fixed-function UHCI
* Port 2 can be muxed to the UHCI (host) or HID (device) controllers
* Port 3 can be muxed to the EHCI or vHub controllers

I assume if we plug a USB 1.1 device into port 3 it gets rate matched and dealt with (therefore UHCI follows EHCI as suggested in your comment). But given port 2, which *may* route to UHCI *specifically* (not EHCI), UHCI *doesn't* always follow EHCI.

However, port 2 has its other function, HID, and HID is only available on port 2. So, if we had a HID devicetree node, we would put the pinmux for port 2 in there and leave it to the board to configure the HID controller as enabled or not. However, given this conflict, the UHCI node still shouldn't have any pinmux properties as your comment suggests, as it's up to the board whether HID or UHCI mode should be selected for port 2, but we'll need to enable the UHCI controller for port 1 (or 3) and we don't want to force the mux state of port 2 (or 3).

So whilst partially correct, the comment is a bit misleading in that it suggests muxing EHCI is enough in general, which isn't really true. Maybe say instead that due to flexible configuration, UHCI pinmux should be overridden in the platform dts explicitly?

Cheers,

Andrew

>  		};
>  
>  		apb {
> -- 
> 2.17.1
> 

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

* [PATCH 2/7] arm: dts: aspeed: Add aspeed G5 USB host pinmux
  2018-06-29  3:51 ` [PATCH 2/7] arm: dts: aspeed: Add aspeed G5 USB host pinmux Benjamin Herrenschmidt
@ 2018-07-16  5:23   ` Andrew Jeffery
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Jeffery @ 2018-07-16  5:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> Set the default pinmux for EHCIs so boards don't have to do
> it an document why it is not set for UHCI.
> 
> Remove the properties from the AST2500 EVB board which are
> now redundant
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  arch/arm/boot/dts/aspeed-ast2500-evb.dts | 6 ------
>  arch/arm/boot/dts/aspeed-g5.dtsi         | 8 ++++++++
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/aspeed-ast2500-evb.dts b/arch/arm/boot/
> dts/aspeed-ast2500-evb.dts
> index ede11c597673..2bff1b253842 100644
> --- a/arch/arm/boot/dts/aspeed-ast2500-evb.dts
> +++ b/arch/arm/boot/dts/aspeed-ast2500-evb.dts
> @@ -82,18 +82,12 @@
>  
>  &ehci0 {
>  	status = "okay";
> -	pinctrl-names = "default";
> -	pinctrl-0 = <&pinctrl_usb2ah_default>;
>  };
>  
>  &ehci1 {
>  	status = "okay";
> -	pinctrl-names = "default";
> -	pinctrl-0 = <&pinctrl_usb2bh_default>;
>  };
>  
>  &uhci {
>  	status = "okay";
> -
> -	/* No pinctrl, this follows the above EHCI settings */
>  };
> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
> index 17f2714d18a7..dfdc239b86f6 100644
> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
> @@ -148,6 +148,8 @@
>  			reg = <0x1e6a1000 0x100>;
>  			interrupts = <5>;
>  			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&pinctrl_usb2ah_default>;
>  			status = "disabled";
>  		};
>  
> @@ -156,6 +158,8 @@
>  			reg = <0x1e6a3000 0x100>;
>  			interrupts = <13>;
>  			clocks = <&syscon ASPEED_CLK_GATE_USBPORT2CLK>;
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&pinctrl_usb2bh_default>;
>  			status = "disabled";
>  		};
>  
> @@ -166,6 +170,10 @@
>  			#ports = <2>;
>  			clocks = <&syscon ASPEED_CLK_GATE_USBUHCICLK>;
>  			status = "disabled";
> +			/*
> +			 * No default pinmux, it will follow EHCI, use an explicit pinmux
> +			 * override if you don't enable EHCI
> +			 */
>  		};
>  
>  		apb {
> -- 
> 2.17.1
> 

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

* [PATCH 3/7] arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub
  2018-06-29  3:51 ` [PATCH 3/7] arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub Benjamin Herrenschmidt
@ 2018-07-16  5:34   ` Andrew Jeffery
  2018-07-16  6:40     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 17+ messages in thread
From: Andrew Jeffery @ 2018-07-16  5:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> This adds the (disabled by default) device node for the
> Aspeed virtual hub,a long with clocks and pinmux.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  arch/arm/boot/dts/aspeed-g4.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
> index 1d7ffa9fdb11..54524564037c 100644
> --- a/arch/arm/boot/dts/aspeed-g4.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g4.dtsi
> @@ -131,6 +131,16 @@
>  			 */
>  		};
>  
> +		vhub: usb-vhub at 1e6a0000 {
> +			compatible = "aspeed,ast2400-usb-vhub";
> +			reg = <0x1e6a0000 0x300>;
> +			interrupts = <5>;
> +			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&pinctrl_usb2d_default>;
> +			status = "disabled";
> +		};
> +

These are all generic properties, so it's pretty clear what's going on, but it seems there's no bindings document capturing the compatible string? Not wanting to be a pain, but shouldn't we have documented it?

>  		apb {
>  			compatible = "simple-bus";
>  			#address-cells = <1>;
> -- 
> 2.17.1
> 

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

* [PATCH 4/7] arm: dts: aspeed: Add Aspeed 54 USB Virtual Hub
  2018-06-29  3:51 ` [PATCH 4/7] arm: dts: aspeed: Add Aspeed 54 " Benjamin Herrenschmidt
@ 2018-07-16  5:36   ` Andrew Jeffery
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Jeffery @ 2018-07-16  5:36 UTC (permalink / raw)
  To: linux-arm-kernel

Typo: '54' in the subject should be 'G5'

On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> This adds the (disabled by default) device node for the
> Aspeed virtual hub,a long with clocks and pinmux.
> 
> This also adds the missing pinmux definition for it
> (the kernel driver already knows about it).

Whoops! Thanks for catching that.

> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  arch/arm/boot/dts/aspeed-g5.dtsi | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
> index dfdc239b86f6..6274d3eaf374 100644
> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
> @@ -176,6 +176,16 @@
>  			 */
>  		};
>  
> +		vhub: usb-vhub at 1e6a0000 {
> +			compatible = "aspeed,ast2500-usb-vhub";
> +			reg = <0x1e6a0000 0x300>;
> +			interrupts = <5>;
> +			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&pinctrl_usb2ad_default>;
> +			status = "disabled";
> +		};
> +

Same query about the compatible before.

>  		apb {
>  			compatible = "simple-bus";
>  			#address-cells = <1>;
> @@ -1425,6 +1435,11 @@
>  		groups = "USB2AH";
>  	};
>  
> +	pinctrl_usb2ad_default: usb2ad_default {
> +		function = "USB2AD";
> +		groups = "USB2AD";
> +	};
> +
>  	pinctrl_usb11bhid_default: usb11bhid_default {
>  		function = "USB11BHID";
>  		groups = "USB11BHID";
> -- 
> 2.17.1
> 

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

* [PATCH 5/7] arm: configs: Add USB gadget to Aspeed G4 defconfig
  2018-06-29  3:51 ` [PATCH 5/7] arm: configs: Add USB gadget to Aspeed G4 defconfig Benjamin Herrenschmidt
@ 2018-07-16  5:37   ` Andrew Jeffery
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Jeffery @ 2018-07-16  5:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> Now that the vhub driver is upstream and the device-trees
> updated, let's enable this by default.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Acked-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  arch/arm/configs/aspeed_g4_defconfig | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/arch/arm/configs/aspeed_g4_defconfig b/arch/arm/configs/
> aspeed_g4_defconfig
> index 95946dee9c77..be714ea088ed 100644
> --- a/arch/arm/configs/aspeed_g4_defconfig
> +++ b/arch/arm/configs/aspeed_g4_defconfig
> @@ -138,6 +138,23 @@ CONFIG_USB_DYNAMIC_MINORS=y
>  CONFIG_USB_EHCI_HCD=y
>  CONFIG_USB_EHCI_ROOT_HUB_TT=y
>  CONFIG_USB_EHCI_HCD_PLATFORM=y
> +CONFIG_USB_GADGET=y
> +CONFIG_U_SERIAL_CONSOLE=y
> +CONFIG_USB_ASPEED_VHUB=y
> +CONFIG_USB_CONFIGFS=y
> +CONFIG_USB_CONFIGFS_SERIAL=y
> +CONFIG_USB_CONFIGFS_ACM=y
> +CONFIG_USB_CONFIGFS_OBEX=y
> +CONFIG_USB_CONFIGFS_NCM=y
> +CONFIG_USB_CONFIGFS_ECM=y
> +CONFIG_USB_CONFIGFS_ECM_SUBSET=y
> +CONFIG_USB_CONFIGFS_RNDIS=y
> +CONFIG_USB_CONFIGFS_EEM=y
> +CONFIG_USB_CONFIGFS_MASS_STORAGE=y
> +CONFIG_USB_CONFIGFS_F_LB_SS=y
> +CONFIG_USB_CONFIGFS_F_FS=y
> +CONFIG_USB_CONFIGFS_F_HID=y
> +CONFIG_USB_CONFIGFS_F_PRINTER=y
>  CONFIG_NEW_LEDS=y
>  CONFIG_LEDS_CLASS=y
>  CONFIG_LEDS_CLASS_FLASH=y
> -- 
> 2.17.1
> 

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

* [PATCH 6/7] arm: configs: Add USB gadget to Aspeed G5 defconfig
  2018-06-29  3:51 ` [PATCH 6/7] arm: configs: Add USB gadget to Aspeed G5 defconfig Benjamin Herrenschmidt
@ 2018-07-16  5:38   ` Andrew Jeffery
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Jeffery @ 2018-07-16  5:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> Now that the vhub driver is upstream and the device-trees
> updated, let's enable this by default.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Acked-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  arch/arm/configs/aspeed_g5_defconfig | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/arch/arm/configs/aspeed_g5_defconfig b/arch/arm/configs/
> aspeed_g5_defconfig
> index 8c7ea033cdc2..38e9b2d43df3 100644
> --- a/arch/arm/configs/aspeed_g5_defconfig
> +++ b/arch/arm/configs/aspeed_g5_defconfig
> @@ -140,6 +140,23 @@ CONFIG_USB_DYNAMIC_MINORS=y
>  CONFIG_USB_EHCI_HCD=y
>  CONFIG_USB_EHCI_ROOT_HUB_TT=y
>  CONFIG_USB_EHCI_HCD_PLATFORM=y
> +CONFIG_USB_GADGET=y
> +CONFIG_U_SERIAL_CONSOLE=y
> +CONFIG_USB_ASPEED_VHUB=y
> +CONFIG_USB_CONFIGFS=y
> +CONFIG_USB_CONFIGFS_SERIAL=y
> +CONFIG_USB_CONFIGFS_ACM=y
> +CONFIG_USB_CONFIGFS_OBEX=y
> +CONFIG_USB_CONFIGFS_NCM=y
> +CONFIG_USB_CONFIGFS_ECM=y
> +CONFIG_USB_CONFIGFS_ECM_SUBSET=y
> +CONFIG_USB_CONFIGFS_RNDIS=y
> +CONFIG_USB_CONFIGFS_EEM=y
> +CONFIG_USB_CONFIGFS_MASS_STORAGE=y
> +CONFIG_USB_CONFIGFS_F_LB_SS=y
> +CONFIG_USB_CONFIGFS_F_FS=y
> +CONFIG_USB_CONFIGFS_F_HID=y
> +CONFIG_USB_CONFIGFS_F_PRINTER=y
>  CONFIG_NEW_LEDS=y
>  CONFIG_LEDS_CLASS=y
>  CONFIG_LEDS_CLASS_FLASH=y
> -- 
> 2.17.1
> 

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

* [PATCH 7/7] arm: dts: aspeed: Enable vhub on port A of AST2500 EVB
  2018-06-29  3:51 ` [PATCH 7/7] arm: dts: aspeed: Enable vhub on port A of AST2500 EVB Benjamin Herrenschmidt
@ 2018-07-16  5:39   ` Andrew Jeffery
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Jeffery @ 2018-07-16  5:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> This is an eval board, it makes sense to enable many
> functions by default. This changes the device-tree to
> set port A to be a USB device and leave port B as a
> host, along with a little comment explaining how to
> change it.
> 
> (the vhub device can only exist on port A on this SoC)
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Acked-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  arch/arm/boot/dts/aspeed-ast2500-evb.dts | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/aspeed-ast2500-evb.dts b/arch/arm/boot/
> dts/aspeed-ast2500-evb.dts
> index 2bff1b253842..2375449c02d0 100644
> --- a/arch/arm/boot/dts/aspeed-ast2500-evb.dts
> +++ b/arch/arm/boot/dts/aspeed-ast2500-evb.dts
> @@ -80,7 +80,13 @@
>  	};
>  };
>  
> -&ehci0 {
> +/*
> + * Enable port A as device (via the virtual hub) and port B as
> + * host by default on the eval board. This can be easily changed
> + * by replacing the override below with &ehci0 { ... } to enable
> + * host on both ports.
> + */
> +&vhub {
>  	status = "okay";
>  };
>  
> -- 
> 2.17.1
> 

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

* [PATCH 3/7] arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub
  2018-07-16  5:34   ` Andrew Jeffery
@ 2018-07-16  6:40     ` Benjamin Herrenschmidt
  2018-07-16  6:43       ` Andrew Jeffery
  0 siblings, 1 reply; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2018-07-16  6:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2018-07-16 at 15:04 +0930, Andrew Jeffery wrote:
> On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> > This adds the (disabled by default) device node for the
> > Aspeed virtual hub,a long with clocks and pinmux.
> > 
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > ---
> >  arch/arm/boot/dts/aspeed-g4.dtsi | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
> > index 1d7ffa9fdb11..54524564037c 100644
> > --- a/arch/arm/boot/dts/aspeed-g4.dtsi
> > +++ b/arch/arm/boot/dts/aspeed-g4.dtsi
> > @@ -131,6 +131,16 @@
> >  			 */
> >  		};
> >  
> > +		vhub: usb-vhub at 1e6a0000 {
> > +			compatible = "aspeed,ast2400-usb-vhub";
> > +			reg = <0x1e6a0000 0x300>;
> > +			interrupts = <5>;
> > +			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
> > +			pinctrl-names = "default";
> > +			pinctrl-0 = <&pinctrl_usb2d_default>;
> > +			status = "disabled";
> > +		};
> > +
> 
> These are all generic properties, so it's pretty clear what's going
> on, but it seems there's no bindings document capturing the
> compatible string? Not wanting to be a pain, but shouldn't we have
> documented it?

The driver went in at a time when I hadn't realized we documented
bindings for devices using only standard properties these days. We can
send a binding to Rob later.

Cheers,
Ben.

> 
> >  		apb {
> >  			compatible = "simple-bus";
> >  			#address-cells = <1>;
> > -- 
> > 2.17.1
> > 

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

* [PATCH 3/7] arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub
  2018-07-16  6:40     ` Benjamin Herrenschmidt
@ 2018-07-16  6:43       ` Andrew Jeffery
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Jeffery @ 2018-07-16  6:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 16 Jul 2018, at 16:10, Benjamin Herrenschmidt wrote:
> On Mon, 2018-07-16 at 15:04 +0930, Andrew Jeffery wrote:
> > On Fri, 29 Jun 2018, at 13:21, Benjamin Herrenschmidt wrote:
> > > This adds the (disabled by default) device node for the
> > > Aspeed virtual hub,a long with clocks and pinmux.
> > > 
> > > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > ---
> > >  arch/arm/boot/dts/aspeed-g4.dtsi | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
> > > index 1d7ffa9fdb11..54524564037c 100644
> > > --- a/arch/arm/boot/dts/aspeed-g4.dtsi
> > > +++ b/arch/arm/boot/dts/aspeed-g4.dtsi
> > > @@ -131,6 +131,16 @@
> > >  			 */
> > >  		};
> > >  
> > > +		vhub: usb-vhub at 1e6a0000 {
> > > +			compatible = "aspeed,ast2400-usb-vhub";
> > > +			reg = <0x1e6a0000 0x300>;
> > > +			interrupts = <5>;
> > > +			clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>;
> > > +			pinctrl-names = "default";
> > > +			pinctrl-0 = <&pinctrl_usb2d_default>;
> > > +			status = "disabled";
> > > +		};
> > > +
> > 
> > These are all generic properties, so it's pretty clear what's going
> > on, but it seems there's no bindings document capturing the
> > compatible string? Not wanting to be a pain, but shouldn't we have
> > documented it?
> 
> The driver went in at a time when I hadn't realized we documented
> bindings for devices using only standard properties these days. We can
> send a binding to Rob later.

Yep, I can't see it being controversial.

Acked-by: Andrew Jeffery <andrew@aj.id.au>

> 
> Cheers,
> Ben.
> 
> > 
> > >  		apb {
> > >  			compatible = "simple-bus";
> > >  			#address-cells = <1>;
> > > -- 
> > > 2.17.1
> > > 

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

end of thread, other threads:[~2018-07-16  6:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-29  3:50 [PATCH 0/7] arm: Aspeed DT & config updates for USB Benjamin Herrenschmidt
2018-06-29  3:51 ` [PATCH 1/7] arm: dts: aspeed: Add aspeed G4 USB pinmux Benjamin Herrenschmidt
2018-07-16  5:17   ` Andrew Jeffery
2018-06-29  3:51 ` [PATCH 2/7] arm: dts: aspeed: Add aspeed G5 USB host pinmux Benjamin Herrenschmidt
2018-07-16  5:23   ` Andrew Jeffery
2018-06-29  3:51 ` [PATCH 3/7] arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub Benjamin Herrenschmidt
2018-07-16  5:34   ` Andrew Jeffery
2018-07-16  6:40     ` Benjamin Herrenschmidt
2018-07-16  6:43       ` Andrew Jeffery
2018-06-29  3:51 ` [PATCH 4/7] arm: dts: aspeed: Add Aspeed 54 " Benjamin Herrenschmidt
2018-07-16  5:36   ` Andrew Jeffery
2018-06-29  3:51 ` [PATCH 5/7] arm: configs: Add USB gadget to Aspeed G4 defconfig Benjamin Herrenschmidt
2018-07-16  5:37   ` Andrew Jeffery
2018-06-29  3:51 ` [PATCH 6/7] arm: configs: Add USB gadget to Aspeed G5 defconfig Benjamin Herrenschmidt
2018-07-16  5:38   ` Andrew Jeffery
2018-06-29  3:51 ` [PATCH 7/7] arm: dts: aspeed: Enable vhub on port A of AST2500 EVB Benjamin Herrenschmidt
2018-07-16  5:39   ` Andrew Jeffery

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).