[coreboot] xHCI support for x86

Pitrolle Jean-Jacques jpi at sysgo.com
Wed Nov 23 11:09:26 CET 2016

Hello *,
I try to integrate coreboot *libpayload usb stack* in a custom binary 
for x86.
I already succeed integration of *ehci* for *qemu* and *core 2 duo* 

But things seems to be not so easy for *xhci*.
When I try to run coreboot master branch (with hash 8bf3f7a) on qemu 
(version 2.7.0)
with following line :
  % qemu-system-x86_64 -bios build/coreboot.rom -serial stdio -drive 
if=none,id=usbstick,file=/tmp/qemu_usb.disk -usb -device 
nec-usb-xhci,id=xhci -device usb-storage,bus=xhci.0,drive=usbstick

I get these output lines concerning xHCI controller (nec-usb-xhci) :
00:04.0 0194:1033.0 xHCI controller
xhci_init: regbase: 0xfe070000
xhci_init: caplen:  0x40
xhci_init: rtsoff:  0x1000
xhci_init: dboff:   0x2000
xhci_init: hciversion: 0.0
xhci_init: Unsupported xHCI version

The same result is reached with qemu-system-i386...

Is it the expected result on qemu?

I don't have any motherboard supported by coreboot, so I try a custom 
binary  on
a *Xeon* processor (processor D-1500).
The xHCI version is supported (hciversion: 1.0) but things turn bad when 
xHCI controller i.e xhci->opreg->usbcmd |= USBCMD_RS in *xhci_start* : 
the program hangs...
The registers usbcmd and usbsts before this command seems to have proper 
values (a usb key
is connected.)
  xhci_start - usbcmd:0 - usbsts:11

This seems to be related to interrupter configuration. When I comment 
out the two lines
in *xhci_reinit*
     xhci->hcrreg->intrrs[0].erstba_lo = virt_to_phys(xhci->ev_ring_table);
     xhci->hcrreg->intrrs[0].erstba_hi = 0;
xhci_start works as expected i.e not hangs.

But the sequence following with *NOOP* to test command ring and event 
ring mechanism fails.
NOOP run #0
Transfer TRB (@0x8051700):
  PTR_L  0x00000000
  PTR_H  0x00000000
  STATUS 0x00000000
  CNTRL  0x00005c00
  TL     0x0000
  TDS    0x0000
  C      0x0000
  ISP    0x0000
  CH     0x0000
  IOC    0x0000
  IDT    0x0000
  TT     0x0017
  DIR    0x0000
Command 23 (@0x8051700)
Warning: Timed out waiting for TRB_EV_CMD_CMPL.
Command ring is running

As I understand it is mandatory to have the first interrupter configure 
to manage
at least one event ring (4.9.4 Event Ring Management - eXtensible Host 
Controller Interface
Revision 1.1).

Does someone succeed with xHCI support for x86 board?
Did I miss something concerning xHCI configuration?

Have a nice day.

Jean-Jacques PITROLLE
Phone: +33 1 30 09 12 70

More information about the coreboot mailing list