[U-Boot] USB-CDC with musb controller
Remy Bohmer
linux at bohmer.net
Mon Aug 9 19:12:08 CEST 2010
Hi Stefano,
2010/8/5 Stefano Babic <sbabic at denx.de>:
> Hi Remy,
>
> I would like to add CDC support to a davinci (DM365 Soc) board using the
> musb controller. As the actual driver (musb_udc) does have gadget
> support, I decided (even if I get some advises that it is a harder way)
The USB gadget layer used for CDC is derived from Linux 2.6.27. It was
ported such that the gadget drivers from Linux could be used with
little modifications.
> The usb_eth_init does not complete, and a ping request ends with "The
> remote end did not respond in time". However, a CDC gadget is recognized
> on both sides (target and PC). On the PC, I get the usb0 interface, and
> the cdc driver is loaded:
> I get a lot of "respond with data transfer before status phase", but as
> I see in code, it seems to be quite a normal case, and the setup is sent
> again (is this true ?).
Indeed, this seems to be some debug logging that can be removed...
> In musb_gadget_queue() entry point (usb_ep_queue from ethernet gadget)
> there is a check for the parameters, and the ep should be the same as
> the ep in the request. This is not a case, and an error is reported (see
> later in error log).
We have tested it with the Atmel at91sam9261 core, and I have never
used it with any other hardware.
It is possible that you run into problems here that where not visible
on the Atmel core...
> I report the whole log, enabling debug output on both musb driver and
> ether.c. Do you have some hints to give me to go further ?
This is my log when I do a (successful) ping to the host when I run on
a Atmel eval-kit.
Maybe you can use it as reference? Maybe it helps...
at91sam9261-ek> ping 10.0.0.1
Holding VBUS down: 4...3...2...1...Go!
end bus reset
end bus reset
SETUP 80.06 v0100 i0000 l0040
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
end bus reset
nuke ep0
setup complete --> -108, 16/18
SETUP 00.05 v0025 i0000 l0000
address 37
SETUP 80.06 v0100 i0000 l0012
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/2 (done)
ep0 out/status ACK
SETUP 80.06 v0600 i0000 l000a
eth_setup:...
req 80.06 protocol STALL; stat -95
ep0 stalled
SETUP 80.06 v0600 i0000 l000a
eth_setup:...
req 80.06 protocol STALL; stat -95
ep0 stalled
SETUP 80.06 v0600 i0000 l000a
eth_setup:...
req 80.06 protocol STALL; stat -95
ep0 stalled
SETUP 80.06 v0200 i0000 l0009
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/1 (done)
ep0 out/status ACK
SETUP 80.06 v0200 i0000 l0050
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8 (done)
ep0 out/status ACK
SETUP 80.06 v0300 i0000 l00ff
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/4 (done)
ep0 out/status ACK
SETUP 80.06 v0302 i0409 l00ff
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/0 (done)
ep0 out/status ACK
SETUP 80.06 v0301 i0409 l00ff
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/2 (done)
ep0 out/status ACK
SETUP 00.09 v0001 i0000 l0000
wait for config
eth_setup:...
udc: alloc_req: request[2]
udc: alloc_req: request[3]
full speed config #1: 2 mA, Ethernet Gadget, using CDC Ethernet
respond with data transfer before status phase
toggle config
ep0 in/status
SETUP 80.06 v0307 i0409 l00ff
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/2 (done)
ep0 out/status ACK
SETUP 80.06 v0305 i0409 l00ff
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/6 (done)
ep0 out/status ACK
SETUP 01.0b v0001 i0001 l0000
eth_setup:...
ep4 20aa361c in/8 (done)
send SPEED_CHANGE --> 0
respond with data transfer before status phase
ep0 in/status
SETUP 80.06 v0303 i0409 l00ff
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/2 (done)
ep0 out/status ACK
SETUP 80.06 v0304 i0409 l00ff
eth_setup:...
respond with data transfer before status phase
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/8
ep0 20aa35e8 in/4 (done)
ep0 out/status ACK
ep4 20aa361c in/16 (done)
event 2a --> 0
USB network up!
rx_submit
Using usb0 device
usb_eth_send:...
ep1 20aa3650 in/42 (done)
tx_complete, status: ok
usb_eth_send: packet queued
ep2 20aa3684 out/42 (done)
rx_complete
rx status 0
usb_eth_recv: packet received
usb_eth_send:...
ep1 20aa3650 in/42 (done)
tx_complete, status: ok
usb_eth_send: packet queued
rx_submit
ep2 20aa3684 out/54 (done)
rx_complete
rx status 0
usb_eth_recv: packet received
rx_submit
ep2 20aa3684 out/42 (done)
rx_complete
rx status 0
usb_eth_recv: packet received
rx_submit
nuke ep2
rx_complete
rx status -108
host 10.0.0.1 is alive
More information about the U-Boot
mailing list