Hi Harald,
I've now extended u-boot to accept physical device paths as
a
selection criteron. Usage:
dfu-util -p 1+0+2
This would select bus 1, then port 0 of the root hub, and
then
port 2 of the hub placed there.
Prerequisite: libusbpath must be installed. To ease
transition,
I've made the use of libusbpath conditional for now.
To determine the path to a device, do this:
- lsusb to find out bus and device number
- usbpath bus/devnum to translate this to a path
E.g.,
# lsusb
...
Bus 001 Device 025: ID 1457:511a
...
# usbpath 1/25
1+0
# dfu-util -p 1+0 ...
usbpath (which also provides libusbpath) is in
http:
//svn.openmoko.org/trunk/src/host/usbpath/
svn diff is attached. Since the search logic has now gotten
more
complex, I've merged the almost identical code of
get_first_dfu_device and count_dfu_devices into a new
function
iterate_dfu_devices that uses a callback to decide what to
do.
Okay to commit ?
- Werner
|