EHCI refuses to own ports

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
eddyb
Member
Member
Posts: 248
Joined: Fri Aug 01, 2008 7:52 am

Re: EHCI refuses to own ports

Post by eddyb »

A few conclusions I've reached:
  • EHCI in VirtualBox: I can manage to send a packet, that gets NAKed. No IRQs of any kind sent. Capability registers claim no companion controllers, even if there's an OHCI. No EECP, so BIOS can't be blamed. Setting the Configure Flag bit doesn't have any effect on the ports. Running DSL in VirtualBox reveals that OHCI is used and without it, even if EHCI module is loaded, there's no usb support at all. Not functional.
  • EHCI in VMware: strange behavior, the enabled bits in port registers aren't set, no EECP, no IRQ for device connect/disconnect. DSL seems to not rely on it, a test with a newer kernel proven it's not used. Not functional.
  • UHCI in VMware: it can be used, linux test showed it. Whatever I have in my TD, it just passes by. Replacing the link to the TD in the frame list with 0(should load a TD from address 0) gives a nice error. Also, if don't write the whole frame list with 1(terminate bit set), it also gives an error when it reaches the first link that wasn't written with 1(an example value is 0x61686372). Setting the reserved bits in the link to TD doesn't give an error. Neither invalid PID or other fields in TD. Status or any other field in TD doesn't change. Can be fixed, even if I have to check each line in the driver.
So, advice for anyone who wants to make an EHCI driver: real hardware is your best friend. Not even linux can handle VirtualBox or VMware.
madeofstaples
Member
Member
Posts: 204
Joined: Thu Apr 12, 2007 8:15 am
Location: Michigan

Re: EHCI refuses to own ports

Post by madeofstaples »

I'm skeptical that VMWare has a problem--I know that my roommate and I at least installed OSX86 on VMWare and it synced to his iPod over USB/EHCI, and I have some trouble believing linux cannot use USB 2.0 devices from within VMWare... I'm less familiar with virtualbox but I've heard pretty good things about it...

I'll have to install VMWare again, I think I have some code that could be pretty readily tested... I'm a little busy at the moment but I'll get back to you on this within the next week hopefully. Just to be sure: what version of VMWare are you using?
Some people are offended by the verifiable truth; such people tend to remain blissfully unencumbered by fact.
If you are one of these people, my posts may cause considerable discomfort. Read at your own risk.
eddyb
Member
Member
Posts: 248
Joined: Fri Aug 01, 2008 7:52 am

Re: EHCI refuses to own ports

Post by eddyb »

madeofstaples wrote:I'm skeptical that VMWare has a problem--I know that my roommate and I at least installed OSX86 on VMWare and it synced to his iPod over USB/EHCI, and I have some trouble believing linux cannot use USB 2.0 devices from within VMWare... I'm less familiar with virtualbox but I've heard pretty good things about it...

I'll have to install VMWare again, I think I have some code that could be pretty readily tested... I'm a little busy at the moment but I'll get back to you on this within the next week hopefully. Just to be sure: what version of VMWare are you using?
Last version possible(or with an 3 at the end instead of 4). I tried DSL and OpenSuSE install DVD's rescue system. I could try other distros, too. Something interesting I found while writing this: lsusb for me shows all devices I have under root hub 1.1 :? . It may be that because I don't have USB devices that are high-speed, VMware/VirtualBox doesn't put them under EHCI? It's somehow strange, because I can't find an USB device around that is high-speed(considering what lsusb says) :| . Would a thumb drive work? If is the lack of high-speed devices the problem, I can review my statements :^o .
Even so, I still can't use anything else than UHCI...
Selenic
Member
Member
Posts: 123
Joined: Sat Jan 23, 2010 2:56 pm

Re: EHCI refuses to own ports

Post by Selenic »

eddyb wrote:It may be that because I don't have USB devices that are high-speed, VMware/VirtualBox doesn't put them under EHCI? It's somehow strange, because I can't find an USB device around that is high-speed(considering what lsusb says) :| . Would a thumb drive work?
I think most thumb drives are USB 2.0. Either way, it'd be nice to have a way of including emulated USB devices; I know at least Bochs can do this, though VirtualBox seems to only support pass-through, so if your system will work on Bochs then that would be worth trying...
madeofstaples
Member
Member
Posts: 204
Joined: Thu Apr 12, 2007 8:15 am
Location: Michigan

Re: EHCI refuses to own ports

Post by madeofstaples »

eddyb wrote:Something interesting I found while writing this: lsusb for me shows all devices I have under root hub 1.1 :? . It may be that because I don't have USB devices that are high-speed, VMware/VirtualBox doesn't put them under EHCI? It's somehow strange, because I can't find an USB device around that is high-speed(considering what lsusb says) :| .
Wait: lsusb from within VMWare and from the host OS? As in, you either don't have an EHCI controller/EHCI support in the host OS (unlikely...) or you can be certain that you don't have any USB 2.0 devices (not very likely, but possible...). There are USB 1.1 thumb drives, but I think they'd be hard to find any time recently...

If you are truly only connecting USB 1.1 devices to the system, then yes, they would be handled by the UHCI companion controller, not EHCI...

If you are connecting USB 2.0 devices and they are showing up as USB 1.1 devices, then that might be an indication that VMWare has a problem with EHCI (but it might also be a problem that the virtualized OS isn't properly configured...).
Some people are offended by the verifiable truth; such people tend to remain blissfully unencumbered by fact.
If you are one of these people, my posts may cause considerable discomfort. Read at your own risk.
neato
Member
Member
Posts: 75
Joined: Fri Jan 15, 2010 2:46 am

Re: EHCI refuses to own ports

Post by neato »

If you tested it like you said you were going to, then you would have known that VMWare does support EHCI controllers. :roll:
madeofstaples
Member
Member
Posts: 204
Joined: Thu Apr 12, 2007 8:15 am
Location: Michigan

Re: EHCI refuses to own ports

Post by madeofstaples »

neato wrote:If you tested it like you said you were going to, then you would have known that VMWare does support EHCI controllers. :roll:
If you had read my post like you implied you did, you'd know that I said I would be too busy to try VMWare today but I'd hope to within this week. :roll:

Anyway, I know that VMWare supports EHCI, at least the version I last used did. However, that it worked in OSX86 is not enough evidence for me to say that my situation wasn't simply a fluke (though, again, I strongly doubt it was a fluke).
Some people are offended by the verifiable truth; such people tend to remain blissfully unencumbered by fact.
If you are one of these people, my posts may cause considerable discomfort. Read at your own risk.
neato
Member
Member
Posts: 75
Joined: Fri Jan 15, 2010 2:46 am

Re: EHCI refuses to own ports

Post by neato »

Yet, you were not too busy to come here and post that and the thing before, hmmm... :roll:
madeofstaples
Member
Member
Posts: 204
Joined: Thu Apr 12, 2007 8:15 am
Location: Michigan

Re: EHCI refuses to own ports

Post by madeofstaples »

Yes, I was not too busy to write a quick reply, but was (and still am) too busy to spend the time setting up VMWare and the time looking through old code to figure out which would make a suitable test image. Why don't you do something productive like verify that your own EHCI code works fine in VMWare rather than trolling me for having more important things to do?
Some people are offended by the verifiable truth; such people tend to remain blissfully unencumbered by fact.
If you are one of these people, my posts may cause considerable discomfort. Read at your own risk.
Locked