UHCI Initialization Procedure

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
VBEnrico
Posts: 3
Joined: Thu Apr 22, 2010 12:19 pm

UHCI Initialization Procedure

Post 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
User avatar
iocoder
Member
Member
Posts: 208
Joined: Sun Oct 18, 2009 5:47 pm
Libera.chat IRC: iocoder
Location: Alexandria, Egypt | Ottawa, Canada
Contact:

Re: UHCI Initialization Procedure

Post 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
VBEnrico
Posts: 3
Joined: Thu Apr 22, 2010 12:19 pm

Re: UHCI Initialization Procedure

Post 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
User avatar
ehenkes
Member
Member
Posts: 124
Joined: Mon Mar 23, 2009 3:15 am
Location: Germany
Contact:

Re: UHCI Initialization Procedure

Post 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:
Last edited by ehenkes on Sun May 16, 2010 6:01 pm, edited 1 time in total.
VBEnrico
Posts: 3
Joined: Thu Apr 22, 2010 12:19 pm

Re: UHCI Initialization Procedure

Post 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
User avatar
iocoder
Member
Member
Posts: 208
Joined: Sun Oct 18, 2009 5:47 pm
Libera.chat IRC: iocoder
Location: Alexandria, Egypt | Ottawa, Canada
Contact:

Re: UHCI Initialization Procedure

Post 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.
User avatar
XanClic
Member
Member
Posts: 138
Joined: Wed Feb 13, 2008 9:38 am

Re: UHCI Initialization Procedure

Post 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:
User avatar
iocoder
Member
Member
Posts: 208
Joined: Sun Oct 18, 2009 5:47 pm
Libera.chat IRC: iocoder
Location: Alexandria, Egypt | Ottawa, Canada
Contact:

Re: UHCI Initialization Procedure

Post 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.
Post Reply