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)
{
return -EINVAL;
}
- puts("Flashing Sparse Image\n");
+ /*
+ * 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);
/* Start processing chunks */
- start = storage->start;
for (chunk = 0; chunk < sparse_header->total_chunks; chunk++) {
uint32_t blkcnt;
return -EIO;
}
+ last_offset = start + total_blocks;
+
return 0;
}