Dear SpyderTL, zaval, and Ben.
I looked more carefully into my code based on what you suggested.
Finally I figured out that the main issue came from my buggy PCI_Write method and I fixed it and it works now.
But I would like to reply to all your suggestions and what I found:
Quote:
EDIT: Also, that negate (~) looks wrong. I think that last line should just be:
Code:
Code:
if ((leg_sup & LEGSUP_HC_BIOS) == 0)
break;
It makes here more sense to me to have like what you proposed (cleaner and less ambiguous).
Quote:
Is it really meant to be that leg_sup should have set both LEGSUP_HC_BIOS and LEGSUP_HC_OS?
I think not necessarily, but I was not careful before your mentioning. Now I fixed it. I had even a look at the Standalone EHCI usb debug driver in linux EHCI implementation
https://github.com/torvalds/linux/blob/master/drivers/usb/early/ehci-dbgp.c and I guess it is not needed to keep all the bits set.
Quote:
If you have an Intel ICH5 mobo (vendor:device 0x24DD8086), there is another Legacy register you have to use
I checked my hardware and could not find it.
Quote:
If you switch the first EHCI controller from BIOS to OS and then start to initialize it while another EHCI is still in legacy mode (BIOS owned), that second ECHI controller will never come out of Legacy mode
Indeed I have two EHCI controller on my PCI. In the beginning, after seeing your reply to my post and apart from caring about being mobo or not, I tried to get the BIOS control passed to the OS alternatively but both cases failed until I figured out my PCI_Write problem.
Thanks for all of your instructive comments.
Iman.