I've been working on understanding how to implement USB support. My code is running in real mode (at least for now), booting from a USB drive (so I don't even scan the PCI bus for the EHCI controller, I just use INT 0x13/AH=0x48). I've left the BAR as the BIOS has it configured.
My EHCI controller supports the Pre-OS to OS handoff synchronization capability (section 5.1 of EHCI specs), and I've successfully transfered ownership from the BIOS over the EHCI controller (the BIOS appears to issue a reset to the controller in doing this).
I've successfully reset the controller (again), initialized registers, enumerated ports with devices attached, and reset those ports.
I've arbitrarily picked an offset of 32MBs to start storing the data structures for the asynchronous schedule (each structure aligned to a MB, so I'm certain that alignment is not an issue), the isochronous schedule is turned off. I've been sure to execute wbinvd before enabling the asynchronous schedule, so that I know the structures have been committed to system memory.
I've added slightly longer delays than called for in the USB 2.0 specs, and I've even added delays of up to 5 seconds after bringing ports up and preparing the data structures, but before starting the asynchronous schedule.
When I do start the schedule, the EHCI controller does not advance the queue before it halts with a status flag to indicate
So I checked the value of the PCI Configuration Space's Status register, which turned out to be 0x2290, indicating that the device received a master abort. I gather that this means the EHCI controller is unable to read from system memory, though the bus mastering bit is set... so I'm a little lost, could anyone please help point me in the right direction?Host System Error... In a PCI system, conditions that set this bit to 1 include PCI Parity error, PCI Master Abort, and PCI Target Abort.
Thanks