Date: Sat, 07 Feb 2015 07:07:03 +0100 From: Hans Petter Selasky <hps@selasky.org> To: "O'Connor, Daniel" <darius@dons.net.au> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: Two drivers sharing a single PCI device Message-ID: <54D5AB87.9050309@selasky.org> In-Reply-To: <F6DF0E64-EFFC-4CC9-8375-85F88AE0941F@dons.net.au> References: <643918BB-810C-4FB2-AE1A-C4CDA6C8A661@dons.net.au> <54D4ABA6.805@selasky.org> <F6DF0E64-EFFC-4CC9-8375-85F88AE0941F@dons.net.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On 02/06/15 13:33, O'Connor, Daniel wrote: > >> On 6 Feb 2015, at 22:25, Hans Petter Selasky <hps@selasky.org> wrote: >> On 02/06/15 04:50, O'Connor, Daniel wrote: >>> Hi, >>> I am working on an EHCI debug driver and I have the basics working (attach, probe for a debug dongle and send data back and forth) - https://bitbucket.org/DJOConnor/dbgp >>> >>> However one problem remaining is that for it to work you have to detach the EHCI driver (obviously rather suboptimal :) so I am wondering what the best way would be to allow both ehci and dbgp to attach to the same PCI device. >>> >>> The dbgp driver doesn't touch the EHCI registers once it's running but it does have some code to start the EHCI controller and reset the port during attach. >>> >>> I can modify echi so it uses RF_SHAREABLE which should allow them to get newbus handles to the same area but the problem is that only one probe routine gets called. >> >> You possibly want "D_TRACKCLOSE" in d_flags in your cdevsw. > >> What's the advantage of using the debug port over the regular EHCI USB interface? > > I don't think that would help. It is supposed to be (largely) separate from the regular EHCI controller - it has it's own register set and it can steal the debug port from the regular controller so it doesn't appear occupied (although there is a bit of messing around on port reset). > > The advantage is that it runs separately to the EHCI interface and it is quite simple to talk to, there is more information in appendix C of the USB 2 spec (usb_20.pdf). > Hi, You know about "sys/boot/usb" ? If you could integrate the USB debug port to use the kernel USB stack HOST API, only limited to BULK, CONTROL and INTERRUPT, then we could easily use it there aswell. The EHCI debug port functions very much resemble those found in "sys/dev/usb/controller/dwc_otg*" for example. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54D5AB87.9050309>