Newbus question
O'Connor, Daniel
darius at dons.net.au
Sat Nov 15 07:08:10 UTC 2014
Hi,
I am trying to write a driver for the EHCI debug port [1]. I found some userland code which I got working (written by the person who did the Linux version) and now I am trying to get it running in the kernel. One problem I have is that it needs to run in parallel with the normal EHCI controller. It uses the same BAR as the EHCI controller but offset (the offset is found in a PCI capability). I think I can bus_alloc_resource() if I change EHCI to allocate with RF_SHAREABLE but my first problem is to add another device so my driver doesn’t contest with the EHCI driver.
Currently I have a module which loops over bus/slot/func using find_bsf (is there a way to enumerate all connected PCI devices?) and then check each for the debug capability (I plan on being a bit pickier later but it works so far) then creating a child device. The problem is that the probe routine
The code I have so far is at https://gist.github.com/DanielO/f0f6643de567981a9a10 and the output I get is..
Driver is dbgp
Probed
Driver is dbgp
Probed
Driver is dbgp
Probed
Driver is dbgp
Probed
Driver is dbgp
Probed
Driver is dbgp
Probed
========== MOD_LOAD ==========
Found debug capability on 0.26.0 at 0xa0 map 0x14
start 0xf7f18000 length 1024
Child already present
Found debug capability on 0.29.0 at 0xa0 map 0x14
start 0xf7f17000 length 1024
Child already present
This is after a fresh reboot so I am a little perplexed..
1 - Appendix C of http://www.intel.com.au/content/dam/www/public/us/en/documents/technical-specifications/ehci-specification-for-usb.pdf
- http://komposter.com.ua/documents/USB-2.0-Debug-Port(John-Keys).pdf has a nice overview
--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
More information about the freebsd-hackers
mailing list