EHCI Addressing Capability discrepancy

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.
Post Reply
coercion
Posts: 1
Joined: Tue Nov 27, 2012 3:09 am

EHCI Addressing Capability discrepancy

Post by coercion »

I'm writing a simple msc driver. I have successfully reset ehci, identified high speed usb devices, reset ports, enumerated descriptors and finally written/read a flash drive.

It works fine on the box I started development on. 64 bit cpu running 32 bit ubuntu. I was using the 64 bit QH and qTD data structures & zeroing out CTRLDSSEGMENT. When I tested on a different box with the same setup I received a master abort when attempting the first setup transaction. On a whim I switched to using 32 bit data structures and voila it works!

The problem is the HCCPARAMS 64-bit addressing capability field indicates the controller has 64-bit addressing capability. According to the EHCI docs "The value of this field determines whether software should use the data structures defined in Section 3 (32-bit) or those defined in Appendix B (64-bit)" It is set to "1" on both boxes, but box 1 performs fine whether I use 32 bit or 64 bit data structures, while box 2 only likes 32 bit data structures.

So now I'm confused as to how exactly I'm supposed to determine what data structures to use. I saw another thread on this board where someone was receiving a master abort because he wasn't using 64 bit data structures, so I know I can't just default to 32 bit and call it a day. I would like this to be relatively portable.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: EHCI Addressing Capability discrepancy

Post by thepowersgang »

If I recall correctly, even if the controller supports 64-bit addressing, it may not be able to access it (due to PCI not always supporting 64-bits). Quite likely this is what is happening.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply