06 Oct, 2014

1 commit


05 May, 2014

1 commit

  • Former usb_cable_connected() patch broke compilation of boards which do
    not support this feature.

    I've renamed usb_cable_connected() to g_dnl_usb_cable_connected() and added
    its default implementation to gadget downloader driver code. There's
    only one driver of this kind and it's unlikely there'll be another, so
    there's no point in keeping it in /common.

    Previously this function was declared in usb.h. I've moved it, since
    it's more appropriate to keep it in g_dnl.h - usb.h seems to be intended
    for USB host implementation.

    Existing code, confronted with default -EOPNOTSUPP return value,
    continues as if the cable was connected.

    CONFIG_USB_CABLE_CHECK was removed.

    Change-Id: Ib9198621adee2811b391c64512f14646cefd0369
    Signed-off-by: Mateusz Zalega
    Acked-by: Marek Vasut
    Acked-by: Lukasz Majewski

    Mateusz Zalega
     

09 Nov, 2013

1 commit

  • This patch allows exiting from UMS mode to u-boot prompt
    by detaching usb cable or by pressing ctrl+c.

    Add new config: CONFIG_USB_CABLE_CHECK. If defined then board
    file should provide function: usb_cable_connected() (include/usb.h)
    that return 1 if cable is connected and 0 otherwise.

    Changes v2:
    - add a note to the README

    Signed-off-by: Przemyslaw Marczak
    Cc: Marek Vasut

    Przemyslaw Marczak
     

21 Oct, 2013

4 commits

  • This parameter will later be used to verify OTG ports.

    Signed-off-by: Troy Kisky

    Troy Kisky
     
  • This will be used by usb_lowlevel_init so it will
    no longer be used by only board specific functions.

    Move definition of enum usb_init_type higher in file
    so that it will be available for usb_low_level_init.

    Signed-off-by: Troy Kisky

    Troy Kisky
     
  • This commit unifies board-specific USB initialization implementations
    under one symbol (usb_board_init), declaration of which is available in
    usb.h.

    New API allows selective initialization of USB controllers whenever needed.

    Signed-off-by: Mateusz Zalega
    Signed-off-by: Kyungmin Park
    Reviewed-by: Lukasz Majewski
    Cc: Marek Vasut
    Cc: Lukasz Majewski

    Mateusz Zalega
     
  • This adds stack layer for eXtensible Host Controller Interface
    which facilitates use of USB 3.0 in host mode.

    Adapting xHCI host controller driver in linux-kernel
    by Sarah Sharp to needs in u-boot.

    Initial porting from Linux kernel version 3.4, with following
    top commit history of drivers/usb/host/xhci* :
    cf84055 xHCI: Cleanup isoc transfer ring when TD length mismatch found

    This adds the basic xHCI host controller driver with bare minimum
    features:
    - Control/Bulk transfer support has been added with required
    infrastructure for necessary xHC data structures.
    - Stream protocol hasn't been supported yet.
    - No support for quirky devices has been added.

    Signed-off-by: Vikas C Sajjan
    Signed-off-by: Julius Werner
    Signed-off-by: Vivek Gautam
    Cc: Simon Glass
    Cc: Minkyu Kang
    Cc: Dan Murphy
    Cc: Marek Vasut

    Vivek Gautam
     

24 Jul, 2013

1 commit


06 May, 2013

1 commit


17 Dec, 2012

1 commit


20 Nov, 2012

4 commits

  • Backend driver for MUSB OTG controllers found on TI OMAP2/3/4
    (tested only on OMAP3 Beagle).

    Signed-off-by: Ilya Yanok

    Ilya Yanok
     
  • Backend driver for MUSB OTG controllers found on TI AM35x.

    It seems that on AM35X interrupt status registers can be updated
    _before_ core registers. As we don't use true interrupts in U-Boot
    and poll interrupt status registers instead this can result in
    interrupt handler being called with non-updated core registers.
    This confuses the code and result in hanged transfers.
    Add a small delay in am35x_interrupt as a workaround.

    Signed-off-by: Ilya Yanok

    Ilya Yanok
     
  • Backend driver for MUSB OTG controllers found on TI AM33xx and
    TI81xx SoCs (tested with AM33xx only).

    Signed-off-by: Ilya Yanok

    Ilya Yanok
     
  • Linux usb/ch9.h seems to have all the same information (and more)
    as usbdescriptors.h so use the former instead of the later one.

    As a consequense of this change USB_SPEED_* values don't correspond
    directly to EHCI speed encoding anymore, I've added necessary
    recoding in EHCI driver. Also there is no point to put speed into
    pipe anymore so it's removed and a bunch of host drivers fixed to
    look at usb_device->speed instead.

    Old usbdescriptors.h included is not removed as it seems to be
    used by old USB device code.

    This makes usb.h and usbdevice.h incompatible. Fortunately the
    only place that tries to include both are the old MUSB code and
    it needs usb.h only for USB_DMA_MINALIGN used in aligned attribute
    on musb_regs structure but this attribute seems to be unneeded
    (old MUSB code doesn't support any DMA at all).

    Signed-off-by: Ilya Yanok

    Ilya Yanok
     

16 Oct, 2012

2 commits


18 Jul, 2012

1 commit

  • The USB spec says that 32 bytes is the minimum required alignment.
    However on some platforms we have a larger minimum requirement for cache
    coherency. In those cases, use that value rather than the USB spec
    minimum. We add a cpp check to to define USB_DMA_MINALIGN and
    make use of it in ehci-hcd.c and musb_core.h. We cannot use MAX() here
    as we are not allowed to have tests inside of align(...).

    Signed-off-by: Tom Rini
    [marek.vasut]: introduce some crazy macro voodoo
    Signed-off-by: Marek Vasut
    [ilya.yanok]: moved external buffer fixes to separate patch,
    we use {ALLOC,DEFINE}_ALIGN_BUFFER macros with alignment of USB_DMA_MINALIGN
    for qh_list, qh and qtd structures to make sure they are proper aligned
    for both controller and cache operations.
    Signed-off-by: Ilya Yanok

    Tom Rini
     

20 May, 2012

1 commit

  • This avoids cache-alignment warnings shown in console
    when a usb command is entered.

    Whenever X bytes of unaligned buffer is invalidated, arm core
    invalidates X + Y bytes as per the cache line size and throws
    these warnings.

    Signed-off-by: Puneet Saxena
    Signed-off-by: Marek Vasut

    Puneet Saxena
     

19 Mar, 2012

1 commit

  • Common code has a mdelay() func, so use that instead of the usb-specific
    wait_ms() func. This also fixes the build errors:

    ohci-hcd.c: In function 'submit_common_msg':
    /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
    ohci-hcd.c:1519:9: sorry, unimplemented: called from here
    /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
    ohci-hcd.c:1816:10: sorry, unimplemented: called from here
    /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
    ohci-hcd.c:1827:10: sorry, unimplemented: called from here
    /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
    ohci-hcd.c:1844:10: sorry, unimplemented: called from here
    /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
    ohci-hcd.c:1563:11: sorry, unimplemented: called from here
    /usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
    ohci-hcd.c:1583:9: sorry, unimplemented: called from here
    make[1]: *** [ohci-hcd.o] Error 1

    Signed-off-by: Mike Frysinger
    Acked-by: Marek Vasut

    Mike Frysinger
     

03 Mar, 2012

2 commits


09 Aug, 2011

1 commit

  • If you take a look at 96820a35, you'll see the original timeout was
    CONFIG_SYS_HZ. Which is 1000. After the mentioned change, non-bulk timeout
    was changed to 100. This causes timeout failures on the dreamplug platform
    when trying to initialize the usb microsd reader.

    Signed-off-by: Jason Cooper
    Acked-by: Mike Frysinger

    Jason Cooper
     

20 Feb, 2011

2 commits

  • This adds support for using USB Ethernet dongles in host mode. This is just
    the framework - drivers will come later. A new config option called
    CONFIG_USB_HOST_ETHER can be defined in board config files to switch this
    on.

    The was originally written by NVIDIA and was cleaned up for release by the
    Chromium authors.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Changed both to use a common timeout for URB submission, since they were using
    different values and EHCI's was too short.

    Also fixed EHCI to actually check if urb submission succeeded, rather than
    silently continuing into the weeds.

    Change-Id: I7f71499ffaa05187d8e5618db2419e1606007b82

    Signed-off-by: Simon Glass

    Simon Glass
     

12 Aug, 2010

1 commit


28 May, 2010

1 commit

  • create_pipe() can give wrong result if an expression is passed as the 'endpoint'
    argument -- due to missing parentheses.

    Thanks to Martin Mueller for finding the bug and providing the patch.

    Signed-off-by: Sergei Shtylyov

    Sergei Shtylyov
     

09 Jan, 2010

2 commits


20 Dec, 2009

2 commits

  • This change adds the usb device support for musb.

    Omap3 platform support added at the same level as davinci.

    The interface for usbtty to use the musb device support was added.

    Verified on omap3 beagle, zoom1 and zoom2.

    Signed-off-by: Tom Rix

    Tom Rix
     
  • The header files usb.h and usbdescriptors.h have the same nameed
    structure definitions for

    usb_config_descriptor
    usb_interface_descriptor
    usb_endpoint_descriptor
    usb_device_descriptor
    usb_string_descriptor

    These are out right duplicates in usb.h

    usb_device_descriptor
    usb_string_descriptor

    This one has extra unused elements

    usb_endpoint_descriptor

    unsigned char bRefresh
    unsigned char bSynchAddress;

    These in usb.h have extra elements at the end of the usb 2.0
    specified descriptor and are used.

    usb_config_descriptor
    usb_interface_descriptor

    The change is to consolidate the definition of the descriptors
    to usbdescriptors.h. The dublicates in usb.h are removed.
    The extra element structure will have their name shorted by
    removing the '_descriptor' suffix.

    So

    usb_config_descriptor -> usb_config
    usb_interface_descriptor -> usb_interface

    For these, the common descriptor elements are accessed now
    by an element 'desc'.

    As an example

    - if (iface->bInterfaceClass != USB_CLASS_HUB)
    + if (iface->desc.bInterfaceClass != USB_CLASS_HUB)

    This has been compile tested on MAKEALL arm, ppc and mips.

    Signed-off-by: Tom Rix

    Tom Rix
     

29 Jan, 2009

4 commits


10 Dec, 2008

1 commit

  • Hi,

    I found a bug when working with the u-boot USB subsystem on IXP425 processor
    (big endian Xscale aka ARMv5).
    I recognized that the second usb_endpoint_descriptor of the attached memory
    stick was corrupted.

    The reason for this are the packed structures below (either u-boot and
    u-boot-usb):

    --------------
    /* Endpoint descriptor */
    struct usb_endpoint_descriptor {
    unsigned char bLength;
    unsigned char bDescriptorType;
    unsigned char bEndpointAddress;
    unsigned char bmAttributes;
    unsigned short wMaxPacketSize;
    unsigned char bInterval;
    unsigned char bRefresh;
    unsigned char bSynchAddress;

    } __attribute__ ((packed));
    /* Interface descriptor */
    struct usb_interface_descriptor {
    unsigned char bLength;
    unsigned char bDescriptorType;
    unsigned char bInterfaceNumber;
    unsigned char bAlternateSetting;
    unsigned char bNumEndpoints;
    unsigned char bInterfaceClass;
    unsigned char bInterfaceSubClass;
    unsigned char bInterfaceProtocol;
    unsigned char iInterface;

    unsigned char no_of_ep;
    unsigned char num_altsetting;
    unsigned char act_altsetting;
    struct usb_endpoint_descriptor ep_desc[USB_MAXENDPOINTS];
    } __attribute__ ((packed));
    ------------

    As usb_endpoint_descriptor is only 7byte in length, the start of all
    odd ep_desc[] structures is not word aligned. This makes wMaxPacketSize
    of these structures also not word aligned.

    ARMv5 Architecture however does not support non-aligned multibyte
    data type (see A2.8 of ARM Architecture Reference Manual).

    Signed-off-by: Stefan Althoefer
    Signed-off-by: Remy Böhmer

    Stefan Althoefer
     

29 Nov, 2008

1 commit


14 Oct, 2008

1 commit

  • The max packet size is encoded as 0,1,2,3 for 8,16,32,64 bytes.
    At some places directly 8,16,32,64 was used instead of the encoded
    value. Made a enum for the options to make this more clear and to help
    preventing similar errors in the future.

    After fixing this bug it became clear that another bug existed where
    the 'pipe' is and-ed with PIPE_* flags, where it should have been
    'usb_pipetype(pipe)', or even better usb_pipeint(pipe).

    Also removed the triple 'get_device_descriptor' sequence, it has no use,
    and Windows nor Linux behaves that way.
    There is also a poll going on with a timeout when usb_control_msg() fails.
    However, the poll is useless, because the flag will never be set on a error,
    because there is no code that runs in a parallel that can set this flag.
    Changed this to something more logical.

    Tested on AT91SAM9261ek and compared the flow on the USB bus to what
    Linux is doing. There is no difference anymore in the early initialisation
    sequence.

    Signed-off-by: Remy Bohmer
    Signed-off-by: Markus Klotzbuecher

    Remy Bohmer
     

07 Aug, 2008

1 commit


27 Mar, 2008

1 commit


06 Jun, 2007

1 commit

  • This patch adds USB event poll support, which could be used in usbkbd
    and other usb devices driver when the asynchronous interrupt
    processing is supported.

    Signed-off-by: Zhang Wei <wei.zhang@freescale.com

    Zhang Wei