u-boot/drivers/usb
Maxime Ripard 6c9e00eebf fastboot: Implement flashing session counter
The fastboot flash command that writes an image to a partition works in
several steps:

1 - Retrieve the maximum size the device can download through the
    "max-download-size" variable

2 - Retrieve the partition type through the "partition-type:%s" variable,
    that indicates whether or not the partition needs to be erased (even
    though the fastboot client has minimal support for that)

3a - If the image is smaller than what the device can handle, send the image
     and flash it.

3b - If the image is larger than what the device can handle, create a
     sparse image, and split it in several chunks that would fit. Send the
     chunk, flash it, repeat until we have no more data to send.

However, in the 3b case, the subsequent transfers have no particular
identifiers, the protocol just assumes that you would resume the writes
where you left it.

While doing so works well, it also means that flashing two subsequent
images on the same partition (for example because the user made a mistake)
would not work withouth flashing another partition or rebooting the board,
which is not really intuitive.

Since we have always the same pattern, we can however maintain a counter
that will be reset every time the client will retrieve max-download-size,
and incremented after each buffer will be flashed, that will allow us to
tell whether we should simply resume the flashing where we were, or start
back at the beginning of the partition.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-11-12 13:17:32 -05:00
..
dwc3 Various Makefiles: Add SPDX-License-Identifier tags 2015-11-10 09:19:52 -05:00
emul dm: usb: Add a terminator to the string destructor list 2015-04-22 11:13:24 -06:00
eth Merge branch 'master' of git://git.denx.de/u-boot-net 2015-10-29 16:30:33 -04:00
gadget fastboot: Implement flashing session counter 2015-11-12 13:17:32 -05:00
host ohci: Add missing cache-flush for hcca area 2015-11-03 17:29:33 +01:00
musb usb: musb-new: CONFIG_MUSB prefix replacement with CONFIG_USB_MUSB 2015-08-05 17:20:34 +02:00
musb-new Various Makefiles: Add SPDX-License-Identifier tags 2015-11-10 09:19:52 -05:00
phy usb: xhci: omap: Remove common dwc3 drv functions calls 2015-07-22 08:55:44 +02:00
ulpi drivers: usb: convert makefiles to Kbuild style 2013-10-31 13:25:38 -04:00
Kconfig usb: musb-new: Kconfig support for USB_MUSB_HOST and USB_MUSB_GADGET 2015-08-05 17:20:34 +02:00