aboutsummaryrefslogtreecommitdiff
path: root/hw/block/pflash_cfi02.c
diff options
context:
space:
mode:
authorStephen Checkoway <stephen.checkoway@oberlin.edu>2019-04-26 12:26:21 -0400
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2019-07-02 02:34:51 +0200
commita97910423975b9fee1dbcdc1a2488804d4092c36 (patch)
tree7caa487e961ba7b76df451c0a67462bc437a2861 /hw/block/pflash_cfi02.c
parent46fb7809b5520e2cb77bdc86270b0c393e4b1210 (diff)
downloadqemu-a97910423975b9fee1dbcdc1a2488804d4092c36.zip
qemu-a97910423975b9fee1dbcdc1a2488804d4092c36.tar.gz
qemu-a97910423975b9fee1dbcdc1a2488804d4092c36.tar.bz2
hw/block/pflash_cfi02: Fix reset command not ignored during erase
When the flash device is performing a chip erase, all commands are ignored. When it is performing a sector erase, only the erase suspend command is valid, which is currently not supported. In particular, the reset command should not cause the device to reset to read array mode while programming is on going. Signed-off-by: Stephen Checkoway <stephen.checkoway@oberlin.edu> Message-Id: <20190426162624.55977-8-stephen.checkoway@oberlin.edu> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/block/pflash_cfi02.c')
-rw-r--r--hw/block/pflash_cfi02.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index 13f76fa..39daa95 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -311,7 +311,8 @@ static void pflash_write(void *opaque, hwaddr offset, uint64_t value,
trace_pflash_io_write(offset, width, width << 1, value, pfl->wcycle);
cmd = value;
if (pfl->cmd != 0xA0) {
- if (cmd == 0xF0) {
+ /* Reset does nothing during chip erase and sector erase. */
+ if (cmd == 0xF0 && pfl->cmd != 0x10 && pfl->cmd != 0x30) {
if (pfl->wcycle == WCYCLE_AUTOSELECT_CFI) {
/* Return to autoselect mode. */
pfl->wcycle = 3;