Skip to content
Snippets Groups Projects
Commit 9815abea authored by Gary Bisson's avatar Gary Bisson
Browse files

image-sparse: disable data cache to avoid misaligned warnings

parent 72ff8eb1
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ int write_sparse_image(struct sparse_storage *info,
chunk_header_t *chunk_header;
uint32_t total_blocks = 0;
int fill_buf_num_blks;
int dcache_enabled = dcache_status();
int i;
int j;
......@@ -106,6 +107,10 @@ int write_sparse_image(struct sparse_storage *info,
puts("Flashing Sparse Image\n");
/* Disable data cache since chunks might not be aligned */
if (dcache_enabled)
dcache_disable();
/* Start processing chunks */
blk = info->start;
for (chunk = 0; chunk < sparse_header->total_chunks; chunk++) {
......@@ -248,6 +253,10 @@ int write_sparse_image(struct sparse_storage *info,
}
}
/* Re-enable data cache it in case it was in the first place */
if (dcache_enabled)
dcache_enable();
debug("Wrote %d blocks, expected to write %d blocks\n",
total_blocks, sparse_header->total_blks);
printf("........ wrote %u bytes to '%s'\n", bytes_written, part_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment