From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58295 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6Tiu-00065j-Sg for qemu-devel@nongnu.org; Sun, 03 Apr 2011 16:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6Tit-0008Ps-RA for qemu-devel@nongnu.org; Sun, 03 Apr 2011 16:16:36 -0400 Received: from mga11.intel.com ([192.55.52.93]:11602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6Tit-0008Pj-My for qemu-devel@nongnu.org; Sun, 03 Apr 2011 16:16:35 -0400 From: Jordan Justen Date: Sun, 3 Apr 2011 13:16:26 -0700 Message-Id: <1301861786-6637-1-git-send-email-jordan.l.justen@intel.com> Subject: [Qemu-devel] [PATCH] hw/pflash_cfi02: Fix lazy reset of ROMD mode List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jordan Justen When checking pfl->rom_mode for when to lazily reenter ROMD mode, the value was check was the opposite of what it should have been. This prevent the part from returning to ROMD mode after a write was made to the CFI rom region. Signed-off-by: Jordan Justen --- hw/pflash_cfi02.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c index 30c8aa4..370c5ee 100644 --- a/hw/pflash_cfi02.c +++ b/hw/pflash_cfi02.c @@ -112,7 +112,7 @@ static uint32_t pflash_read (pflash_t *pfl, target_phys_addr_t offset, DPRINTF("%s: offset " TARGET_FMT_plx "\n", __func__, offset); ret = -1; - if (pfl->rom_mode) { + if (!pfl->rom_mode) { /* Lazy reset of to ROMD mode */ if (pfl->wcycle == 0) pflash_register_memory(pfl, 1); -- 1.7.1