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

Thomas Huth thuth at redhat.com
Wed Aug 5 19:51:51 AEST 2015


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:
>>
>>>  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?
...
>> 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? Or
how is a USB 1.1 or 2.0 device supposed to be working with a XHCI as
host controller?

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

 Thomas



More information about the SLOF mailing list