Enhanced Host Controller Interface (EHCI): Understanding USB 2.0 High-Speed Communication

Delve into the Enhanced Host Controller Interface (EHCI) specification for USB 2.0. This guide explains EHCI's role in managing high-speed USB communication between hardware and software, covering its architecture, functionality, and interaction with other USB controllers.



Enhanced Host Controller Interface (EHCI)

What is EHCI?

EHCI (Enhanced Host Controller Interface) is a specification defining the interface between a USB 2.0 host controller and the system software. It acts as a bridge, managing communication between the controller's hardware and the software running on the system.

EHCI and USB 2.0

The EHCI specification details both the hardware and software interfaces. It's intended for system designers and driver developers. In case of conflicts with the USB 2.0 specification, the USB 2.0 specification takes precedence.

USB 2.0 Host Controller Architecture

A USB 2.0 host controller typically incorporates an EHCI (for high-speed devices) and a companion controller (like OHCI or UHCI) for full- and low-speed devices. The companion controller manages full- and low-speed devices connected to the system's root ports. The EHCI manages high-speed devices. When an EHCI is initialized, it claims ownership of all root ports. If a device is not high-speed, the EHCI releases ownership to the companion controller.

Key Features of EHCI

1. Comprehensive USB 2.0 Support

EHCI fully supports all USB 2.0 features, including high, full, and low-speed devices. This includes support for advanced features like split transactions and extensions to existing protocols (like the PING protocol).

2. Low-Risk Support for Full- and Low-Speed Devices

EHCI efficiently handles both high-speed and full/low-speed devices by leveraging existing USB 1.1 controller hardware and software. This ensures backward compatibility without sacrificing performance for high-speed devices.

3. Enhanced Power Management

EHCI supports aggressive power management features, integrating with the PCI power management interface (if applicable).

4. Addressing USB 1.1 Host Controller Issues

EHCI addresses issues like memory thrashing, power management conflicts, and inefficient memory access present in previous USB 1.1 host controller architectures.

5. Optimized Memory Access

EHCI optimizes memory access by efficiently managing data buffers, minimizing memory overhead.

6. Reduced Hardware Complexity

EHCI provides a simpler, asynchronous software interface with parameterized work items, allowing asynchronous task addition and execution without requiring software synchronization. It also simplifies hardware implementation through a scatter-gather approach for data structures.

7. Support for 32-bit and 64-bit Addressing

EHCI supports both 32-bit and 64-bit addressing, making it compatible with a wider range of system architectures.

EHCI Architecture

The EHCI architecture includes separate schedules for different transfer types (isochronous, interrupt, control, bulk). The periodic schedule handles isochronous and interrupt transfers using a time-based frame list. The asynchronous schedule handles control and bulk transfers using a circular list of work items.

Software can control scheduling, enabling power-saving techniques in mobile systems by stopping schedules when not needed.

EHCI Internal Spaces

  • PCI Configuration Space: Used for system component enumeration and power management (if PCI registers are used).
  • Register Space (I/O space): Contains registers for configuration and status.
  • Scheduled Interface Space: Memory managed by the EHCI driver for scheduling data structures.

EHCI Schedule Data Structures

EHCI uses queues to manage data transfers, facilitating efficient, in-order data streaming and handling short packets without requiring extra software intervention.

Conclusion

The EHCI specification significantly improved USB host controller design, addressing limitations of previous architectures and enabling efficient handling of high-speed USB 2.0 devices while maintaining compatibility with older devices.