mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-06 14:37:42 -07:00
nand: fix flash erase when oob is in memory
For the "main area on file, oob in memory" case, fix the shifts so that we erase the correct number of pages. Signed-off-by: Ricard Wanderlöf <ricardw@axis.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
7595ed7439
commit
8e37ca6d0b
1 changed files with 1 additions and 1 deletions
|
|
@ -712,7 +712,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)
|
|||
memset(s->storage + (PAGE(addr) << OOB_SHIFT),
|
||||
0xff, OOB_SIZE << s->erase_shift);
|
||||
i = SECTOR(addr);
|
||||
page = SECTOR(addr + (ADDR_SHIFT + s->erase_shift));
|
||||
page = SECTOR(addr + (1 << (ADDR_SHIFT + s->erase_shift)));
|
||||
for (; i < page; i ++)
|
||||
if (blk_write(s->blk, i, iobuf, 1) < 0) {
|
||||
printf("%s: write error in sector %" PRIu64 "\n", __func__, i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue