Skip to contentSkip to conversation

arm: Aspeed DT & config updates for USB

PATCH New Benjamin Herrenschmidt 2 participants 17 messages Jun 29, 2018 – Jul 16, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover arm: Aspeed DT & config updates for USB

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.

#1 lore raw

PATCH 1/7 arm: dts: aspeed: Add aspeed G4 USB pinmux

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

---
 arch/arm/boot/dts/aspeed-g4.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/aspeed-g4.dtsi +6 -0
index 75df1573380e..1d7ffa9fdb11 100644
@@ -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 {
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/7 arm: dts: aspeed: Add aspeed G4 USB pinmux

Quoted 22 lines · Benjamin Herrenschmidt

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

---
 arch/arm/boot/dts/aspeed-g4.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/aspeed-g4.dtsi +2 -0
index 75df1573380e..1d7ffa9fdb11 100644
@@ -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";
 		};
 

arch/arm/boot/dts/aspeed-g4.dtsi line 131

Quoted 7 lines
arch/arm/boot/dts/aspeed-g4.dtsi +4 -0
@@ -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

Quoted 6 lines
arch/arm/boot/dts/aspeed-g4.dtsi +0 -0
 		};
 
 		apb {
Signature · 1 line
2.17.1
#3 lore raw

PATCH 2/7 arm: dts: aspeed: Add aspeed G5 USB host pinmux

In reply to Benjamin Herrenschmidt

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

---
 arch/arm/boot/dts/aspeed-ast2500-evb.dts | 6 ------
 arch/arm/boot/dts/aspeed-g5.dtsi         | 8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)
arch/arm/boot/dts/aspeed-ast2500-evb.dts +0 -6
index ede11c597673..2bff1b253842 100644
@@ -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 */
 };
arch/arm/boot/dts/aspeed-g5.dtsi +8 -0
index 17f2714d18a7..dfdc239b86f6 100644
@@ -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 {
Signature · 1 line
2.17.1
#4 lore raw

PATCH 2/7 arm: dts: aspeed: Add aspeed G5 USB host pinmux

Quoted 7 lines · Benjamin Herrenschmidt

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

Quoted 65 lines
---
 arch/arm/boot/dts/aspeed-ast2500-evb.dts | 6 ------
 arch/arm/boot/dts/aspeed-g5.dtsi         | 8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)
arch/arm/boot/ renamed from arch/arm/boot/dts/aspeed-ast2500-evb.dts +0 -0

dts/aspeed-ast2500-evb.dts
index ede11c597673..2bff1b253842 100644

arch/arm/boot/dts/aspeed-ast2500-evb.dts +0 -6
@@ -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 */
 };
arch/arm/boot/dts/aspeed-g5.dtsi +8 -0
index 17f2714d18a7..dfdc239b86f6 100644
@@ -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 {
Signature · 1 line
2.17.1
#5 lore raw

PATCH 3/7 arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub

In reply to Benjamin Herrenschmidt

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

---
 arch/arm/boot/dts/aspeed-g4.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/aspeed-g4.dtsi +10 -0
index 1d7ffa9fdb11..54524564037c 100644
@@ -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>;
Signature · 1 line
2.17.1
#6 lore raw

PATCH 3/7 arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub

Quoted 16 lines · Benjamin Herrenschmidt

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

---
 arch/arm/boot/dts/aspeed-g4.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/aspeed-g4.dtsi +0 -0
index 1d7ffa9fdb11..54524564037c 100644
@@ -131,6 +131,16 @@
 			 */
 		};
 

arch/arm/boot/dts/aspeed-g4.dtsi line 143

Quoted 10 lines
arch/arm/boot/dts/aspeed-g4.dtsi +10 -0
+		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?

Quoted 6 lines
arch/arm/boot/dts/aspeed-g4.dtsi +0 -0
 		apb {
 			compatible = "simple-bus";
 			#address-cells = <1>;
Signature · 1 line
2.17.1
#7 lore raw

PATCH 3/7 arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub

Quoted 17 lines · Andrew Jeffery
Quoted 16 lines · Benjamin Herrenschmidt

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

---
 arch/arm/boot/dts/aspeed-g4.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/aspeed-g4.dtsi +0 -0
index 1d7ffa9fdb11..54524564037c 100644
@@ -131,6 +131,16 @@
 			 */
 		};
 
Quoted 15 lines

arch/arm/boot/dts/aspeed-g4.dtsi line 143

Quoted 10 lines
arch/arm/boot/dts/aspeed-g4.dtsi +10 -0
+		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.

Quoted 7 lines
Quoted 7 lines
arch/arm/boot/dts/aspeed-g4.dtsi +0 -0
 		apb {
 			compatible = "simple-bus";
 			#address-cells = <1>;
Signature · 1 line
2.17.1
#8 lore raw

PATCH 3/7 arm: dts: aspeed: Add Aspeed G4 USB Virtual Hub

Quoted 34 lines · Benjamin Herrenschmidt
Quoted 17 lines · Andrew Jeffery
Quoted 16 lines · Benjamin Herrenschmidt

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

---
 arch/arm/boot/dts/aspeed-g4.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/aspeed-g4.dtsi +0 -0
index 1d7ffa9fdb11..54524564037c 100644
@@ -131,6 +131,16 @@
 			 */
 		};
 
Quoted 15 lines

arch/arm/boot/dts/aspeed-g4.dtsi line 143

Quoted 10 lines
arch/arm/boot/dts/aspeed-g4.dtsi +10 -0
+		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?

Quoted 3 lines

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.

Quoted 11 lines

Cheers,
Ben.

Quoted 7 lines
Quoted 7 lines
arch/arm/boot/dts/aspeed-g4.dtsi +0 -0
 		apb {
 			compatible = "simple-bus";
 			#address-cells = <1>;
Signature · 1 line
2.17.1
#9 lore raw

PATCH 4/7 arm: dts: aspeed: Add Aspeed 54 USB Virtual Hub

In reply to Benjamin Herrenschmidt

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

---
 arch/arm/boot/dts/aspeed-g5.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/aspeed-g5.dtsi +15 -0
index dfdc239b86f6..6274d3eaf374 100644
@@ -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";
Signature · 1 line
2.17.1
#10 lore raw

PATCH 4/7 arm: dts: aspeed: Add Aspeed 54 USB Virtual Hub

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

Quoted 5 lines · Benjamin Herrenschmidt

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.

Quoted 14 lines
---
 arch/arm/boot/dts/aspeed-g5.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/aspeed-g5.dtsi +0 -0
index dfdc239b86f6..6274d3eaf374 100644
@@ -176,6 +176,16 @@
 			 */
 		};
 

arch/arm/boot/dts/aspeed-g5.dtsi line 188

Quoted 10 lines
arch/arm/boot/dts/aspeed-g5.dtsi +10 -0
+		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.

Quoted 18 lines
arch/arm/boot/dts/aspeed-g5.dtsi +5 -0
 		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";
Signature · 1 line
2.17.1
#11 lore raw

PATCH 5/7 arm: configs: Add USB gadget to Aspeed G4 defconfig

In reply to Benjamin Herrenschmidt

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

---
 arch/arm/configs/aspeed_g4_defconfig | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/configs/aspeed_g4_defconfig +17 -0
index 95946dee9c77..be714ea088ed 100644
@@ -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
Signature · 1 line
2.17.1
#12 lore raw

PATCH 5/7 arm: configs: Add USB gadget to Aspeed G4 defconfig

Quoted 4 lines · Benjamin Herrenschmidt

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

Quoted 36 lines
---
 arch/arm/configs/aspeed_g4_defconfig | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/configs/ renamed from arch/arm/configs/aspeed_g4_defconfig +0 -0

aspeed_g4_defconfig
index 95946dee9c77..be714ea088ed 100644

arch/arm/configs/aspeed_g4_defconfig +17 -0
@@ -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
Signature · 1 line
2.17.1
#13 lore raw

PATCH 6/7 arm: configs: Add USB gadget to Aspeed G5 defconfig

In reply to Benjamin Herrenschmidt

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

---
 arch/arm/configs/aspeed_g5_defconfig | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/configs/aspeed_g5_defconfig +17 -0
index 8c7ea033cdc2..38e9b2d43df3 100644
@@ -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
Signature · 1 line
2.17.1
#14 lore raw

PATCH 6/7 arm: configs: Add USB gadget to Aspeed G5 defconfig

Quoted 4 lines · Benjamin Herrenschmidt

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

Quoted 36 lines
---
 arch/arm/configs/aspeed_g5_defconfig | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/configs/ renamed from arch/arm/configs/aspeed_g5_defconfig +0 -0

aspeed_g5_defconfig
index 8c7ea033cdc2..38e9b2d43df3 100644

arch/arm/configs/aspeed_g5_defconfig +17 -0
@@ -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
Signature · 1 line
2.17.1
#15 lore raw

PATCH 7/7 arm: dts: aspeed: Enable vhub on port A of AST2500 EVB

In reply to Benjamin Herrenschmidt

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)

---
 arch/arm/boot/dts/aspeed-ast2500-evb.dts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-ast2500-evb.dts +7 -1
index 2bff1b253842..2375449c02d0 100644
@@ -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";
 };
 
Signature · 1 line
2.17.1
#16 lore raw

PATCH 7/7 arm: dts: aspeed: Enable vhub on port A of AST2500 EVB

Quoted 9 lines · Benjamin Herrenschmidt

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)

Quoted 27 lines
---
 arch/arm/boot/dts/aspeed-ast2500-evb.dts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm/boot/ renamed from arch/arm/boot/dts/aspeed-ast2500-evb.dts +0 -0

dts/aspeed-ast2500-evb.dts
index 2bff1b253842..2375449c02d0 100644

arch/arm/boot/dts/aspeed-ast2500-evb.dts +7 -1
@@ -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";
 };
 
Signature · 1 line
2.17.1