Enhanced Host Controller Interface

From OSDev.wiki
Revision as of 03:17, 23 April 2017 by osdev>Spydertl (Added Capability Registers)
Jump to navigation Jump to search

EHCI (Enhanced Host Controller Interface) is the Single method of interfacing with USB 2.0. This makes life a lot easier than with USB 1.0, where 2 incompatible standards both survived. This is because the USB-IF insisted on a single implementation, produced by Intel.

Interface

On a PC you will normally find the EHCI USB controller on the PCI bus - in fact it is the only access method specified in the specification. USB 2.0 supports interfacing with USB 1.0 devices. However, EHCI is NOT expected to support them. Instead, you will find an UHCI or OHCI companion controller. Therefore you must implement OHCI and UHCI as well. Note there are NOT companions of both types, it is one type or another.

The EHCI controller will always have a PCI Class ID of 0x0C, a Subclass ID of 0x03, and an Interface value of 0x20. These values can be used to find the configuration space of the controller, which contains the memory mapped address of the EHCI registers. The address information can be found in the BAR0 PCI configuration space register.

Capability Registers

The capability registers can be found in memory at the address specified in the PCI configuration space BAR0 register.

Offset (Hex) Name Description
00 CAPLENGTH Capability Register Length
01 Reserved
02 HCIVERSION Interface Version Number (BCD)
04 HCSPARAMS Structural Parameters
08 HCCPARAMS Capability Parameters
0C HCSP-PORTROUTE Companion Port Route Description

Operation Registers

The operation register can be found after the capability register area in memory. Add the Capability Register Length value above to the BAR0 address to find the operation register base address.

Offset (Hex) Name Description
00 USBCMD USB Command
04 USBSTS USB Status
08 USBINTR USB Interrupt Enable
0C FRINDEX USB Frame Index
10 CTRLDSSEGMENT 4G Segment Selector
14 PERIODICLISTBASE Frame List Base Address
18 ASYNCLISTADDR Next Asynchronous List Address
40 CONFIGFLAG Configured Flag Register
44 PORTSC[1-N_PORTS] Port Status/Control Register

See Also

Articles

External Links