Page 1 of 1

UHCI Initialization Procedure

Posted: Sat May 15, 2010 7:15 am
by VBEnrico
Hello,

I plan UHCI driver and I want to know what is the initialization procedure.

For example:

1) HCRESET
2) Reset port

etc.

Sorry for my English but I'm Italian

Re: UHCI Initialization Procedure

Posted: Sat May 15, 2010 8:13 am
by iocoder
Buona sera signore,
I'm currently working also on a UHCI driver, my initialization code does the following:

1- Initializes arrays that will be used, which are an Array for QHs, an Array for TDs, and an Array for Frame List.
2- Uses the machinsm of Linux in calculating number of ports.
3- Turns off Legacy Support for Keyboard and Mouse. (Linux does that, but i think removing that step is better).
4- does a HCReset.
5- Disables Interrupt requests (Just to be safe).
6- Finally, Resets the ports.

Than, it initializes the Universal Host Controller:
1- Sets SOFMOD register to 64. (In order to make each frame take 1ms).
2- Sets the frame list entries to 0x00001.
3- Sets FRBASEADD register to the base of the array of frame list in memory.
4- Sets UHCI_REG_FRNUM to Zero
5- Finally, sets UHCI_REG_USBCMD to 0x01 (RUNNING Mode).

Now you are ready to make TDs and to transfer data with drives, you should make a function that watches changes in attached and detached drives, and when a new connected device is found, you should enumerate it. I'm now working on Enumeration, i hope to finish it successfully.

Finally i would say that sono egiziano ma studio l'italiano a scuola perche` l'italiano e` una lingua facilissima e musicale.

Regards,
Mostafa

Re: UHCI Initialization Procedure

Posted: Sun May 16, 2010 1:30 am
by VBEnrico
Ciao, grazie per aver risposto

In questo mondo c'è ancora qualcuno che studia l' italiano? :lol:

However, now UHCI driver works. I changed the initialization procedure as you said.

But it don't work with all devices, it work only with a usb mouse or usb tablet.

This devices(mouse and tablet) show a SPD(Short Packet), maybe the other devices don't work for that?

Saluti, Enrico

Re: UHCI Initialization Procedure

Posted: Sun May 16, 2010 5:10 am
by ehenkes
UHCI does not work with hi-speed devices. There you might need an EHCI driver: http://prettyos.svn.sourceforge.net/vie ... nel/ehci.c (PrettyOS)

EDIT: UHCI does not work with hi-speed devices in hi-speed mode (sorry for being not fully correct) :shock:

Re: UHCI Initialization Procedure

Posted: Sun May 16, 2010 9:23 am
by VBEnrico
Hello, ehenkes

That is not true. You can connect hi-speed devices to UHCI or OHCI, but they must work. Although in this case the devices in high-speed works in low-speed.

Saluti, Enrico

Re: UHCI Initialization Procedure

Posted: Sun May 16, 2010 12:01 pm
by iocoder
Buonasera!
In questo mondo c'è ancora qualcuno che studia l' italiano?
Certo! l'italiano e` studiato approssimativamente in tutto il mondo.
But it don't work with all devices, it work only with a usb mouse or usb tablet.
well, how don't that devices work, or what kind of trobules happens?? although i'm a beginner but i, or somebody else, might help you.
UHCI does not work with hi-speed devices.
in my point of view, as long as the device appears to UHCI, so it is able to work in low and full speed. it may also appear to EHCI if it supports hi-speed. if it is only hi-speed, i think it shall appear to EHCI only.
i will try to figure that out to make sure of that.

Regards e Saluti,
Mostafa.

Re: UHCI Initialization Procedure

Posted: Sun May 16, 2010 1:00 pm
by XanClic
mostafazizo wrote:if it is only hi-speed, i think it shall appear to EHCI only.
Such devices would not be USB 2.0 compliant and are thus forbidden (every high speed device must somehow work in full speed mode, too). :wink:

Re: UHCI Initialization Procedure

Posted: Sun May 16, 2010 2:16 pm
by iocoder
XanClic wrote:
mostafazizo wrote:if it is only hi-speed, i think it shall appear to EHCI only.
Such devices would not be USB 2.0 compliant and are thus forbidden (every high speed device must somehow work in full speed mode, too). :wink:
yes you are right, i figured that out. any hi-speed device should support full-speed transforms, or it breaks the USB Standard Specification for USB2.