diff options
author | Steve Rae <srae@broadcom.com> | 2016-06-07 11:19:35 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-06-27 16:36:33 -0400 |
commit | 64ece84854ae49f40e9b9d4d88502247774f9d2f (patch) | |
tree | 5d02749db9a0ef23a4bd25fb66badd054162f3f2 /common | |
parent | ac6e5fed31ccd1da18b8ef10542c3534bd2dbd38 (diff) |
fastboot: sparse: remove session-id logic
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>
Diffstat (limited to 'common')
-rw-r--r-- | common/fb_mmc.c | 8 | ||||
-rw-r--r-- | common/fb_nand.c | 4 | ||||
-rw-r--r-- | common/image-sparse.c | 21 |
3 files changed, 9 insertions, 24 deletions
diff --git a/common/fb_mmc.c b/common/fb_mmc.c index e3abcc85be..9e53adba5e 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -97,9 +97,8 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info, fastboot_okay(response_str, ""); } -void fb_mmc_flash_write(const char *cmd, unsigned int session_id, - void *download_buffer, unsigned int download_bytes, - char *response) +void fb_mmc_flash_write(const char *cmd, void *download_buffer, + unsigned int download_bytes, char *response) { struct blk_desc *dev_desc; disk_partition_t info; @@ -153,8 +152,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id, printf("Flashing sparse image at offset " LBAFU "\n", info.start); - store_sparse_image(&sparse, &sparse_priv, session_id, - download_buffer); + store_sparse_image(&sparse, &sparse_priv, download_buffer); } else { write_raw_image(dev_desc, &info, cmd, download_buffer, download_bytes); diff --git a/common/fb_nand.c b/common/fb_nand.c index ae34f4891b..a0a9839db5 100644 --- a/common/fb_nand.c +++ b/common/fb_nand.c @@ -126,7 +126,7 @@ static int fb_nand_sparse_write(struct sparse_storage *storage, return written / storage->block_sz; } -void fb_nand_flash_write(const char *partname, unsigned int session_id, +void fb_nand_flash_write(const char *partname, void *download_buffer, unsigned int download_bytes, char *response) { @@ -161,7 +161,7 @@ void fb_nand_flash_write(const char *partname, unsigned int session_id, sparse.name = part->name; sparse.write = fb_nand_sparse_write; - ret = store_sparse_image(&sparse, &sparse_priv, session_id, + ret = store_sparse_image(&sparse, &sparse_priv, download_buffer); } else { printf("Flashing raw image at offset 0x%llx\n", diff --git a/common/image-sparse.c b/common/image-sparse.c index 2bf737b46c..893c68b35f 100644 --- a/common/image-sparse.c +++ b/common/image-sparse.c @@ -52,8 +52,6 @@ typedef struct sparse_buffer { u16 type; } sparse_buffer_t; -static uint32_t last_offset; - static unsigned int sparse_get_chunk_data_size(sparse_header_t *sparse, chunk_header_t *chunk) { @@ -267,8 +265,8 @@ static void sparse_put_data_buffer(sparse_buffer_t *buffer) free(buffer); } -int store_sparse_image(sparse_storage_t *storage, void *storage_priv, - unsigned int session_id, void *data) +int store_sparse_image(sparse_storage_t *storage, + void *storage_priv, void *data) { unsigned int chunk, offset; sparse_header_t *sparse_header; @@ -303,19 +301,10 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv, return -EINVAL; } - /* - * If it's a new flashing session, start at the beginning of - * the partition. If not, then simply resume where we were. - */ - if (session_id > 0) - start = last_offset; - else - start = storage->start; - - printf("Flashing sparse image on partition %s at offset 0x%x (ID: %d)\n", - storage->name, start * storage->block_sz, session_id); + puts("Flashing Sparse Image\n"); /* Start processing chunks */ + start = storage->start; for (chunk = 0; chunk < sparse_header->total_chunks; chunk++) { uint32_t blkcnt; @@ -390,7 +379,5 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv, return -EIO; } - last_offset = start + total_blocks; - return 0; } |