aboutsummaryrefslogtreecommitdiff
path: root/hw/nand.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-12 09:19:36 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-12 09:19:36 +0000
commita07dec2212d6ba9751dd1dac2b3f4b560325fee0 (patch)
treea6df3df7f76d85b3c592521be006ef909115b918 /hw/nand.c
parentb645bb48850fea8db017026897827f0ab42fbdea (diff)
Correct NAND erase block size. Misc fixes in Spitz code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2806 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/nand.c')
-rw-r--r--hw/nand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/nand.c b/hw/nand.c
index 04967817be..5bce250526 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -547,7 +547,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(struct nand_flash_s *s)
page = i >> 9;
if (bdrv_read(s->bdrv, page, iobuf, 1) == -1)
printf("%s: read error in sector %i\n", __FUNCTION__, page);
- memset(iobuf, 0xff, addr & 0x1ff);
+ memset(iobuf, 0xff, ((addr - 1) & 0x1ff) + 1);
if (bdrv_write(s->bdrv, page, iobuf, 1) == -1)
printf("%s: write error in sector %i\n", __FUNCTION__, page);
}