diff mbox

[2/2] hw/nand.c: bug fix to erase operation

Message ID 1358490020-18061-2-git-send-email-dantesu@faraday-tech.com
State New
Headers show

Commit Message

Dante Jan. 18, 2013, 6:20 a.m. UTC
The s->addr is supposed to be reset along with the s->addrlen,
or it might be contains the previous address at last address cycle,
and causes problem to nand erase operation.

Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>
---
 hw/nand.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/hw/nand.c b/hw/nand.c
index 76479ed..b70a371 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -510,6 +510,7 @@  void nand_setio(DeviceState *dev, uint32_t value)
             nand_command(s);
 
         if (s->cmd != NAND_CMD_RANDOMREAD2) {
+            s->addr = 0;
             s->addrlen = 0;
         }
     }