Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KlNpc-00009x-I9 for qemu-devel@nongnu.org; Thu, 02 Oct 2008 09:03:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KlNpa-00007a-EQ for qemu-devel@nongnu.org; Thu, 02 Oct 2008 09:02:59 -0400 Received: from [199.232.76.173] (port=48084 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KlNpa-00007K-48 for qemu-devel@nongnu.org; Thu, 02 Oct 2008 09:02:58 -0400 Received: from mail.free-electrons.com ([88.191.76.200]:38776) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KlNpY-0003Ou-9X for qemu-devel@nongnu.org; Thu, 02 Oct 2008 09:02:57 -0400 Message-Id: <20081002130238.863220005@free-electrons.com> References: <20081002130214.299833919@free-electrons.com> Date: Thu, 02 Oct 2008 15:02:16 +0200 From: Thomas Petazzoni Content-Disposition: inline; filename=pflash-cfi01-after-erase-confirm-reset-wcycle Subject: [Qemu-devel] [patch 2/4] Reset wcycle after erase confirm Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Thomas Petazzoni , michael@free-electrons.com 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 --- hw/pflash_cfi01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: qemu/hw/pflash_cfi01.c =================================================================== --- qemu.orig/hw/pflash_cfi01.c +++ qemu/hw/pflash_cfi01.c @@ -267,7 +267,7 @@ case 0x20: /* Block erase */ case 0x28: if (cmd == 0xd0) { /* confirm */ - pfl->wcycle = 1; + pfl->wcycle = 0; pfl->status |= 0x80; } else if (cmd == 0xff) { /* read array mode */ goto reset_flash; -- Thomas Petazzoni, Free Electrons Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com