summary refs log tree commit diff stats
path: root/hw/arm/omap_sx1.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-02-24 19:50:18 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-03-17 15:18:46 +0100
commit16260006acf8f3aee589b3fd26a1bbbf7b78ae4b (patch)
treeb550ba01b917ab5cfbe1989408c23904895a0bd0 /hw/arm/omap_sx1.c
parentd3ec684d70d98a9fbc56fda1b611d039c90d0c5f (diff)
downloadfocaccia-qemu-16260006acf8f3aee589b3fd26a1bbbf7b78ae4b.tar.gz
focaccia-qemu-16260006acf8f3aee589b3fd26a1bbbf7b78ae4b.zip
hw/arm: Use memory_region_init_rom() with read-only regions
This commit was produced with the Coccinelle script
scripts/coccinelle/memory-region-housekeeping.cocci.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/arm/omap_sx1.c')
-rw-r--r--hw/arm/omap_sx1.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index de5ff447dc..57829b3744 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -131,9 +131,8 @@ static void sx1_init(MachineState *machine, const int version)
     mpu = omap310_mpu_init(machine->ram, machine->cpu_type);
 
     /* External Flash (EMIFS) */
-    memory_region_init_ram(flash, NULL, "omap_sx1.flash0-0", flash_size,
+    memory_region_init_rom(flash, NULL, "omap_sx1.flash0-0", flash_size,
                            &error_fatal);
-    memory_region_set_readonly(flash, true);
     memory_region_add_subregion(address_space, OMAP_CS0_BASE, flash);
 
     memory_region_init_io(&cs[0], NULL, &static_ops, &cs0val,
@@ -167,9 +166,8 @@ static void sx1_init(MachineState *machine, const int version)
     if ((version == 1) &&
             (dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
         MemoryRegion *flash_1 = g_new(MemoryRegion, 1);
-        memory_region_init_ram(flash_1, NULL, "omap_sx1.flash1-0",
+        memory_region_init_rom(flash_1, NULL, "omap_sx1.flash1-0",
                                flash1_size, &error_fatal);
-        memory_region_set_readonly(flash_1, true);
         memory_region_add_subregion(address_space, OMAP_CS1_BASE, flash_1);
 
         memory_region_init_io(&cs[1], NULL, &static_ops, &cs1val,