diff options
author | Juha Riihimäki <juha.riihimaki@nokia.com> | 2011-07-29 16:35:22 +0100 |
---|---|---|
committer | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2011-07-30 06:10:06 +0200 |
commit | d72245fbcf3391bfb61ec447dc1888919b3d148b (patch) | |
tree | cb61bf49094d376dd16f68634fcddb356a1cd9c9 /hw/nand.c | |
parent | 48197dfa6a26fa1807f19f510a2e840bb3885680 (diff) |
hw/nand: Support multiple reads following READ STATUS
After receiving READ STATUS command all subsequent IO reads should return
the status register value until another command is issued.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Diffstat (limited to 'hw/nand.c')
-rw-r--r-- | hw/nand.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; } |