[SLOF] Keyboard not working when using XHCI as a USB host controller?

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Wed Aug 5 21:11:59 AEST 2015


Hi Thomas,

Thomas Huth <thuth at redhat.com> writes:
> On 05/08/15 06:22, Nikunj A Dadhania wrote:
>> Nikunj A Dadhania <nikunj at linux.vnet.ibm.com> writes:
>> 
>>> Thomas Huth <thuth at redhat.com> writes:

>>>> 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?
> ...
>>> 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.
>
> Sorry, I did not quite get that point yet ... that's a bug, isn't it?

Current SLOF XHCI code only supports usb3 (SuperSpeed) devices that too
only Mass Storage Class(MSC) is tested. We have not added legacy support
on XHCI. At that point qemu too did not support USB Keyboard with
HighSpeed.

> Or how is a USB 1.1 or 2.0 device supposed to be working with a XHCI
> as host controller?

We would need to start scanning for usb2.0 and usb 1.1 devices as it
appears separately on different ports.

> BTW, the keyboard is working in Linux with XHCI, so this issue only
> happens in SLOF.

Yes, that would work, SLOF does not have support as I had mentioned.

Regards
Nikunj



More information about the SLOF mailing list