summaryrefslogtreecommitdiffstats
path: root/Documentation/user
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-01-09 16:07:09 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-01-18 13:52:17 +0100
commit04413763ad3c3c0580c6a35bc44a92d08638e058 (patch)
tree406baca38838eb4be80f580a5e1f055247f1cb8c /Documentation/user
parent1930c3d11d7126d511b06b1131cea8d42218d820 (diff)
downloadbarebox-04413763ad3c3c0580c6a35bc44a92d08638e058.tar.gz
barebox-04413763ad3c3c0580c6a35bc44a92d08638e058.tar.xz
usb: gadget: fastboot: Add sparse image support
Sparse images are needed for fastboot to flash images that do not fit into memory. Android fastboot is kind of a dumb protocol. It first sends you a big image and afterwards it tells you where to put this image. This of course limits fastboot to files smaller than the available memory. To bypass this issue fastboot has so called Sparse image support. This is a new image format that can contain holes in the data so a big image can be written in multiple steps with holes in other areas each step. Implementing this for UBI images is kind of tricky since ubiformat normally expects to get a single image. Preparations to ubiformat a device in multiple parts have been done in previous patches. It is however, only for the first part possible to detect if it is a UBI image. The other parts are just binary data and we cannot know if we have to pass this data raw to the flash or use ubiformat. For this reason this patch makes the 'u' flag in the partition description mandatory for proper UBI image flashing on MTD devices. fastboot passes a max_download_size variable to the host. This variable contains the image size fastboot can take in one go. We have to choose a good compromise here. On one hand we do not want to risk that we actually do not have enough memory to hold the transferred image, on the other hand we want images like bootloaders not as sparse images, but in one go instead to make atomic exchange of the bootloader possible. Right now we have chosen 8MiB which should be big enough for all bootloaders. The value is configurable via global.usbgadget.fastboot_max_download_size. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Documentation/user')
-rw-r--r--Documentation/user/usb.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/user/usb.rst b/Documentation/user/usb.rst
index 3844e7941a..8396f3897c 100644
--- a/Documentation/user/usb.rst
+++ b/Documentation/user/usb.rst
@@ -64,6 +64,7 @@ Several **flags** are supported, each denoted by a single character:
* ``s`` Safe mode. The file is downloaded completely before it is written (DFU specific)
* ``r`` Readback. The partition is allowed to be read back (DFU specific)
* ``c`` The file shall be created if it doesn't exist. Needed when a regular file is exported.
+* ``u`` The partition is a MTD device and shall be flashed with a UBI image.
Example: