From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] DWC2 driver issues
Date: Fri, 27 Feb 2015 21:33:31 -0700 [thread overview]
Message-ID: <54F1451B.1090206@wwwdotorg.org> (raw)
In-Reply-To: <201502191529.02337.marex@denx.de>
On 02/19/2015 07:29 AM, Marek Vasut wrote:
> On Monday, February 16, 2015 at 07:28:45 PM, Stephen Warren wrote:
>> Following on from my Google+ post about DWC2/RPi USB host controller
>> issues in U-Boot.
...
>> On an RPi with the DWC2 controller connected directly to a single
>> external USB connector (i.e model A, A+), a LS (and perhaps FS) device
>> pluged directly into the board doesn't work due to the small max packet
>> size limit.
>>
>> Your patch 9b1161af8c51 "usb: dwc2: Add support for multi-packet control
>> xfers" in u-boot-usb.git topic/dwc2 addresses this issue for control
>> transfers at least. With your patch, I can now enumerate a USB kbd on a
>> model A+. That's a great improvement; thanks for the quick response with
>> a patch.
>>
>> However, when I enable CONFIG_USB_KEYBOARD, I see errors when the USB
>>
>> keyboard input driver initializes:
>>> starting USB...
>>> USB0: Core Release: 2.80a
>>> scanning bus 0 for devices... 3 USB Device(s) found
>>>
>>> scanning usb for storage devices... 0 Storage Device(s) found
>>> scanning usb for ethernet devices... 0 Ethernet Device(s) found
>>>
>>> dev = 0df92ac0 pipe = 0x40408380 buf = 0db4a780 size = 8 int = 10
>>> Failed to get keyboard state from device 413c:2010
>>
>> I haven't investigated this further yet.
>
> Wow, this error is new, I have not seen this one on SoCFPGA.
This error is because the keyboard driver uses interrupt transfers, and
these aren't implemented in DWC2. I worked around this by forcing the
keyboard driver to use control transfers, and fixing what I think is a
bug in this case; see patch below. With this, USB keyboard works on an
RPI A+, although it hangs pretty quickly. I assume one of the busy loops
in dwc2.c without a time out isn't completing.
> diff --git a/common/usb_kbd.c b/common/usb_kbd.c
> index ecc3085cc081..237dbbaf4fe0 100644
> --- a/common/usb_kbd.c
> +++ b/common/usb_kbd.c
> @@ -457,6 +457,8 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum)
> USB_KBD_BOOT_REPORT_SIZE, data->new,
> data->intinterval);
> if (!data->intq) {
> +#elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP)
> + if (0) {
> #else
> if (usb_submit_int_msg(dev, data->intpipe, data->new, data->intpktsize,
> data->intinterval) < 0) {
> diff --git a/include/configs/rpi.h b/include/configs/rpi.h
> index c94f4112026e..8d01bc845d73 100644
> --- a/include/configs/rpi.h
> +++ b/include/configs/rpi.h
> @@ -91,6 +91,9 @@
> #define CONFIG_USB_HOST_ETHER
> #define CONFIG_USB_ETHER_SMSC95XX
> #define CONFIG_MISC_INIT_R
> +#define CONFIG_USB_KEYBOARD
> +#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
> +#define CONFIG_SYS_STDIO_DEREGISTER
> #endif
>
> /* Console UART */
next prev parent reply other threads:[~2015-02-28 4:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-16 18:28 [U-Boot] DWC2 driver issues Stephen Warren
2015-02-19 14:29 ` Marek Vasut
2015-02-19 22:21 ` Dinh Nguyen
2015-02-20 3:22 ` Stephen Warren
2015-03-02 11:38 ` Marek Vasut
2015-03-02 14:04 ` Kishon Vijay Abraham I
2015-02-28 4:33 ` Stephen Warren [this message]
2015-03-02 11:42 ` Marek Vasut
2015-03-02 23:33 ` Stephen Warren
2015-03-05 20:59 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F1451B.1090206@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.