8/18/2014

iPXE, new hardware for testing


Just received two Syba PCI cards for testing.
SD-VIA-5U - VIA (UHCI host controller Interface)


SD-V2-5U - NEC (OHCI host controller interface)


Form factor "wise" they look nearly identical




These cards are 4 + 1 which means the internal USB port is actually attached to one of the external ports and cannot be use simultaneously with the other port. So in actuality they are 4 port cards.

The PCI bus is (of course) 32 Bit and 33 Mhz Local Bus spec 2.2, the double notches in the cards indicate they are "Universal PCI cards" meaning they will work in 5 volt or 3.3 volt PCI 32 bit slots.

The boxes indicate they are for Windows 98SE through Windows 7, Linux and OSX (OHCI only).

These were popular and mainstream from 1996 through 2006, and probably lead to their targeted use in the original 2008 code to provide USB Ethernet support for gPXE.

They are rarer to find these days.

Sorting out which card provides UHCI or OHCI by chipset is made difficult because the chipset is only rarely mentioned in the specifications quoted by websites.

Both cards support the EHCI standard, which provides USB 2.0 "Hi-Speed" which can be seen as a [third] device for each card, and is given its own PCI identifier.

I have not decided on a xHCI standard card, which provides USB 3.0 "SuperSpeed"

Using PCITree on Windows [reveals] both cards are detected as being attached to a PCI Bus bridge and assigned function and device numbers.

I have highlighted the PCI vendor and device numbers in gold.

:  0.30.0    0->6 (6)  Subtractive; PCI/PCI; Bridge Device  8086 244e [Intel] 82801 Family (ICH2/3/4/5/6/7/8/9,63xxESB) Hub Interface to PCI Bridge: 82801 Family (ICH2/3/4/5/6/7/8/9,63xxESB) Hub Interface to PCI Bridge // SubIDs 0000 0000 --------------:
:  :  6.02.0        Open Host Controller; USB (Universal Serial Bus); Serial Bus Controller  1033 0035 [NEC] uPD9210/72010xx USB Open Host Controller: uPD9210/72010xx USB Open Host Controller // SubIDs 1033 0035  USB OpenHCI Controller: USB OpenHCI Controller
:  :  6.02.1        Open Host Controller; USB (Universal Serial Bus); Serial Bus Controller  1033 0035 [NEC] uPD9210/72010xx USB Open Host Controller: uPD9210/72010xx USB Open Host Controller // SubIDs 1033 0035  USB OpenHCI Controller: USB OpenHCI Controller
:  :  6.02.2        o. serial bus Device  1033 00e0 [NEC] uPD720100A/101 USB 2.0 Enhanced Host Controller: uPD720100A/101 USB 2.0 Enhanced Host Controller // SubIDs 1033 00e0  USB 2.0 EHCI Controller: USB 2.0 EHCI Controller
--------------:
:  :  6.03.0        Universal Host Controller; USB (Universal Serial Bus); Serial Bus Controller  1106 3038 [VIA] VT82xxxxx UHCI USB 1.1 Controller (All VIA Chipsets): VT82xxxxx UHCI USB 1.1 Controller (All VIA Chipsets) // SubIDs 1106 3038  VIA: no-name
:  :  6.03.1        Universal Host Controller; USB (Universal Serial Bus); Serial Bus Controller  1106 3038 [VIA] VT82xxxxx UHCI USB 1.1 Controller (All VIA Chipsets): VT82xxxxx UHCI USB 1.1 Controller (All VIA Chipsets) // SubIDs 1106 3038  VIA: no-name
:  :  6.03.2        o. serial bus Device  1106 3104 [VIA] VT6202/12 USB 2.0 Enhanced Host Controller: VT6202/12 USB 2.0 Enhanced Host Controller // SubIDs 1106 3104  VT6202 USB 2.0 Enhanced Host Controller: VT6202 USB 2.0 Enhanced Host Controller

The really nice thing about Host Controller Devices (HCDs) is that they are completely PCI devices, therefore device drivers for them can be built just like device drivers for any other PCI device.

How the PCI device is used however (after its found and initialized) is completely up to the protocol defined by the makers of that type of device.

For example;

Intel defined "how to use" the UHCI type device for "transmitting" and "receiving" USB style communications through one of its physical ports.

 Universal Host Controller Interface (UHCI) Design Guide


Compaq defined "how to use" the OHCI type device for "transmitting" and "receiving" USB style communications through one of its physical ports.



But in the end, the "communications" on the wire of the USB port is the same. That is independent of the Host Controller Device.

So the device driver for each type of device can be made "generic" by exposing a software "interface" common to both types of cards. That "interface" looks the same to any software that doesn't care what specific hardware card is connected to the USB bus.

A third piece of software called the USB "stack" provides common services to a specific USB device attached to the "end of" the USB bus which is in turn attached to the USB Host Controller Device.


To support a new type of Host Controller Device, only a new Host Controller Device driver needs to be written. All it has to do is expose the familiar software "interface" for the USB "stack" to use.

Thus a UHCI, OHCI, EHCI device can support the same USB "stack" and USB devices attached.

Adding support for a new controller type; xHCI, wHCI, ect.. simply requires writing an HCD device driver.

The older HCDs like UHCI and OHCI were reportedly harder to implement, EHCI was reportedly easier to implement (and it was one specification not two) as is xHCI.

Fortunately the Linux operating system also provides a blueprint or guide that demonstrates how to implement HCD drivers to support these controller types. And it appears that was used when originally implementing support in gPXE, and now iPXE support.