]> Git Repo - qemu.git/commitdiff
hw/nand.c: Fix nand erase operation
authorWendy Liang <[email protected]>
Wed, 3 Apr 2013 05:33:08 +0000 (15:33 +1000)
committerPeter Maydell <[email protected]>
Fri, 5 Apr 2013 16:08:54 +0000 (17:08 +0100)
Usually, nand erase operation has only 2 or 3 address cycles.
We need to mask s->addr to zero unset stale high-order bytes in the nand address
before using it as the erase address.

This fixes the NAND erase operation in Linux.

[PC: Generalised to work for any number of address cycles rather than just 3]

Signed-off-by: Wendy Liang <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Message-id: 1364967188[email protected]
Signed-off-by: Peter Maydell <[email protected]>
hw/nand.c

index de3e502596f080de222bc055d6a042a3bea1cdeb..63620938fba0c4321c3dd94076a30cc60b6f560c 100644 (file)
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -297,6 +297,7 @@ static void nand_command(NANDFlashState *s)
         break;
 
     case NAND_CMD_BLOCKERASE2:
+        s->addr &= (1ull << s->addrlen * 8) - 1;
         if (nand_flash_ids[s->chip_id].options & NAND_SAMSUNG_LP)
             s->addr <<= 16;
         else
This page took 0.029608 seconds and 4 git commands to generate.