Message ID | 1310741906-1606-5-git-send-email-peter.maydell@linaro.org |
---|---|
State | Accepted |
Commit | d72245fbcf3391bfb61ec447dc1888919b3d148b |
Headers | show |
diff --git a/hw/nand.c b/hw/nand.c index 2e98f25..e6c551d 100644 --- a/hw/nand.c +++ b/hw/nand.c @@ -496,9 +496,14 @@ uint32_t nand_getio(NANDFlashState *s) for (offset = s->buswidth; offset--;) { x |= s->ioaddr[offset] << (offset << 3); } - s->addr += s->buswidth; - s->ioaddr += s->buswidth; - s->iolen -= s->buswidth; + /* after receiving READ STATUS command all subsequent reads will + * return the status register value until another command is issued + */ + if (s->cmd != NAND_CMD_READSTATUS) { + s->addr += s->buswidth; + s->ioaddr += s->buswidth; + s->iolen -= s->buswidth; + } return x; }