Commit 3656744cddce7937e54b78c5f9b5ba002d440105

Authored by balrog
1 parent f4b1a842

Reset CFI01 flash wcycle after erase confirm (Thomas Petazzoni).

pfl->wcycle was set to 1 when the erase confirm command was set, which
lead to the next command being misinterpreted by Qemu:

pflash_write: Unimplemented flash cmd sequence (offset 00000000,
wcycle 0x1 cmd 0x20 value 0x70)

This patch fixes this issue by resetting pfl->wcycle to 0 on erase
confirm so that the next command is considered as a new one.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5409 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 1 additions and 1 deletions
hw/pflash_cfi01.c
@@ -267,7 +267,7 @@ static void pflash_write (pflash_t *pfl, target_ulong offset, uint32_t value, @@ -267,7 +267,7 @@ static void pflash_write (pflash_t *pfl, target_ulong offset, uint32_t value,
267 case 0x20: /* Block erase */ 267 case 0x20: /* Block erase */
268 case 0x28: 268 case 0x28:
269 if (cmd == 0xd0) { /* confirm */ 269 if (cmd == 0xd0) { /* confirm */
270 - pfl->wcycle = 1; 270 + pfl->wcycle = 0;
271 pfl->status |= 0x80; 271 pfl->status |= 0x80;
272 } else if (cmd == 0xff) { /* read array mode */ 272 } else if (cmd == 0xff) { /* read array mode */
273 goto reset_flash; 273 goto reset_flash;