Tuesday 17 February 2015

USB Host Controllers: OHCI, UHCI, and EHCI

USB Host Controllers: OHCI, UHCI, and EHCI

What’s the difference between OHCI, UHCI, and EHCI?
First, Some Background Info
The hardware that contains the USB host controller and the root hub has a programming interface called the Host Controller Device (HCD).   This is realized as a set of hardware registers defined in the computer or interface card (e.g. PCI).   The specific hardware implementation is defined by the silicon designer.
In USB 1.x, There Were Two Standards
For USB versions 1.0 and 1.1, there were two different HCD implementations.  Compaq was first to the party with the Open Host Controller Interface (OHCI), which was adopted as the standard by the USB-IF.  However, Intel created its own specification called the Universal Host Controller Interface (UHCI) and insisted other companies pay Intel for the right to use it.   Apparently Intel didn’t learn how to play nicely with the other children back in kindergarten.  VIA Technologies licensed the UHCI standard from Intel, and pretty much all the other USB silicon implementers stuck with OHCI.
Compared with UHCI,  EHCI moves more intelligence into the controller, and thus is more efficient, which was part of the motivation for defining it.   UHCI is much more software-driven, which makes it more processor-intensive,  but slightly cheaper to implement in silicon. Unless you count the license fees charged by Intel.
The register interfaces for OHCI and UHCI look and work completely different, and so they are totally incompatible.  The two conflicting implementations forced operating system vendors and hardware vendors to develop and test on both implementations, which has increased costs and complexity for everyone. Including those who have to write USB host controller device drivers, such as embedded systems developers.
Along Came USB 2.0
During the design phase of USB 2.0, the USB-IF stubbornly insisted on only one HCD implementation….take that, Intel!   The HCD implementation in USB 2.0 is called the Enhanced Host Controller Interface (EHCI).   The main enhancement in USB 2.0 was the addition of high-speed mode  (480 MiBits/s).
Under USB 2.0, each EHCI controller contains four virtual HCD implementations, which allows a standard driver interface, but under the hood the earlier schism remains, with Intel/VIA supporting the UHCI standard, and all others following the OHCI standard.
Looking into the future – USB 3.x
Now, with USB 3.0, the USB-IF has added the Extensible Host Controller Interface (xHCI).  This standard actually replaces UHCI/OHCI/EHCI (thank goodness!).  USB 3.0 adds a fourth transfer rate called SuperSpeed (5 Gbit/s raw, 3.2 Gbit/s nominal), while maintaining compatibility with the earlier standards.

No comments: