24 Jul, 2013

1 commit


26 Jun, 2013

1 commit

  • With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
    which is required to represent block numbers for storage devices that
    exceed 2TiB (the block size usually is 512B), e.g. recent hard drives.

    For some obscure reason, the current U-Boot code uses lbaint_t for the
    number of blocks to read (a rather optimistic estimation of how RAM
    sizes will evolve), but not for the starting address. Trying to access
    blocks beyond the 2TiB boundary will simply wrap around and read a
    block within the 0..2TiB range.

    We now use lbaint_t for block start addresses, too. This required
    changes to all block drivers as the signature of block_read(),
    block_write() and block_erase() in block_dev_desc_t changed.

    Signed-off-by: Sascha Silbe

    Sascha Silbe
     

06 May, 2013

2 commits


02 May, 2013

1 commit


17 Dec, 2012

1 commit

  • When a USB card reader is empty, it will return "Not Ready - medium not
    present" as Key Code Qualifier. In that situation, it's useless waiting
    for the full timeout since the result won't change until the user
    inserts a card.

    Signed-off-by: Vincent Palatin
    Signed-off-by: Vadim Bendebury
    Signed-off-by: Simon Glass

    Vincent Palatin
     

05 Nov, 2012

1 commit

  • command.c:44:38: error: bad constant expression
    dlmalloc.c:1468:2: warning: Using plain integer as NULL pointer
    dlmalloc.c:1468:5: warning: Using plain integer as NULL pointer
    dlmalloc.c:2176:12: warning: Using plain integer as NULL pointer
    dlmalloc.c:2179:31: warning: Using plain integer as NULL pointer
    dlmalloc.c:2382:14: warning: Using plain integer as NULL pointer
    dlmalloc.c:2436:14: warning: Using plain integer as NULL pointer
    dlmalloc.c:2582:31: warning: Using plain integer as NULL pointer
    dlmalloc.c:2585:17: warning: Using plain integer as NULL pointer
    dlmalloc.c:2646:14: warning: Using plain integer as NULL pointer
    dlmalloc.c:2659:19: warning: Using plain integer as NULL pointer
    dlmalloc.c:2692:19: warning: Using plain integer as NULL pointer
    dlmalloc.c:2707:19: warning: Using plain integer as NULL pointer
    dlmalloc.c:2708:14: warning: Using plain integer as NULL pointer
    dlmalloc.c:2786:31: warning: Using plain integer as NULL pointer
    dlmalloc.c:2801:12: warning: Using plain integer as NULL pointer
    dlmalloc.c:2801:22: warning: Using plain integer as NULL pointer
    dlmalloc.c:2926:27: warning: Using plain integer as NULL pointer
    dlmalloc.c:2928:14: warning: Using plain integer as NULL pointer
    dlmalloc.c:2929:12: warning: Using plain integer as NULL pointer
    dlmalloc.c:3075:14: warning: Using plain integer as NULL pointer
    hush.c:292:14: warning: symbol 'last_return_code' was not declared. Should it be static?
    hush.c:293:5: warning: symbol 'nesting_level' was not declared. Should it be static?
    hush.c:2175:20: warning: Using plain integer as NULL pointer
    hush.c:2175:34: warning: Using plain integer as NULL pointer
    hush.c:2210:41: warning: Using plain integer as NULL pointer
    hush.c:2216:45: warning: Using plain integer as NULL pointer
    hush.c:2249:25: warning: Using plain integer as NULL pointer
    hush.c:2332:13: warning: symbol 'new_pipe' was not declared. Should it be static?
    hush.c:2390:5: warning: symbol 'reserved_word' was not declared. Should it be static?
    hush.c:2927:5: warning: symbol 'parse_stream' was not declared. Should it be static?
    hush.c:3127:6: warning: symbol 'mapset' was not declared. Should it be static?
    hush.c:3133:6: warning: symbol 'update_ifs_map' was not declared. Should it be static?
    hush.c:3161:5: warning: symbol 'parse_stream_outer' was not declared. Should it be static?
    hush.c:3295:34: warning: Using plain integer as NULL pointer
    hush.c:3631:5: warning: symbol 'do_showvar' was not declared. Should it be static
    image.c:1282:29: warning: Using plain integer as NULL pointer
    image.c:1315:41: warning: Using plain integer as NULL pointer
    image.c:1330:25: warning: Using plain integer as NULL pointer
    image.c:1706:25: warning: Using plain integer as NULL pointer
    main.c:510:10: warning: symbol 'hist_num' was not declared. Should it be static?
    main.c:512:5: warning: symbol 'hist_list' was not declared. Should it be static?
    main.c:513:6: warning: symbol 'hist_lines' was not declared. Should it be static?
    usb_storage.c:195:6: warning: symbol 'usb_show_progress' was not declared. Should it be static?
    usb_storage.c:440:48: warning: Using plain integer as NULL pointer
    usb_storage.c:503:5: warning: symbol 'usb_stor_BBB_comdat' was not declared. Should it be static?
    usb_storage.c:551:5: warning: symbol 'usb_stor_CB_comdat' was not declared. Should it be static?
    usb_storage.c:629:55: warning: Using plain integer as NULL pointer
    usb_storage.c:620:5: warning: symbol 'usb_stor_CBI_get_status' was not declared. Should it be static?
    usb_storage.c:675:43: warning: Using plain integer as NULL pointer
    usb_storage.c:668:5: warning: symbol 'usb_stor_BBB_clear_endpt_stall' was not declared. Should it be static?
    usb_storage.c:679:5: warning: symbol 'usb_stor_BBB_transport' was not declared. Should it be static?
    usb_storage.c:801:5: warning: symbol 'usb_stor_CB_transport' was not declared. Sh
    xyzModem.c:104:1: warning: symbol 'CYGACC_COMM_IF_GETC_TIMEOUT' was not declared. Should it be static?
    xyzModem.c:122:1: warning: symbol 'CYGACC_COMM_IF_PUTC' was not declared. Should it be static?
    xyzModem.c:169:1: warning: symbol 'parse_num' was not declared. Should it be stat

    note: hush.c's nesting_level deleted because not used.

    Signed-off-by: Kim Phillips

    Kim Phillips
     

22 Oct, 2012

1 commit

  • usb_storage wouldn't compile when the CONFIG_SYS_64BIT_LBA option is
    turned on because the used fixed size data types in their exported
    functions when they should have used lbaint_t for the block count
    parameter. That meant that when the sizes happened to be the same, when
    using a 28 bit LBA, the driver would build, but when it wasn't, a 48 bit
    LBA, things broke.

    This change adjusts the signatures to use the right type and makes small
    adjustments in the affected functions.

    Signed-off-by: Gabe Black
    Signed-off-by: Simon Glass
    Reviewed-by: Marek Vasut

    Gabe Black
     

16 Oct, 2012

1 commit


01 Sep, 2012

4 commits

  • Trim down the IO times by removing uneeded
    test unit reeady calls.

    Signed-off-by: Jim Shimer

    Jim Shimer
     
  • There is a 5-ms delay in usb_stor_BBB_transport, which occurs every 10 kiB of
    data for fragmented fatload usb, i.e. roughly 500 ms of delay per MiB. This adds
    up to quite a bit of delay if you're loading a large ramdisk.

    The purpose of this delay should be to debounce the 5-V/100-mA USB power up.
    This patch skips the delay if the device has already been queried as ready.

    Signed-off-by: Jim Shimer

    Rework following the review:
    - Rebase against the latest u-boot-usb master.
    - Replace typedef with #define.
    - Use the existing flags struct field instead of adding a new field.
    - Remove the setter function.
    - Remove the typecasts.
    Signed-off-by: Benoît Thébaudeau

    Cc: Marek Vasut
    Cc: Ilya Yanok
    Cc: Stefan Herbrechtsmeier
    Cc: Jim Shimer

    Benoît Thébaudeau
     
  • Now that the EHCI driver allocates its qTDs from the heap, the MSC driver is
    only limited by the SCSI commands it uses.

    Signed-off-by: Benoît Thébaudeau
    Cc: Marek Vasut
    Cc: Ilya Yanok
    Cc: Stefan Herbrechtsmeier

    Benoît Thébaudeau
     
  • The commit 5dd95cf made the MSC driver EHCI-specific. This patch restores a
    basic support of non-EHCI HCDs, like before that commit.

    The fallback transfer size is certainly not optimal, but at least it should work
    like before.

    Signed-off-by: Benoît Thébaudeau
    Cc: Marek Vasut
    Cc: Ilya Yanok
    Cc: Stefan Herbrechtsmeier

    Benoît Thébaudeau
     

18 Jul, 2012

1 commit

  • The commit 5dd95cf93dfffa1d19a1928990852aac9f55b9d9 'usb_storage:
    Fix EHCI "out of buffer pointers" with CD-ROM' introduce a bug in
    usb_storage as it wrongly assumes that every transfer can use
    4096 bytes per qt_buffer. This is wrong if the start address of
    the data is not page aligned to 4096 bytes and leads to 'EHCI
    timed out on TD' messages because of 'out of buffer pointers'
    in ehci_td_buffer function.

    The bug appears during load of a fragmented file and
    read from or write to an unaligned memory address.

    Cc: Marek Vasut
    Signed-off-by: Stefan Herbrechtsmeier

    Stefan Herbrechtsmeier
     

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
     

06 Jan, 2012

1 commit

  • When performing large bulk reads from a CD or DVD using the U-Boot
    usb_storage driver, it generates requests of up to 20 blocks at a time.

    With a standard 512-byte block size, that is 10240 bytes and within the
    limit of U-Boot's EHCI driver (maximum 5 pages at 4k per page).

    Unfortunately CD-ROM media has a 2048-byte blocksize, resulting in a
    maximum transfer size of 40960 bytes, which does not fit.

    Since the EHCI specification is impossibly obtuse and far beyond my
    comprehension, I chose to dynamically compute the limit based on the
    blocksize.

    Signed-off-by: Kyle Moffett

    Kyle Moffett
     

28 Oct, 2011

2 commits

  • usb_storage.c: In function ‘us_one_transfer’:
    usb_storage.c:377:7: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c:389:6: warning: format ‘%d’ expects argument of type ‘int’, but
    argument 2 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c:394:6: warning: format ‘%d’ expects argument of type ‘int’, but
    argument 2 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c: In function ‘usb_stor_BBB_reset’:
    usb_storage.c:442:2: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c:448:2: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c:454:2: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c: In function ‘usb_stor_CB_reset’:
    usb_storage.c:482:2: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c: In function ‘usb_stor_CB_comdat’:
    usb_storage.c:572:3: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c:584:4: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c: In function ‘usb_stor_BBB_transport’:
    usb_storage.c:782:3: warning: format ‘%d’ expects argument of type ‘int’, but
    argument 3 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c: In function ‘usb_stor_CB_transport’:
    usb_storage.c:807:2: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c:830:3: warning: format ‘%X’ expects argument of type ‘unsigned
    int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
    usb_storage.c:857:3: warning: format ‘%d’ expects argument of type ‘int’, but
    argument 2 has type ‘long unsigned int’ [-Wformat]

    Signed-off-by: Marek Vasut
    Cc: Wolfgang Denk
    Cc: Simon Glass
    Cc: Mike Frysinger
    Cc: Remy Bohmer

    Marek Vasut
     
  • usb_storage.c: In function ‘usb_stor_CB_reset’:
    usb_storage.c:466:6: warning: variable ‘result’ set but not used
    [-Wunused-but-set-variable]

    Signed-off-by: Marek Vasut
    Cc: Wolfgang Denk
    Cc: Simon Glass
    Cc: Mike Frysinger

    Marek Vasut
     

05 Oct, 2011

1 commit

  • This reverts commit 60ce53cf9f408d9ad721f8e7a87d6a564e6d5bac.

    The commit causes build breakage for a number of boards. This results
    from the fact that now the arguments of debug() actually get
    referenced (even if there is hope that the compiler will optimize
    away the debug() call). The obvious fix to that probem (change the
    code to always declare the referenced variables and data structures)
    increases the code size, and was this rejected. So it was decided to
    revert this commit until a better solution is found.

    Wolfgang Denk
     

02 Oct, 2011

1 commit

  • Fix the following gcc4.6 problems:

    cmd_date.c: In function ‘do_date’:
    cmd_date.c:50:6: warning: variable ‘old_bus’ set but not used
    [-Wunused-but-set-variable]
    asix.c: In function ‘asix_init’:
    asix.c:317:6: warning: variable ‘rx_ctl’ set but not used
    [-Wunused-but-set-variable]
    usb.c: In function ‘usb_parse_config’:
    usb.c:331:17: warning: variable ‘ch’ set but not used
    [-Wunused-but-set-variable]
    usb.c: In function ‘usb_hub_port_connect_change’:
    usb.c:1123:29: warning: variable ‘portchange’ set but not used
    [-Wunused-but-set-variable]
    usb.c: In function ‘usb_hub_configure’:
    usb.c:1183:25: warning: variable ‘hubsts’ set but not used
    [-Wunused-but-set-variable]
    usb_storage.c: In function ‘usb_stor_CB_reset’:
    usb_storage.c:466:6: warning: variable ‘result’ set but not used
    [-Wunused-but-set-variable]

    Signed-off-by: Marek Vasut

    Marek Vasut
     

26 Jul, 2011

1 commit


13 Apr, 2011

1 commit


02 Apr, 2011

1 commit


23 Oct, 2010

1 commit


13 Oct, 2010

1 commit


25 Jul, 2010

2 commits

  • The dots printed by common/usb_storage.c as progress meter corrupt the
    output for example of "fatls usb" commands like this:

    => fatls usb 0
    . <<
    Cc: Remy Bohmer

    Wolfgang Denk
     
  • The device type was left uninitialized which caused later tests
    against DEV_TYPE_UNKNOWN to fail. In the result, "usb part" would
    attempt to print information about non-existent devices like this:

    => usb part
    print_part of 0

    Partition Map for USB device 0 -- Partition Type: DOS

    Partition Start Sector Num Sectors Type
    1 0 2031616 f8

    print_part of 1
    ## Unknown partition table

    print_part of 2
    ## Unknown partition table

    print_part of 3
    ## Unknown partition table

    print_part of 4
    ## Unknown partition table
    =>

    By initializing the type as DEV_TYPE_UNKNOWN we avoid all the
    "Unknown partition table" messages.

    [Note: the "print_part of ?" messages is left over debug code that
    will be removed in another patch.]

    Signed-off-by: Wolfgang Denk
    Cc: Remy Bohmer

    Wolfgang Denk
     

09 Apr, 2010

2 commits

  • While debugging one ill behaving USB device I found two bugs in USB
    storage probe.

    usb_stor_get_info() returns -1 (error), 0 (skip) or 1 (ok). First part
    of this patch fixes error case.

    Second part fixes usb_inquiry()'s retry counter handling. Original code
    had retry = -1 on error case, not retry = 0 as checked in the next line.

    Signed-off-by: Kim B. Heino

    Kim B. Heino
     
  • Here's another USB storage patch. Currently U-Boot handles storage
    devices #0 - #4 as valid devices, even if there is none connected. This
    patch fixes usb_stor_get_dev() to check detected device count instead
    of MAX-define.

    This is very important for ill behaving devices. usb_dev_desc[] can be
    partially initialized if device probe fails.

    After fixing get_dev() it was easy to fix "usb part" etc commands.
    Previously it outputed "Unknown partition table" five times, now it's
    "no USB devices available".

    Signed-off-by: Kim B. Heino

    Kim B. Heino
     

20 Dec, 2009

2 commits

  • This patch implements write support to usb device with raw partition.
    It will be useful for filesystem write support to usb device from
    u-boot in future.

    Tested with writing kernel image to raw usb disk & booting with usb
    read command into ram.

    [Note: run usb part to get info about start sector & number of
    sectors on a partition for usb write operation.]

    Signed-off-by: Mahavir Jain

    Mahavir Jain
     
  • 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
     

16 May, 2009

1 commit


16 Feb, 2009

1 commit

  • The LUN number is not part of the Command Descriptor Block (CDB) for scsi inquiry, request sense, test unit ready, read capacity and read10 commands. This patch removes the LUN number information from the CDB.

    Signed-off-by: Thomas Abraham
    Signed-off-by: Remy Bohmer

    Abraham, Thomas
     

29 Jan, 2009

3 commits


13 Aug, 2008

1 commit


14 Jul, 2008

1 commit


22 May, 2008

1 commit