# Universal Host Controller Interface (UHCI)

The driver for the UHCI chip lives at drv/usb/uhci.fs and provides a HCI struct
that is compatible with the rest of the USB subsystem [drv/usb] .

Although theoretically, UHCI isn't tied to PCI or to little endian or to i386
I/O operations, this driver is. It needs reworking to make it work in other
contexts.

## Usage

After loading the unit, you call "uhci$" to initialize it. This will enumerate
the PCI bus (only bus 0 for now), looking for an address yielding the right
PCI signature. Once it found it, it looks into its PCI configuration for a
proper I/O base port, which it write to "baseport"

From that point on, we have access to UHCI registers.

Once that is done, a reset signal is sent to USBCMD and other registers are
configured so that the UHCI points to the right places in memory.

Then, a Hub structure is created and added to the global "hubs" LL. From that
point on, our UHCI root hub is picked up by the USB subsystem (through "usbwork"
and friends.

Then, the RUN command is sent to USBCMD and we're done.

For example, one thing to can do is to plug a device into one of the USB ports
and do "uhci$ usbwork lsusb". You should see that device in the "lsusb" listing.
