Skip to contentSkip to conversation

A20-OLinuXino-Lime2: Enable USB gadget support

PATCH In review Tom Rini 3 participants 7 messages Sep 19, 2016

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 A20-OLinuXino-Lime2: Enable USB gadget support

Based on A13-OLinuXino, enable DFU and UMS support.

---
With this change I've added DFU to my tests on this board, and assuming a follow up test with the SD image that kicks the board into FEL works, I'll then enable the UMS tests on this board (and add DFU to SD, not just DFU to RAM).

 configs/A20-OLinuXino-Lime2_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
configs/A20-OLinuXino-Lime2_defconfig +8 -0
index 23db07380624..54343de7f351 100644
@@ -12,9 +12,17 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_RTL8211X_PHY_FORCE_MASTER=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
+CONFIG_G_DNL_VENDOR_NUM=0x1f3a
+CONFIG_G_DNL_PRODUCT_NUM=0x1010
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 A20-OLinuXino-Lime2: Enable USB gadget support

Hi,

Quoted 17 lines · Tom Rini

Based on A13-OLinuXino, enable DFU and UMS support.

---
With this change I've added DFU to my tests on this board, and assuming a follow up test with the SD image that kicks the board into FEL works, I'll then enable the UMS tests on this board (and add DFU to SD, not just DFU to RAM).

 configs/A20-OLinuXino-Lime2_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
configs/A20-OLinuXino-Lime2_defconfig +0 -0
index 23db07380624..54343de7f351 100644

configs/A20-OLinuXino-Lime2_defconfig CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)" · line 16

Quoted 5 lines
configs/A20-OLinuXino-Lime2_defconfig +2 -0
@@ -12,9 +12,17 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y

Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET mode to me, esp. since it is only useful in host mode AFAICT.

Chen-Yu did something similar in a patch enabling host mode for a different sunxi board and here is what I replied:

"
If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really should do so on all boards (feel free to submit a patch for this).

e.g. add something like this to board/sunxi/Kconfig:

config CMD_USB_MASS_STORAGE
default y

So that we can still disable it in case there are space constraints, but normally we enable it on all sunxi boards offering a consistent set of available commands.
"

The same goes for this patch, otherwise this patch is:

Ig you want to feel free to apply this directly (given that I've send out a sunxi pull-req recently).

Regards,

Hans

Quoted 13 lines
configs/A20-OLinuXino-Lime2_defconfig +6 -0
 # CONFIG_CMD_FPGA is not set
 CONFIG_RTL8211X_PHY_FORCE_MASTER=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
+CONFIG_G_DNL_VENDOR_NUM=0x1f3a
+CONFIG_G_DNL_PRODUCT_NUM=0x1010
author
#2 lore raw

PATCH 1/1 A20-OLinuXino-Lime2: Enable USB gadget support

Quoted 15 lines · Hans de Goede

Hi,

Quoted 12 lines · Tom Rini

Based on A13-OLinuXino, enable DFU and UMS support.

---
With this change I've added DFU to my tests on this board, and assuming a follow up test with the SD image that kicks the board into FEL works, I'll then enable the UMS tests on this board (and add DFU to SD, not just DFU to RAM).

configs/A20-OLinuXino-Lime2_defconfig | 8 ++++++++

1 file changed, 8 insertions(+)
Quoted 14 lines

configs/A20-OLinuXino-Lime2_defconfig CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)" · line 16

Quoted 10 lines
configs/A20-OLinuXino-Lime2_defconfig +0 -0
index 23db07380624..54343de7f351 100644
@@ -12,9 +12,17 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"

CONFIG_SPL=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set

configs/A20-OLinuXino-Lime2_defconfig +2 -0
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y

Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET mode to me, esp. since it is only useful in host mode AFAICT.

Ah, no, things have bad names perhaps. CMD_USB_MASS_STORAGE enables "ums" as a command which is what in turn will export MMC (or something else) as a USB mass storage gadget over to the host.

Quoted 9 lines

Chen-Yu did something similar in a patch enabling host mode for a different sunxi board and here is what I replied:

"
If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really should do so on all boards (feel free to submit a patch for this).

e.g. add something like this to board/sunxi/Kconfig:

Quoted 7 lines

config CMD_USB_MASS_STORAGE
default y

So that we can still disable it in case there are space constraints, but normally we enable it on all sunxi boards offering a consistent set of available commands.
"

I think it's a useful command that should be more widely exposed, yes. IIRC, it's how the Tegra platforms support flashing their dev boards with official images, and can be a handy "rescue" type option too.

Quoted 7 lines

The same goes for this patch, otherwise this patch is:

Ig you want to feel free to apply this directly (given that I've send out a sunxi pull-req recently).

OK, thanks. I just might since I really want to move on to grabbing some fs patches and before I do that I really want to have as much testing of them as possible.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160919/74c85a4b/attachment.sig>
#3 lore raw

PATCH 1/1 A20-OLinuXino-Lime2: Enable USB gadget support

Hi,

Quoted 31 lines · Tom Rini
Quoted 15 lines · Hans de Goede

Hi,

Quoted 12 lines · Tom Rini

Based on A13-OLinuXino, enable DFU and UMS support.

---
With this change I've added DFU to my tests on this board, and assuming a follow up test with the SD image that kicks the board into FEL works, I'll then enable the UMS tests on this board (and add DFU to SD, not just DFU to RAM).

configs/A20-OLinuXino-Lime2_defconfig | 8 ++++++++

1 file changed, 8 insertions(+)
Quoted 14 lines

configs/A20-OLinuXino-Lime2_defconfig CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)" · line 16

Quoted 10 lines
configs/A20-OLinuXino-Lime2_defconfig +0 -0
index 23db07380624..54343de7f351 100644
@@ -12,9 +12,17 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"

CONFIG_SPL=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set

configs/A20-OLinuXino-Lime2_defconfig +2 -0
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y

Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET mode to me, esp. since it is only useful in host mode AFAICT.

Quoted 3 lines

Ah, no, things have bad names perhaps. CMD_USB_MASS_STORAGE enables "ums" as a command which is what in turn will export MMC (or something else) as a USB mass storage gadget over to the host.

Ah, I thought this enabled the (destructive) low level usb mass storage block read/write test commands, but I guess I'm wrong.

I wonder why Chen-Yu put it in the usb host enabling patch for an A33 board then...

Quoted 11 lines
Quoted 11 lines

Chen-Yu did something similar in a patch enabling host mode for a different sunxi board and here is what I replied:

"
If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really should do so on all boards (feel free to submit a patch for this).

e.g. add something like this to board/sunxi/Kconfig:

config CMD_USB_MASS_STORAGE
default y

Given the above, that should probably be:

config CMD_USB_MASS_STORAGE
default y if USB_GADGET

Hmm, I guess we may want to have a bunch of those, so that simply adding:

CONFIG_USB_MUSB_GADGET=y

To a defconfig enables the relevant related options...

Regards,

Hans

Quoted 22 lines
Quoted 5 lines

So that we can still disable it in case there are space constraints, but normally we enable it on all sunxi boards offering a consistent set of available commands.
"

I think it's a useful command that should be more widely exposed, yes. IIRC, it's how the Tegra platforms support flashing their dev boards with official images, and can be a handy "rescue" type option too.

Quoted 7 lines

The same goes for this patch, otherwise this patch is:

Ig you want to feel free to apply this directly (given that I've send out a sunxi pull-req recently).

OK, thanks. I just might since I really want to move on to grabbing some fs patches and before I do that I really want to have as much testing of them as possible.

author
#4 lore raw

PATCH 1/1 A20-OLinuXino-Lime2: Enable USB gadget support

Quoted 63 lines · Hans de Goede

Hi,

Quoted 31 lines · Tom Rini
Quoted 15 lines · Hans de Goede

Hi,

Quoted 12 lines · Tom Rini

Based on A13-OLinuXino, enable DFU and UMS support.

---
With this change I've added DFU to my tests on this board, and assuming a follow up test with the SD image that kicks the board into FEL works, I'll then enable the UMS tests on this board (and add DFU to SD, not just DFU to RAM).

configs/A20-OLinuXino-Lime2_defconfig | 8 ++++++++

1 file changed, 8 insertions(+)
Quoted 14 lines

configs/A20-OLinuXino-Lime2_defconfig CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)" · line 16

Quoted 10 lines
configs/A20-OLinuXino-Lime2_defconfig +0 -0
index 23db07380624..54343de7f351 100644
@@ -12,9 +12,17 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"

CONFIG_SPL=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set

configs/A20-OLinuXino-Lime2_defconfig +2 -0
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y

Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET mode to me, esp. since it is only useful in host mode AFAICT.

Quoted 3 lines

Ah, no, things have bad names perhaps. CMD_USB_MASS_STORAGE enables "ums" as a command which is what in turn will export MMC (or something else) as a USB mass storage gadget over to the host.

Ah, I thought this enabled the (destructive) low level usb mass storage block read/write test commands, but I guess I'm wrong.

I wonder why Chen-Yu put it in the usb host enabling patch for an A33 board then...

Quoted 11 lines
Quoted 11 lines

Chen-Yu did something similar in a patch enabling host mode for a different sunxi board and here is what I replied:

"
If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really should do so on all boards (feel free to submit a patch for this).

e.g. add something like this to board/sunxi/Kconfig:

config CMD_USB_MASS_STORAGE
default y

Given the above, that should probably be:

config CMD_USB_MASS_STORAGE
default y if USB_GADGET

Quoted 6 lines

Hmm, I guess we may want to have a bunch of those, so that simply adding:

CONFIG_USB_MUSB_GADGET=y

To a defconfig enables the relevant related options...

Yes. I think that something that should be done, and sooner rather than later, is changing more options from 'default n' (the default when not spelled out) to 'default y' as with the change from board.h to Kconfig there is much less pain in turning off default values. Things like 'ums' are really handy and unlike DFU/fastboot don't require additional configuration. So, I should go and fire off a patch for this one quickly at least.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160919/e60c46df/attachment.sig>
author
#6 lore raw
In reply to Tom Rini
Quoted 4 lines · Tom Rini

Based on A13-OLinuXino, enable DFU and UMS support.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160919/1b094a97/attachment.sig>
#5 lore raw

PATCH 1/1 A20-OLinuXino-Lime2: Enable USB gadget support

In reply to Hans de Goede
Quoted 50 lines · Hans de Goede

Hi,

Quoted 41 lines · Tom Rini
Quoted 29 lines · Hans de Goede

Hi,

Quoted 25 lines · Tom Rini

Based on A13-OLinuXino, enable DFU and UMS support.

---
With this change I've added DFU to my tests on this board, and assuming a
follow up test with the SD image that kicks the board into FEL works, I'll
then enable the UMS tests on this board (and add DFU to SD, not just DFU to
RAM).

configs/A20-OLinuXino-Lime2_defconfig | 8 ++++++++

1 file changed, 8 insertions(+)
configs/A20-OLinuXino-Lime2_defconfig +0 -0
index 23db07380624..54343de7f351 100644
@@ -12,9 +12,17 @@

CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)" CONFIG_SPL=y
# CONFIG_CMD_IMLS is not set

Quoted 8 lines

configs/A20-OLinuXino-Lime2_defconfig CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)" · line 16

Quoted 3 lines

# CONFIG_CMD_FLASH is not set

configs/A20-OLinuXino-Lime2_defconfig +2 -0
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y

Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET mode to me, esp. since it is only useful in host mode AFAICT.

Quoted 3 lines

Ah, no, things have bad names perhaps. CMD_USB_MASS_STORAGE enables "ums" as a command which is what in turn will export MMC (or something else) as a USB mass storage gadget over to the host.

Quoted 6 lines

Ah, I thought this enabled the (destructive) low level usb mass storage block read/write test commands, but I guess I'm wrong.

I wonder why Chen-Yu put it in the usb host enabling patch for an A33 board then...

It was copy pasted from some other defconfig. Like you, I thought it was for host mode supporting USB sticks...

ChenYu

Quoted 60 lines
Quoted 11 lines
Quoted 11 lines

Chen-Yu did something similar in a patch enabling host mode for a different sunxi board and here is what I replied:

"
If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really should do so on all boards (feel free to submit a patch for this).

e.g. add something like this to board/sunxi/Kconfig:

config CMD_USB_MASS_STORAGE
default y

Given the above, that should probably be:

config CMD_USB_MASS_STORAGE
default y if USB_GADGET

Hmm, I guess we may want to have a bunch of those, so that simply adding:

CONFIG_USB_MUSB_GADGET=y

To a defconfig enables the relevant related options...

Regards,

Hans

Quoted 16 lines
Quoted 5 lines

So that we can still disable it in case there are space constraints, but normally we enable it on all sunxi boards offering a consistent set of available commands.
"

I think it's a useful command that should be more widely exposed, yes. IIRC, it's how the Tegra platforms support flashing their dev boards with official images, and can be a handy "rescue" type option too.

Quoted 5 lines

The same goes for this patch, otherwise this patch is:

Quoted 8 lines
Quoted 2 lines

Ig you want to feel free to apply this directly (given that I've send out a sunxi pull-req recently).

OK, thanks. I just might since I really want to move on to grabbing some fs patches and before I do that I really want to have as much testing of them as possible.

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot