[SLOF] Keyboard not working when using XHCI as a USB host controller?
Nikunj A Dadhania
nikunj at linux.vnet.ibm.com
Wed Aug 5 14:22:12 AEST 2015
Nikunj A Dadhania <nikunj at linux.vnet.ibm.com> writes:
> Thomas Huth <thuth at redhat.com> writes:
>
>> Hi!
>>
>> When I use the following command line to start a guest:
>>
>> qemu-system-ppc64 -machine pseries,accel=kvm,usb=off \
>> -device pci-ohci,id=usb,bus=pci.0,addr=0x2 \
>> -device usb-kbd,id=input0 -nographic -vga none
>>
>> ... SLOF correctly discoveres a keyboard during USB scan:
>>
>> Scanning USB
>> OHCI: initializing
>> USB Keyboard
>> ...
>> 0 > devalias
>> keyboard : /pci at 800000020000000/usb at 2/usb-keyboard at 1
>> usb0 : /pci at 800000020000000/usb at 2
>> ...
>>
>> However, when I start with an XHCI (or EHCI) controller
>> instead:
>>
>> qemu-system-ppc64 -machine pseries,accel=kvm,usb=off \
>> -device nec-usb-xhci,id=usb,bus=pci.0,addr=0x2 \
>> -device usb-kbd,id=input0 -nographic -vga none
>>
>> ... SLOF does not discover any keyboard:
>>
>> Scanning USB
>> XHCI: Initializing
>> ...
>> 0 > devalias
>> usb0 : /pci at 800000020000000/usb at 2
>> ...
>>
>> Is this supposed to work? Am I doing something wrong?
>
> No, I have never tested this configuration.
>
> I tried enabling debugs in lib/libusb/usb-xhci.c, I dont see the port
> reporting on this device.
>
> info qtree gives this:
>
> bus: pci.0
> type PCI
> dev: nec-usb-xhci, id "usb"
> msi = true
> msix = true
> superspeed-ports-first = true
> force-pcie-endcap = false
> streams = true
> intrs = 16 (0x10)
> slots = 64 (0x40)
> p2 = 4 (0x4)
> p3 = 4 (0x4)
> addr = 02.0
> romfile = ""
> rombar = 1 (0x1)
> multifunction = false
> command_serr_enable = true
> class USB controller, addr 00:02.0, pci id 1033:0194 (sub 1af4:1100)
> bar 0: mem at 0x100000000 [0x100003fff]
> bus: usb.0
> type usb-bus
> dev: usb-kbd, id "input0"
> usb_version = 2 (0x2)
> display = ""
> port = ""
> serial = ""
> full-path = true
> msos-desc = true
> addr 0.0, port 1, speed 480, name QEMU USB Keyboard, attached
>
>
> I suspect that usb-version = 2 would be the reason, the code does not
> see this port.
Here you go:
Section 7.0 and 7.2 of xHCI specs
if (XHCI_XECP_CAP_ID(read_reg32(xecp_addr)) == XHCI_XECP_CAP_SP &&
XHCI_XECP_CAP_SP_MJ(read_reg32(xecp_addr)) == 3 &&
XHCI_XECP_CAP_SP_MN(read_reg32(xecp_addr)) == 0) {
port_cnt = XHCI_XECP_CAP_SP_PC(read_reg32(xecp_addr + 2));
port_off = XHCI_XECP_CAP_SP_PO(read_reg32(xecp_addr + 2));
So we scan 3.0 ports, and as its reported as 2.0, it would not appear
in the port list.
Regards
Nikunj
More information about the SLOF
mailing list