]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
fix USB initialisation procedure
authorRemy Bohmer <linux@bohmer.net>
Fri, 10 Oct 2008 08:23:21 +0000 (10:23 +0200)
committerMarkus Klotzbuecher <mk@denx.de>
Tue, 14 Oct 2008 14:42:44 +0000 (16:42 +0200)
commit48867208444cb2a82e2af9c3249e90b7ed4a1751
treef6a05b67058517735a3a3d99b15f993758f1aaf7
parente58c41e26cf3c8accd60311be579f452e368e97e
fix USB initialisation procedure

The max packet size is encoded as 0,1,2,3 for 8,16,32,64 bytes.
At some places directly 8,16,32,64 was used instead of the encoded
value. Made a enum for the options to make this more clear and to help
preventing similar errors in the future.

After fixing this bug it became clear that another bug existed where
the 'pipe' is and-ed with PIPE_* flags, where it should have been
'usb_pipetype(pipe)', or even better usb_pipeint(pipe).

Also removed the triple 'get_device_descriptor' sequence, it has no use,
and Windows nor Linux behaves that way.
There is also a poll going on with a timeout when usb_control_msg() fails.
However, the poll is useless, because the flag will never be set on a error,
because there is no code that runs in a parallel that can set this flag.
Changed this to something more logical.

Tested on AT91SAM9261ek and compared the flow on the USB bus to what
Linux is doing. There is no difference anymore in the early initialisation
sequence.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: Markus Klotzbuecher <mk@denx.de>
common/usb.c
drivers/usb/usb_ohci.c
include/usb.h