Pinebook Pro keyboard (RK3399 OHCI)?

Simon South simon at simonsouth.net
Thu Oct 1 16:56:44 CEST 2020


Simon South <simon at simonsouth.net> writes:
> Has anyone managed to get the built-in keyboard of the Pinebook Pro
> working with U-Boot?
>
> Even using the latest code, having USB started makes the U-boot
> console feel sluggish while pressing keys on the keyboard produces no
> result.

To follow up on this, for anyone looking into it in the future:

The issue is that the Pinebook Pro's keyboard firmware does not actually
implement the keyboard boot protocol (described in the USB HID
specification[1]). It also doesn't support retrieving input reports via
its control interface, meaning neither of the two mechanisms U-Boot
normally uses for polling keyboard data are functional.

The firmware does recognize the Set_Protocol request, and will even
store the supplied value in the controller's memory and return it in
response to Get_Protocol. But it doesn't actually change how the
keyboard operates.

As such, the keyboard continues to NAK every interrupt-transfer request
it sees (whenever the user isn't pressing a key), despite U-Boot
expecting it to return a report at least once each 40-millisecond
period. Consequently the submit_common_msg() routine in
drivers/usb/host/ohci-hcd.c is continually timing out waiting for a
response, and this slows down the U-Boot console considerably.

Arnaud Patard has pointed out setting the
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE configuration option seems to
improve the keyboard's responsiveness somewhat, and while this is true,
I suspect all this does is increase the likelihood U-Boot will happen to
be polling the keyboard at the same moment the user is pressing a
key. It doesn't address the underlying problem.

In fact, nothing seems likely to address this unless and until new
keyboard firmware is created for the Pinebook Pro. There has actually
been some progress in this area[2], but the complexity involved in using
an external programmer with the controller[3] (and the possibility of
bricking it without one) makes it risky for an end-user to experiment
with anything beyond very minor changes to the existing code.

[1] https://www.usb.org/document-library/device-class-definition-hid-111
[2] https://github.com/jackhumbert/pinebook-pro-keyboard-updater/tree/master/firmware
[3] https://electronics.stackexchange.com/a/277395

-- 
Simon South
simon at simonsouth.net


More information about the U-Boot mailing list