summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-03-25 12:53:37 +0100
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2021-05-11 18:10:56 +0200
commit1d4ae5a34f45e530d2dfd2cb86fa9e86b0abec29 (patch)
tree45e152f8d60f35496fa90915b533f8087bfa5473
parentf9a576a818044133f8564e0d243ebd97df0b3280 (diff)
downloadfocaccia-qemu-1d4ae5a34f45e530d2dfd2cb86fa9e86b0abec29.tar.gz
focaccia-qemu-1d4ae5a34f45e530d2dfd2cb86fa9e86b0abec29.zip
hw/block/pflash_cfi02: Set romd mode in pflash_cfi02_realize()
The ROMD mode isn't related to mapping setup.
Ideally we'd set this mode when the state machine resets,
but for now simply move it to pflash_cfi02_realize() to
not introduce logical change.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210325120921.858993-2-f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
-rw-r--r--hw/block/pflash_cfi02.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index 25c053693c..35e30bb812 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -173,7 +173,6 @@ static void pflash_setup_mappings(PFlashCFI02 *pfl)
                                  "pflash-alias", &pfl->orig_mem, 0, size);
         memory_region_add_subregion(&pfl->mem, i * size, &pfl->mem_mappings[i]);
     }
-    pfl->rom_mode = true;
 }
 
 static void pflash_reset_state_machine(PFlashCFI02 *pfl)
@@ -917,6 +916,7 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)
     /* Allocate memory for a bitmap for sectors being erased. */
     pfl->sector_erase_map = bitmap_new(pfl->total_sectors);
 
+    pfl->rom_mode = true;
     pflash_setup_mappings(pfl);
     sysbus_init_mmio(SYS_BUS_DEVICE(dev), &pfl->mem);