public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Starting u-boot in USB otg mode
       [not found] <mailman.21434.1504602153.174.u-boot@lists.denx.de>
@ 2017-09-06  9:56 ` rivael_il
  2017-09-07  3:48   ` Kever Yang
  0 siblings, 1 reply; 12+ messages in thread
From: rivael_il @ 2017-09-06  9:56 UTC (permalink / raw)
  To: u-boot


Hello u-booters!

I want to load u-boot-sunxi-with-spl.bin and make it operate the USB in otg mode.
(Where the host can still be connected to the board).

How can I achieve this?

(I have attempted to use: "usb0:dr_mode=otg,phy_type=utmi\0" without success).

Thank you,

Michael

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-06  9:56 ` [U-Boot] Starting u-boot in USB otg mode rivael_il
@ 2017-09-07  3:48   ` Kever Yang
  2017-09-07  9:05     ` rivael_il
  0 siblings, 1 reply; 12+ messages in thread
From: Kever Yang @ 2017-09-07  3:48 UTC (permalink / raw)
  To: u-boot

Hi Michael,

     There is no 'otg_mode' in U-Boot, the driver framework is different 
with kernel.

If you want to use usb device, you can use cmd like this:

ums 0 mmc 0

If you want to use usb host, you can use:

usb start

this command will enumerate all the device connect to the host port.


But there no support for work as host or device which depends on what's 
the usb id
pin in the cable.

Thanks,
- Kever
On 09/06/2017 05:56 PM, rivael_il wrote:
> Hello u-booters!
>
> I want to load u-boot-sunxi-with-spl.bin and make it operate the USB in otg mode.
> (Where the host can still be connected to the board).
>
> How can I achieve this?
>
> (I have attempted to use: "usb0:dr_mode=otg,phy_type=utmi\0" without success).
>
> Thank you,
>
> Michael
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-07  3:48   ` Kever Yang
@ 2017-09-07  9:05     ` rivael_il
  2017-09-07  9:43       ` Maxime Ripard
  0 siblings, 1 reply; 12+ messages in thread
From: rivael_il @ 2017-09-07  9:05 UTC (permalink / raw)
  To: u-boot

Hello Kever Yang,

Thank you for your prompt response.

This is an important feature, as 'otg' mode allow the board to stay responsive to the computer driving it. Especially sunxi-fel and ttyusb.

I might be interested in implementing it in u-boot.
How can I do that? What is the code size consequences here?

Thank you,

Michael

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-07  9:05     ` rivael_il
@ 2017-09-07  9:43       ` Maxime Ripard
  2017-09-07 10:23         ` rivael_il
  2020-02-27 10:59         ` mRbinG
  0 siblings, 2 replies; 12+ messages in thread
From: Maxime Ripard @ 2017-09-07  9:43 UTC (permalink / raw)
  To: u-boot

Hi,

On Thu, Sep 07, 2017 at 12:05:20PM +0300, rivael_il wrote:
> Hello Kever Yang,
> 
> Thank you for your prompt response.
> 
> This is an important feature, as 'otg' mode allow the board to stay
> responsive to the computer driving it. Especially sunxi-fel and
> ttyusb.

Both are peripheral-only features, not OTG. OTG is about switching
from peripheral to host based on the ID-pin, and this what is not
supported in U-Boot.

However, peripheral is, and it's already supported for the Allwinner
SoCs. We use it for things like fastboot. I'm not sure what this has
to do with fel though.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170907/60c3775c/attachment.sig>

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-07  9:43       ` Maxime Ripard
@ 2017-09-07 10:23         ` rivael_il
  2017-09-07 11:15           ` 'Maxime Ripard'
  2020-02-27 10:59         ` mRbinG
  1 sibling, 1 reply; 12+ messages in thread
From: rivael_il @ 2017-09-07 10:23 UTC (permalink / raw)
  To: u-boot


Hello Maxime!

Thank you for your answer.
How can I set "peripheral" mode on the USB in u-boot?

Thank you,

Michael

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-07 10:23         ` rivael_il
@ 2017-09-07 11:15           ` 'Maxime Ripard'
  2017-09-08 12:38             ` rivael_il
  2020-02-27  9:06             ` mRbinG
  0 siblings, 2 replies; 12+ messages in thread
From: 'Maxime Ripard' @ 2017-09-07 11:15 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 07, 2017 at 01:23:32PM +0300, rivael_il wrote:
> 
> Hello Maxime!
> 
> Thank you for your answer.
> How can I set "peripheral" mode on the USB in u-boot?

Enable CONFIG_USB_MUSB_GADGET instead of HOST.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170907/543f502f/attachment.sig>

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-07 11:15           ` 'Maxime Ripard'
@ 2017-09-08 12:38             ` rivael_il
  2017-09-08 13:27               ` 'Maxime Ripard'
  2020-02-27  9:06             ` mRbinG
  1 sibling, 1 reply; 12+ messages in thread
From: rivael_il @ 2017-09-08 12:38 UTC (permalink / raw)
  To: u-boot

Thank you Maxime!

I have removed the USB_HOST configuration. Now I get:

LD      u-boot
drivers/usb/host/built-in.o: In function `ehci_usb_remove':
/home/pi/otg/mikboot/u-boot/drivers/usb/host/ehci-sunxi.c:78: undefined
reference to `ehci_deregister'
drivers/usb/host/built-in.o: In function `ehci_usb_probe':
/home/pi/otg/mikboot/u-boot/drivers/usb/host/ehci-sunxi.c:69: undefined
reference to `ehci_register'
drivers/usb/host/built-in.o:(.u_boot_list_2_driver_2_ehci_sunxi+0x3c):
undefined reference to `ehci_usb_ops'
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Raspbian) 2.25 assertion
fail ../../bfd/elf32-arm.c:7827
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Raspbian) 2.25 assertion
fail ../../bfd/elf32-arm.c:7827
arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not found in
the linker script
arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
Makefile:1255: recipe for target 'u-boot' failed
make: *** [u-boot] Error 1

Here is my .config USB reference:
---------------------------------
CONFIG_INITIAL_USB_SCAN_DELAY=0
CONFIG_USB0_VBUS_PIN=""
CONFIG_USB0_VBUS_DET=""
CONFIG_USB0_ID_DET=""
CONFIG_USB1_VBUS_PIN=""
CONFIG_USB2_VBUS_PIN=""
CONFIG_USB3_VBUS_PIN=""
# CONFIG_SPL_MUSB_NEW_SUPPORT is not set
# CONFIG_SPL_USB_HOST_SUPPORT is not set
# CONFIG_SPL_USB_GADGET_SUPPORT is not set
CONFIG_CMD_USB=y
# CONFIG_CMD_USB_MASS_STORAGE is not set
CONFIG_USB=y
CONFIG_DM_USB=y
# USB Host Controller Drivers
# CONFIG_USB_XHCI_HCD is not set
# CONFIG_USB_EHCI_HCD is not set
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_UHCI_HCD is not set
# CONFIG_USB_DWC2 is not set
# CONFIG_USB_DWC3 is not set
# MUSB Controller Driver
# CONFIG_USB_MUSB_HOST is not set
CONFIG_USB_MUSB_GADGET=y
# CONFIG_USB_MUSB_TI is not set
CONFIG_USB_MUSB_SUNXI=y
# USB peripherals
CONFIG_USB_STORAGE=y
CONFIG_USB_KEYBOARD=y
CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_ATMEL_USBA is not set
# CONFIG_USB_GADGET_BCM_UDC_OTG_PHY is not set
# CONFIG_USB_GADGET_DWC2_OTG is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_DUALSPEED=y
# CONFIG_USB_GADGET_DOWNLOAD is not set
# USB to Ethernet Controller Drivers
# CONFIG_USB_ETHER_LAN75XX is not set
# CONFIG_USB_ETHER_LAN78XX is not set

Can you tell me how to fix this?

Michael

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-08 12:38             ` rivael_il
@ 2017-09-08 13:27               ` 'Maxime Ripard'
  2017-09-08 13:45                 ` rivael_il
  0 siblings, 1 reply; 12+ messages in thread
From: 'Maxime Ripard' @ 2017-09-08 13:27 UTC (permalink / raw)
  To: u-boot

On Fri, Sep 08, 2017 at 03:38:42PM +0300, rivael_il wrote:
> Thank you Maxime!
> 
> I have removed the USB_HOST configuration. Now I get:
> 
> LD      u-boot
> drivers/usb/host/built-in.o: In function `ehci_usb_remove':
> /home/pi/otg/mikboot/u-boot/drivers/usb/host/ehci-sunxi.c:78: undefined
> reference to `ehci_deregister'
> drivers/usb/host/built-in.o: In function `ehci_usb_probe':
> /home/pi/otg/mikboot/u-boot/drivers/usb/host/ehci-sunxi.c:69: undefined
> reference to `ehci_register'
> drivers/usb/host/built-in.o:(.u_boot_list_2_driver_2_ehci_sunxi+0x3c):
> undefined reference to `ehci_usb_ops'
> arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Raspbian) 2.25 assertion
> fail ../../bfd/elf32-arm.c:7827
> arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Raspbian) 2.25 assertion
> fail ../../bfd/elf32-arm.c:7827
> arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not found in
> the linker script
> arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
> Makefile:1255: recipe for target 'u-boot' failed
> make: *** [u-boot] Error 1

You should keep USB_HOST.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170908/6b2888b1/attachment.sig>

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-08 13:27               ` 'Maxime Ripard'
@ 2017-09-08 13:45                 ` rivael_il
  2017-09-08 14:50                   ` 'Maxime Ripard'
  0 siblings, 1 reply; 12+ messages in thread
From: rivael_il @ 2017-09-08 13:45 UTC (permalink / raw)
  To: u-boot

It got compiled. But the u-boot-sunxi-with-spl.bin still generate HOST
controller rather than Peripheral USB.
I can't see it in lsusb.

Here is the u-boot console:

=> usb stop
stopping USB..
=> usb tree
USB is stopped. Please issue 'usb start' first.
=> usb start
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
=> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller

  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller

=>
U-Boot SPL 2017.09-rc2-00168-g90ae53c-dirty (Sep 08 2017 - 11:26:35)
DRAM: 1024 MiB

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

* [U-Boot] Starting u-boot in USB otg mode
  2017-09-08 13:45                 ` rivael_il
@ 2017-09-08 14:50                   ` 'Maxime Ripard'
  0 siblings, 0 replies; 12+ messages in thread
From: 'Maxime Ripard' @ 2017-09-08 14:50 UTC (permalink / raw)
  To: u-boot

On Fri, Sep 08, 2017 at 04:45:31PM +0300, rivael_il wrote:
> It got compiled. But the u-boot-sunxi-with-spl.bin still generate HOST
> controller rather than Peripheral USB.
> I can't see it in lsusb.
> 
> Here is the u-boot console:
> 
> => usb stop
> stopping USB..
> => usb tree
> USB is stopped. Please issue 'usb start' first.
> => usb start
> starting USB...
> USB0:   USB EHCI 1.00
> USB1:   USB OHCI 1.0
> USB2:   USB EHCI 1.00
> USB3:   USB OHCI 1.0
> scanning bus 0 for devices... 1 USB Device(s) found
> scanning bus 2 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 0 Storage Device(s) found
> => usb tree
> USB device tree:
>   1  Hub (480 Mb/s, 0mA)
>      u-boot EHCI Host Controller
> 
>   1  Hub (480 Mb/s, 0mA)
>      u-boot EHCI Host Controller

Those are all host only commands. What are you trying to do, and which
gadgets are you trying to use?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170908/d2992121/attachment.sig>

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

* Starting u-boot in USB otg mode
  2017-09-07 11:15           ` 'Maxime Ripard'
  2017-09-08 12:38             ` rivael_il
@ 2020-02-27  9:06             ` mRbinG
  1 sibling, 0 replies; 12+ messages in thread
From: mRbinG @ 2020-02-27  9:06 UTC (permalink / raw)
  To: u-boot

Maxime Ripard wrote
> On Thu, Sep 07, 2017 at 01:23:32PM +0300, rivael_il wrote:
>> 
>> Hello Maxime!
>> 
>> Thank you for your answer.
>> How can I set "peripheral" mode on the USB in u-boot?
> 
> Enable CONFIG_USB_MUSB_GADGET instead of HOST.
> 
> Maxime

In which file should this be done?
I need this for enabling the fastboot feature in u-boot itself, what are the
next steps after this?



--
Sent from: http://u-boot.10912.n7.nabble.com/

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

* Starting u-boot in USB otg mode
  2017-09-07  9:43       ` Maxime Ripard
  2017-09-07 10:23         ` rivael_il
@ 2020-02-27 10:59         ` mRbinG
  1 sibling, 0 replies; 12+ messages in thread
From: mRbinG @ 2020-02-27 10:59 UTC (permalink / raw)
  To: u-boot

Maxime Ripard wrote
> Both are peripheral-only features, not OTG. OTG is about switching
> from peripheral to host based on the ID-pin, and this what is not
> supported in U-Boot.
> 
> However, peripheral is, and it's already supported for the Allwinner
> SoCs. We use it for things like fastboot. I'm not sure what this has
> to do with fel though.
> 
> Maxime

It would be really helpful if you could guide me to enable the fastboot
feature in u-boot for linux & NOT android.



--
Sent from: http://u-boot.10912.n7.nabble.com/

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

end of thread, other threads:[~2020-02-27 10:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.21434.1504602153.174.u-boot@lists.denx.de>
2017-09-06  9:56 ` [U-Boot] Starting u-boot in USB otg mode rivael_il
2017-09-07  3:48   ` Kever Yang
2017-09-07  9:05     ` rivael_il
2017-09-07  9:43       ` Maxime Ripard
2017-09-07 10:23         ` rivael_il
2017-09-07 11:15           ` 'Maxime Ripard'
2017-09-08 12:38             ` rivael_il
2017-09-08 13:27               ` 'Maxime Ripard'
2017-09-08 13:45                 ` rivael_il
2017-09-08 14:50                   ` 'Maxime Ripard'
2020-02-27  9:06             ` mRbinG
2020-02-27 10:59         ` mRbinG

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox