summaryrefslogtreecommitdiff
path: root/common/image-sparse.c
AgeCommit message (Collapse)Author
2018-05-30mmc: Separate "mmc swrite" from fastbootAlex Kiernan
Introduce CONFIG_IMAGE_SPARSE and CONFIG_CMD_MMC_SWRITE so the "mmc swrite" command is separated from the fastboot code. Move image-sparse from common to lib so it's clear it's library code. Rename CONFIG_FASTBOOT_FLASH_FILLBUF_SIZE to CONFIG_IMAGE_SPARSE_FILLBUF_SIZE and migrate it to Kconfig. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Acked-by: Jassi Brar <jaswinder.singh@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-30fastboot: Refactor fastboot_okay/fail to take responseAlex Kiernan
Add the response string as a parameter to fastboot_okay/fail, instead of modifying a global, to match the contract expected by the AOSP U-Boot code. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2018-05-07fastboot: sparse: make write_sparse_image useable for non-fastbootJassi Brar
write_sparse_image could be useful for non-fastboot users. For ex a platform, without usb-device/fastboot support, could get sparse images over tftp and write using the mmc command. Or non-android systems could also leverage the sparse format. Towards that, this patch removes anything fastboot specific from the write_sparse_image implementation. Which includes making the function return integer as error code and calls for fastboot logging via an optional callback function 'mssg'. Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-05-07fastboot: sparse: remove redundant argument to write_sparse_imageJassi Brar
'sz' has no use for write_sparse_image, remove it simplifying the api. Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-06-27fastboot: sparse: improve CHUNK_TYPE_FILL write performanceSteve Rae
- increase the size of the fill buffer - testing has shown a 10x improvement when the sparse image has large CHUNK_TYPE_FILL chunks Signed-off-by: Steve Rae <srae@broadcom.com>
2016-06-27fastboot: sparse: implement reserve()Steve Rae
In order to process the CHUNK_TYPE_DONT_CARE properly, there is a requirement to be able to 'reserve' a specified number of blocks in the storage media. Because of the special handling of "bad blocks" in NAND devices, this is implemented in a storage abstraction function. Signed-off-by: Steve Rae <srae@broadcom.com> Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-06-27fastboot: sparse: resync common/image-sparse.c (part 2)Steve Rae
- update fastboot_okay() and fastboot_fail() This file originally came from upstream code. While retaining the storage abstraction feature, this is the second set of the changes required to resync with the cmd_flash_mmc_sparse_img() in the file aboot.c from https://us.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=LE.BR.1.2.1 Signed-off-by: Steve Rae <srae@broadcom.com>
2016-06-27fastboot: sparse: resync common/image-sparse.c (part 1)Steve Rae
This file originally came from upstream code. While retaining the storage abstraction feature, this is the first set of the changes required to resync with the cmd_flash_mmc_sparse_img() in the file aboot.c from https://us.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=LE.BR.1.2.1 Signed-off-by: Steve Rae <srae@broadcom.com>
2016-06-27fastboot: sparse: remove session-id logicSteve Rae
This "session-id" alogrithm is not required, and currently corrupts the stored image whenever more the one "session" is required. Signed-off-by: Steve Rae <srae@broadcom.com>
2016-04-11fastboot: sparse: remove unnecessary loggingSteve Rae
remove logging of the 'skipped' blocks Signed-off-by: Steve Rae <srae@broadcom.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-11fastboot: sparse: fix block addressing for don't care chunk typeSteve Rae
When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented, it dropped 9981945 (aboot: fix block addressing for don't care chunk type). This re-implements the required fix for the "don't care chunk type"... Signed-off-by: Steve Rae <srae@broadcom.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-11fastboot: sparse: fix sparse blocks calculationJeffy Chen
It may overflow in sparse_block_size_to_storage, use uint64_t instead in the calculation. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2015-11-12sparse: Rename the file and headerMaxime Ripard
The Android sparse image format is currently supported through a file called aboot, which isn't really such a great name, since the sparse image format is only used for transferring data with fastboot. Rename the file and header to a file called "sparse", which also makes it consistent with the header defining the image structures. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>