@@ -313,7 +313,8 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
DPRINTF("%s: Write to buffer\n", __func__);
pfl->status |= 0x80; /* Ready! */
break;
- case 0xff: /* Read array mode */
+ case 0xf0: /* Read array mode */
+ case 0xff:
DPRINTF("%s: Read array mode\n", __func__);
goto reset_flash;
default:
@@ -367,7 +368,7 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
}
break;
case 0x98:
- if (cmd == 0xff) {
+ if (cmd == 0xff || cmd == 0xf0) {
goto reset_flash;
} else {
DPRINTF("%s: leaving query mode\n", __func__);
In CFI Specification, "0xff" and "0xf0" are both the data to select and deselect read mode, so add "0xf0" here. Linux guest os often uses "0xf0" to select read mode, which leads qemu printing "pflash_write: Unimplemented flash cmd sequence (offset 00000000, wcycle 0x0 cmd 0x0 value 0xf0)". This patch fixes this mistake. Signed-off-by: Liming Wang <walimisdev@gmail.com> --- hw/pflash_cfi01.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)