From: Edgar E. Iglesias <edgar.igles...@gmail.com>

Signed-off-by: Edgar E. Iglesias <edgar.igles...@gmail.com>
---

 hw/nand.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/nand.c b/hw/nand.c
index 01f3ada..f931d0c 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -478,6 +478,12 @@ void nand_setio(DeviceState *dev, uint32_t value)
     int i;
     NANDFlashState *s = (NANDFlashState *) dev;
     if (!s->ce && s->cle) {
+        if (s->cmd == NAND_CMD_READSTATUS) {
+            s->addr = 0;
+            s->addrlen = 0;
+            s->iolen = 0;
+        }
+
         if (nand_flash_ids[s->chip_id].options & NAND_SAMSUNG_LP) {
             if (s->cmd == NAND_CMD_READ0 && value == NAND_CMD_LPREAD2)
                 return;
-- 
1.7.0.4


Reply via email to