tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Merging ugen into the usb stack
Ok, after playing a bit more with Linux and OpenOCD (and getting kind
help from the openocd mailing list to unbrick my device), I think
I now understand a bit better how it plays together and what could
be done.
So Linux does:
- on certain fdti devices the first port of the chip is "skipped", as the
port is reserved for JTAG usage.
- when libusb takes over controll (as Steffen described) a kernel driver
that would have attached (i.e. when the skipping does not happen or
the userland application is configured wrong) is detached, so no
concurrent access between libusb and a kernel driver can ever happen
It should be pretty easy for us to do something similar. So overall this
proposal turns into:
- make all "passive" enumeration/discovery and maybe descriptor query
(as long as it does not change state of the usb device) generically
available for all usb devices, no matter what driver attached
- implement the driver detach in libusb (if a driver != ugen has attached)
- add a quirk table to uftdi listing the JTAG-on-port-X devices and only
attach ucom on the non-reserved ports
- add a variation of uftdi that attaches on single interfaces (Wolfgang,
can you share your code, even if it does not work with -current?), and
either always use this variant, or use this variant on chips matched
by above mentioned quirks table.
- make ugen be able to attach to single/specific interfaces as well (off
hand I'm not sure this would need code changes, but again, Wolfgang,
could you make your patches available?)
This should avoid all concurrent access issues in a clearly defined way,
and also should be pretty simple to implement (even if we do not do the
first item initially, it would still make the ftdi JTAGs useable
immediately).
Martin
Home |
Main Index |
Thread Index |
Old Index