* [U-Boot] [PATCH 1/3] usb: properly re-initialize the USB keyboard.
@ 2013-05-11 2:48 Simon Glass
2013-05-11 2:48 ` [U-Boot] [PATCH 2/3] usb: workaround non-working keyboards Simon Glass
2013-05-11 2:49 ` [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd Simon Glass
0 siblings, 2 replies; 7+ messages in thread
From: Simon Glass @ 2013-05-11 2:48 UTC (permalink / raw)
To: u-boot
From: Vincent Palatin <vpalatin@chromium.org>
Allow to reconfigure properly the USB keyboard driver when we enumerate
several times the USB devices and its position in the device tree has
changes.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
---
common/usb_kbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index b962849..188763d 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -496,6 +496,7 @@ int drv_usb_kbd_init(void)
if (old_dev) {
/* Already registered, just return ok. */
debug("USB KBD: is already registered.\n");
+ usb_kbd_deregister();
return 1;
}
--
1.8.2.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/3] usb: workaround non-working keyboards.
2013-05-11 2:48 [U-Boot] [PATCH 1/3] usb: properly re-initialize the USB keyboard Simon Glass
@ 2013-05-11 2:48 ` Simon Glass
2013-05-11 2:49 ` [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd Simon Glass
1 sibling, 0 replies; 7+ messages in thread
From: Simon Glass @ 2013-05-11 2:48 UTC (permalink / raw)
To: u-boot
From: Vincent Palatin <vpalatin@chromium.org>
If the USB keyboard is not answering properly the first request on its
interrupt endpoint, just skip it and try the next one.
This workarounds an issue with a wireless mouse dongle which presents
itself both as a keyboard and a mouse but has a non-functional keyboard
interface.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 012bbf0ce0301be2482857e3f03b481dd15c2340)
Rebased to upstream/master:
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
---
common/usb_kbd.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 188763d..3174b5e 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -461,8 +461,13 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum)
usb_set_idle(dev, iface->desc.bInterfaceNumber, REPEAT_RATE, 0);
debug("USB KBD: enable interrupt pipe...\n");
- usb_submit_int_msg(dev, pipe, data->new, maxp > 8 ? 8 : maxp,
- ep->bInterval);
+ if (usb_submit_int_msg(dev, pipe, data->new, maxp > 8 ? 8 : maxp,
+ ep->bInterval) < 0) {
+ printf("Failed to get keyboard state from device %04x:%04x\n",
+ dev->descriptor.idVendor, dev->descriptor.idProduct);
+ /* Abort, we don't want to use that non-functional keyboard. */
+ return 0;
+ }
/* Success. */
return 1;
--
1.8.2.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd
2013-05-11 2:48 [U-Boot] [PATCH 1/3] usb: properly re-initialize the USB keyboard Simon Glass
2013-05-11 2:48 ` [U-Boot] [PATCH 2/3] usb: workaround non-working keyboards Simon Glass
@ 2013-05-11 2:49 ` Simon Glass
2013-05-11 16:39 ` Marek Vasut
1 sibling, 1 reply; 7+ messages in thread
From: Simon Glass @ 2013-05-11 2:49 UTC (permalink / raw)
To: u-boot
This commit broke USB2 on link (Chromebook Pixel):
020bbcb usb: hub: Power-cycle on root-hub ports
However the root cause seems to be a missing mask and missing 'break'
in ehci-hcd.c. This patch fixes both.
On link, 'usb start' with a USB keyboard and memory stick inserted now
finds both. The keyboard works as expected. Also ext2ls shows a directory
listing from the memory stick.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/usb/host/ehci-hcd.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index e0f3e4b..445759b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -809,21 +809,23 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
break;
case USB_REQ_CLEAR_FEATURE | ((USB_DIR_OUT | USB_RT_PORT) << 8):
reg = ehci_readl(status_reg);
+ reg &= ~EHCI_PS_CLEAR;
switch (le16_to_cpu(req->value)) {
case USB_PORT_FEAT_ENABLE:
reg &= ~EHCI_PS_PE;
break;
case USB_PORT_FEAT_C_ENABLE:
- reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_PE;
+ reg |= EHCI_PS_PE;
break;
case USB_PORT_FEAT_POWER:
if (HCS_PPC(ehci_readl(&ctrl->hccr->cr_hcsparams)))
- reg = reg & ~(EHCI_PS_CLEAR | EHCI_PS_PP);
+ reg &= ~EHCI_PS_PP;
+ break;
case USB_PORT_FEAT_C_CONNECTION:
- reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_CSC;
+ reg |= EHCI_PS_CSC;
break;
case USB_PORT_FEAT_OVER_CURRENT:
- reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_OCC;
+ reg |= EHCI_PS_OCC;
break;
case USB_PORT_FEAT_C_RESET:
ctrl->portreset &= ~(1 << port);
--
1.8.2.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd
2013-05-11 2:49 ` [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd Simon Glass
@ 2013-05-11 16:39 ` Marek Vasut
2013-05-11 17:27 ` Simon Glass
0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2013-05-11 16:39 UTC (permalink / raw)
To: u-boot
Dear Simon Glass,
> This commit broke USB2 on link (Chromebook Pixel):
>
> 020bbcb usb: hub: Power-cycle on root-hub ports
>
> However the root cause seems to be a missing mask and missing 'break'
> in ehci-hcd.c. This patch fixes both.
>
> On link, 'usb start' with a USB keyboard and memory stick inserted now
> finds both. The keyboard works as expected. Also ext2ls shows a directory
> listing from the memory stick.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Picking up all three, thanks!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd
2013-05-11 16:39 ` Marek Vasut
@ 2013-05-11 17:27 ` Simon Glass
2013-05-11 17:59 ` Marek Vasut
0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2013-05-11 17:27 UTC (permalink / raw)
To: u-boot
On Sat, May 11, 2013 at 10:39 AM, Marek Vasut <marex@denx.de> wrote:
> Dear Simon Glass,
>
>> This commit broke USB2 on link (Chromebook Pixel):
>>
>> 020bbcb usb: hub: Power-cycle on root-hub ports
>>
>> However the root cause seems to be a missing mask and missing 'break'
>> in ehci-hcd.c. This patch fixes both.
>>
>> On link, 'usb start' with a USB keyboard and memory stick inserted now
>> finds both. The keyboard works as expected. Also ext2ls shows a directory
>> listing from the memory stick.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> Picking up all three, thanks!
Thanks, also Julius may have some comments on Monday. Two of the
patches were reviewed by him, but not the last one, although he
suggested it.
Regards,
Simon
>
> Best regards,
> Marek Vasut
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd
2013-05-11 17:27 ` Simon Glass
@ 2013-05-11 17:59 ` Marek Vasut
2013-05-13 18:19 ` Julius Werner
0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2013-05-11 17:59 UTC (permalink / raw)
To: u-boot
Dear Simon Glass,
> On Sat, May 11, 2013 at 10:39 AM, Marek Vasut <marex@denx.de> wrote:
> > Dear Simon Glass,
> >
> >> This commit broke USB2 on link (Chromebook Pixel):
> >> 020bbcb usb: hub: Power-cycle on root-hub ports
> >>
> >> However the root cause seems to be a missing mask and missing 'break'
> >> in ehci-hcd.c. This patch fixes both.
> >>
> >> On link, 'usb start' with a USB keyboard and memory stick inserted now
> >> finds both. The keyboard works as expected. Also ext2ls shows a
> >> directory listing from the memory stick.
> >>
> >> Signed-off-by: Simon Glass <sjg@chromium.org>
> >
> > Picking up all three, thanks!
>
> Thanks, also Julius may have some comments on Monday. Two of the
> patches were reviewed by him, but not the last one, although he
> suggested it.
I just build-tested them, seem OK.
btw. I might be less available this month, sorry about that.
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd
2013-05-11 17:59 ` Marek Vasut
@ 2013-05-13 18:19 ` Julius Werner
0 siblings, 0 replies; 7+ messages in thread
From: Julius Werner @ 2013-05-13 18:19 UTC (permalink / raw)
To: u-boot
Thanks for taking charge of this Simon, looks good to me. Good catch
with the missing break!
Now that I look at it, the FEAT_C_ENABLE section seems to be broken as
well, it should be setting EHCI_PS_PEC instead of EHCI_PS_PE. Maybe
that code path is never used in practice.
Acked-by: Julius Werner <jwerner@chromium.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-05-13 18:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-11 2:48 [U-Boot] [PATCH 1/3] usb: properly re-initialize the USB keyboard Simon Glass
2013-05-11 2:48 ` [U-Boot] [PATCH 2/3] usb: workaround non-working keyboards Simon Glass
2013-05-11 2:49 ` [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd Simon Glass
2013-05-11 16:39 ` Marek Vasut
2013-05-11 17:27 ` Simon Glass
2013-05-11 17:59 ` Marek Vasut
2013-05-13 18:19 ` Julius Werner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox