[U-Boot] [PATCH 0/2] usb_kbd with DM enabled

Michal Simek michal.simek at xilinx.com
Wed Jun 27 13:10:19 UTC 2018


Hi,

I am playing with usb keyboard support with USB_DM on and I see some
issues which I want to share with you.
First of all there is missing support for multiple usb keyboards because
all are registered as usbkbd.
This can be changed by
-       strcpy(usb_kbd_dev.name, DEVNAME);
+       snprintf(usb_kbd_dev.name, sizeof(usb_kbd_dev.name),
+                "%s%x", DEVNAME, dev->devnum);

That devnum ID will be added there and then from usb tree you can see
which usb device should be used for example "setenv stdin usbkbd5"
Unfortunatelly remove part should be also handled to point to proper
stdio_dev.

Why there is usb-keyboard compatible string? Code is discovering
usb when usb start is called. Or is there also support via DT?

Next thing what I found a problematic is when probe_usb_keyboard()
is called from usb_kbd_probe(). There is code which reads stdin variable
if it is not setup to usbkbd then probe fails which seems to me wrong.
I for example want to start with serial and then start usb and use input
from keyboard or both. That's why I think this code should be out of DM
probe function and probing shouldn't be mixed with user setting.

Last but not least I see with kermit double echo when usbkbd is used
which is quite weird.
Similar problem was reported here.
https://lists.denx.de/pipermail/u-boot/2014-November/196713.html
Do you know what's the reason for that echo?
(usb_kbd_getc() is really returning only one char).

Thanks,
Michal


Michal Simek (2):
  usb_kbd: Add support for watchdog
  usb_kdb: Get stdio_dev directly from sdev pointer

 common/usb_kbd.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

-- 
1.9.1



More information about the U-Boot mailing list