diff options
author | Steve Rae <srae@broadcom.com> | 2016-06-07 21:19:38 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-06-27 23:37:39 +0300 |
commit | 2c72404687f1061d042769cc65ef90e6c3da3f96 (patch) | |
tree | 7ccf1a26328276f817dd8c0336ac8b74d911d28b /common/fb_mmc.c | |
parent | 9bc34799c8e6d8907b18e02c405576aa6bf9ce15 (diff) | |
download | u-boot-2c72404687f1061d042769cc65ef90e6c3da3f96.tar.xz |
fastboot: sparse: implement reserve()
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>
Diffstat (limited to 'common/fb_mmc.c')
-rw-r--r-- | common/fb_mmc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/fb_mmc.c b/common/fb_mmc.c index 6bafbc675d..c739651009 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -53,6 +53,12 @@ static lbaint_t fb_mmc_sparse_write(struct sparse_storage *info, return blk_dwrite(dev_desc, blk, blkcnt, buffer); } +static lbaint_t fb_mmc_sparse_reserve(struct sparse_storage *info, + lbaint_t blk, lbaint_t blkcnt) +{ + return blkcnt; +} + static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info, const char *part_name, void *buffer, unsigned int download_bytes) @@ -131,6 +137,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer, sparse.start = info.start; sparse.size = info.size; sparse.write = fb_mmc_sparse_write; + sparse.reserve = fb_mmc_sparse_reserve; printf("Flashing sparse image at offset " LBAFU "\n", sparse.start); |