10 Apr, 2020

1 commit

  • Rather than keeping the asynchronous schedule running always, keep it
    running only across USB mass storage transfers for now, as it seems
    that keeping it running all the time interferes with certain control
    transfers during device enumeration.

    Note that running the async schedule all the time should not be an
    issue, especially on EHCI HCD, as that one implements most of the
    transfers using async schedule.

    Note that we have usb_disable_asynch(), which however is utterly broken.
    The usb_disable_asynch() blocks the USB core from doing async transfers
    by setting a global flag. The async schedule should however be disabled
    per USB controller. Moreover, setting a global flag does not prevent the
    controller from using the async schedule, which e.g. the EHCI HCD does.

    This patch implements additional callback to the controller, which
    permits it to lock the async schedule and keep it running across
    multiple transfers. Once the schedule is unlocked, it must also be
    disabled. This thus prevents the async schedule from running outside
    of the USB mass storage transfers.

    Signed-off-by: Marek Vasut
    Cc: Lukasz Majewski
    Cc: Tom Rini
    Tested-by: Tom Rini [omap3_beagle, previously failing]

    Marek Vasut
     

06 Feb, 2020

1 commit

  • At present dm/device.h includes the linux-compatible features. This
    requires including linux/compat.h which in turn includes a lot of headers.
    One of these is malloc.h which we thus end up including in every file in
    U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
    which needs to use the system malloc() in some files.

    Move the compatibility features into a separate header file.

    Signed-off-by: Simon Glass

    Simon Glass
     

11 Sep, 2019

2 commits


27 Nov, 2018

1 commit


07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

01 Oct, 2017

3 commits


04 Jul, 2017

1 commit

  • There was for long time no activity in the 4xx area.
    We need to go further and convert to Kconfig, but it
    turned out, nobody is interested anymore in 4xx,
    so remove it.

    Signed-off-by: Heiko Schocher

    Heiko Schocher
     

24 Sep, 2016

1 commit


04 Jun, 2016

1 commit

  • Move CONFIG_USB_XHCI to defconfig files for all boards, renaming it
    into CONFIG_USB_XHCI_HCD.

    As commented in the help of "config USB_XHCI" entry, this has been
    a TODO for a long time; now CONFIG_USB_XHCI_HCD and CONFIG_USB_XHCI
    have been unified in favor of the former.

    Note:
    Some boards define CONFIG_USB_XHCI in their headers without
    CONFIG_USB, which does not meet the "depends on" in Kconfig.
    I added CONFIG_USB=y for those boards when converting.
    Otherwise, they would fail to build.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

07 May, 2016

3 commits

  • The Kingston DT Ultimate USB 3.0 stick is sensitive to this first
    Get Descriptor request and if the request is not in a separate
    microframe, the stick refuses to operate. Add slight delay, which
    is enough for one microframe to pass on any USB spec revision.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Hans de Goede
    Cc: Stefan Roese
    Cc: Stephen Warren

    Marek Vasut
     
  • Some devices, like the SanDisk Cruzer Pop need some time to process
    the Set Configuration request, so wait a little until they are ready.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Hans de Goede
    Cc: Stefan Roese
    Cc: Stephen Warren

    Marek Vasut
     
  • The pointer should always be inited to NULL, not zero (0). These are
    two different things and not necessarily equal.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Hans de Goede
    Cc: Stefan Roese
    Cc: Stephen Warren

    Marek Vasut
     

23 Mar, 2016

1 commit


21 Mar, 2016

1 commit

  • Debugging has shown, that all USB hubs are being reset twice while
    USB scanning. This introduces additional delays and makes USB scanning
    even more slow. Testing has shown that this 2nd USB hub reset doesn't
    seem to be necessary.

    This patch now removes this 2nd USB hub reset. Resulting in faster USB
    scan time. Here the current numbers:

    Without this patch:
    => time usb start
    starting USB...
    USB0: USB EHCI 1.00
    scanning bus 0 for devices... 9 USB Device(s) found

    time: 24.003 seconds

    With this patch:
    => time usb start
    starting USB...
    USB0: USB EHCI 1.00
    scanning bus 0 for devices... 9 USB Device(s) found

    time: 20.392 seconds

    So ~3.6 seconds of USB scanning time reduction.

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Acked-by: Hans de Goede
    Tested-by: Stephen Warren
    Cc: Marek Vasut

    Stefan Roese
     

16 Jan, 2016

1 commit

  • We support max USB_MAXENDPOINTS, so need to use
    "epno >= USB_MAXENDPOINTS", but not "epno > USB_MAXENDPOINTS".
    If use ">", we may exceeds the array of if_desc->ep_desc.

    Signed-off-by: Peng Fan
    Cc: Simon Glass
    Cc: Hans de Goede
    Cc: Marek Vasut
    Cc: Paul Kocialkowski
    Cc: "Stefan Brüns"
    Cc: Vincent Palatin

    Peng Fan
     

31 Dec, 2015

2 commits


12 Sep, 2015

1 commit


22 Jul, 2015

4 commits


29 May, 2015

1 commit


15 May, 2015

2 commits


06 May, 2015

1 commit


19 Apr, 2015

7 commits


14 Apr, 2015

4 commits

  • Invoked board_usb_cleanup for cleaning up initialized USB. It
    will be invoked if the user enterts ctrl-C.

    Signed-off-by: Kishon Vijay Abraham I
    Reviewed-by: Lukasz Majewski

    Kishon Vijay Abraham I
     
  • When fetching the first descriptor from a new device, only validate that
    we received at least 8 bytes, not that we received the entire descriptor.
    The reasoning is:
    - The code only uses fields in the first 8 bytes, so that's all we need
    to have fetched at this stage.
    - The smallest maxpacket size is 8 bytes. Before we know the actual
    maxpacket the device uses, the USB controller may only accept a single
    packet (see the DWC2 note in the comment added in the commit).
    Consequently we are only guaranteed to receive 1 packet (at least 8
    bytes) even in a non-error case.

    Fixes: 1a7758044b04 ("usb: Early failure when the first descriptor read
    fails or is invalid")
    Cc: Paul Kocialkowski
    Signed-off-by: Stephen Warren

    Stephen Warren
     
  • This may happen when using an USB1 device on a controller that only supports
    USB2 (e.g. EHCI). Reading the first descriptor will fail (read 0 byte), so we
    can abort the process at this point instead of failing later and wasting time.

    Signed-off-by: Paul Kocialkowski

    Paul Kocialkowski
     
  • This checks that a new USB device is correctly initialized and frees it if not.
    In addition, this doesn't report that USB was started when no device was found.

    Signed-off-by: Paul Kocialkowski

    Paul Kocialkowski