1. 24 Feb, 2016 1 commit
    • Lukasz Majewski's avatar
      dfu: usb: f_dfu: Set deferred call for dfu_flush() function · fc18f8d1
      Lukasz Majewski authored
      This patch fixes situation when one would like to write large file into
      medium with the file system (fat, ext4, etc).
      This change sets file size limitation to the DFU internal buffer size.
      Since u-boot is not supporting interrupts and seek on file systems, it
      becomes challenging to store large file appropriately.
      To reproduce this error - create large file (around 26 MiB) and sent it
      to the target board.
      Lets examine the flow of USB transactions:
      0. DFU uses EP0 with 64B MPS [Max Packet Size]
      1. Send file - OUT (PC->target) - dat_26MiB.img is sent with 4096 B transactions
      2. Get status - OUT (PC->target) - wait for DFU_STATE_dfuDNLOAD_IDLE (0x05) sent
      				   from target board - IN transaction
      3. The whole file content is sent to target - OUT (PC->target) with ZLP [Zero
      					      Length Packet]
      Now the interesting part starts:
      4. OUT (PC->target) Setup transaction (request to share DFU state)
      5. IN (target->PC) - reply the current DFU state
      	- In the UDC driver the req->completion (with dfu_flush) is called
      	  after successful IN transfer.
      	- The dfu_flush() (called from req->completion callback) saves the
      	  whole file at once (u-boot doesn't support seek on fs).
      	  Such operation takes considerable time. When the file
      	  is large - e.g. 26MiB - this time may be more than 5 seconds.
      6. OUT (PC->target) - ZLP, is send in the same time when dfu_flush()
       writes data to eMMC memory.
       The dfu-util application has hard coded timeout on USB transaction
       completion set to 5 seconds (it uses libusb calls).
      When the file to store is large (e.g. 26 MiB) the time needed to write it
      may excess the dfu-util timeout and following error message will be displayed:
      "unable to read DFU status" on the HOST PC console.
      This change is supposed to leverage DFU's part responsible for storing files
      on file systems. Other DFU operations - i.e. raw/partition write to NAND and
      eMMC should work as before.
      The only functional change is the error reporting. When dfu_flush() fails
      the u-boot prompt will exit with error information and dfu-util application
      exits afterwards as well.
      Test HW:
      - Odroid XU3 (Exynos5433) - test with large file
      - Trats (Exynos4210) - test for regression - eMMC, raw,
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Reported-by: default avatarAlex Gdalevich <agdalevich@axion-biosystems.com>
      Tested-by: default avatarStephen Warren <swarren@nvidia.com>
      Tested-by: default avatarHeiko Schocher <hs@denx.de>
  2. 25 Jan, 2016 2 commits
  3. 20 Nov, 2015 1 commit
  4. 07 Sep, 2015 1 commit
  5. 14 Apr, 2015 3 commits
  6. 18 Dec, 2014 1 commit
  7. 02 Sep, 2014 1 commit
    • Lukasz Majewski's avatar
      dfu: Provide means to find difference between dfu-util -e and -R · 1cc03c5c
      Lukasz Majewski authored
      This commit provides distinction between DFU device detach and reset.
      The -R behavior is preserved with proper handling of the dfu-util's -e
      switch, which detach the DFU device.
      By running dfu-util -e; one can force device to finish the execution of
      dfu command on target and execute some other scripted commands.
      Moreover, some naming has been changed - the dfu_reset() method now is known
      as dfu_detach(). New name better reflects the purpose of the code.
      It was also necessary to increase the number of usb_gadget_handle_interrupts()
      calls since we also must wait for detection of the USB reset event.
      Example usage:
      1. -e (detach) switch
       dfu-util -a0 -D file1.bin;dfu-util -a3 -D uImage;dfu-util -e
       access to u-boot prompt.
      2. -R (reset) switch
       dfu-util -a0 -D file1.bin;dfu-util -R -a3 -D uImage
       target board reset
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Reviewed-by: default avatarStephen Warren <swarren@nvidia.com>
      Tested-by: default avatarStephen Warren <swarren@nvidia.com>
  8. 09 Aug, 2014 1 commit
    • Stephen Warren's avatar
      dfu: defer parsing of device string to IO backend · dd64827e
      Stephen Warren authored
      Devices are not all identified by a single integer. To support
      this, defer the parsing of the device string to the IO backed, so that
      it can apply the appropriate rules.
      SPI devices are specified as controller:chip_select. SPI/SF support will
      be added soon.
      MMC devices can also be specified as controller[.hwpart][:partition] in
      many commands, although we don't support that syntax in DFU.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
  9. 25 Jun, 2014 1 commit
  10. 05 May, 2014 1 commit
  11. 20 Oct, 2013 1 commit
  12. 24 Sep, 2013 2 commits
  13. 29 Jul, 2013 1 commit
  14. 24 Jul, 2013 1 commit
  15. 16 Mar, 2013 2 commits
  16. 15 Oct, 2012 1 commit
    • Albert ARIBAUD's avatar
      ARM: prevent misaligned array inits · b823fd9b
      Albert ARIBAUD authored
      Under option -munaligned-access, gcc can perform local char
      or 16-bit array initializations using misaligned native
      accesses which will throw a data abort exception. Fix files
      where these array initializations were unneeded, and for
      files known to contain such initializations, enforce gcc
      option -mno-unaligned-access.
      Signed-off-by: default avatarAlbert ARIBAUD <albert.u.boot@aribaud.net>
      [trini: Switch to usign call cc-option for -mno-unaligned-access as
      Albert had done previously as that's really correct]
      Signed-off-by: default avatarTom Rini <trini@ti.com>
  17. 01 Sep, 2012 1 commit