Date: Sat, 15 Nov 2014 17:32:39 +1030 From: "O'Connor, Daniel" <darius@dons.net.au> To: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Newbus question Message-ID: <EE77EB4C-E317-4EAB-9319-18F0B292571F@dons.net.au>
next in thread | raw e-mail | index | archive | help
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=92t 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=20 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D MOD_LOAD =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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-s= pecifications/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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EE77EB4C-E317-4EAB-9319-18F0B292571F>