hw/pflash_cfi02: Fix lazy reset of ROMD mode
authorJordan Justen <jordan.l.justen@intel.com>
Sun, 3 Apr 2011 20:16:26 +0000 (13:16 -0700)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 9 Apr 2011 16:32:13 +0000 (18:32 +0200)
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 <jordan.l.justen@intel.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
hw/pflash_cfi02.c

index 30c8aa4e4f619cbc93cc0e2f4f5f9fd97e3e0f5e..370c5eef7b94237fb876d58f411014912e5cf6a1 100644 (file)
@@ -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);