summary refs log tree commit diff stats
path: root/hw/arm/fsl-imx31.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-07-04 13:06:35 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-07-04 13:06:35 +0100
commita7aeb5f7b2c713e2ab7e0a142e0c89f7b2aa5bb7 (patch)
tree95fe87f144142edd40180d303ac6769c85a4151f /hw/arm/fsl-imx31.c
parenta1777f7f6462c66e1ee6e98f0d5c431bfe988aa5 (diff)
downloadfocaccia-qemu-a7aeb5f7b2c713e2ab7e0a142e0c89f7b2aa5bb7.tar.gz
focaccia-qemu-a7aeb5f7b2c713e2ab7e0a142e0c89f7b2aa5bb7.zip
imx: Use memory_region_init_rom() for ROMs
The imx boards were all incorrectly creating ROMs using
memory_region_init_rom_device() with a NULL ops pointer. This
will cause QEMU to abort if the guest tries to write to the
ROM. Switch to the new memory_region_init_rom() instead.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1467122287-24974-3-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'hw/arm/fsl-imx31.c')
-rw-r--r--hw/arm/fsl-imx31.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
index 31a3a87911..b283b71eb4 100644
--- a/hw/arm/fsl-imx31.c
+++ b/hw/arm/fsl-imx31.c
@@ -219,9 +219,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
     }
 
     /* On a real system, the first 16k is a `secure boot rom' */
-    memory_region_init_rom_device(&s->secure_rom, NULL, NULL, NULL,
-                                  "imx31.secure_rom",
-                                  FSL_IMX31_SECURE_ROM_SIZE, &err);
+    memory_region_init_rom(&s->secure_rom, NULL, "imx31.secure_rom",
+                           FSL_IMX31_SECURE_ROM_SIZE, &err);
     if (err) {
         error_propagate(errp, err);
         return;
@@ -230,8 +229,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
                                 &s->secure_rom);
 
     /* There is also a 16k ROM */
-    memory_region_init_rom_device(&s->rom, NULL, NULL, NULL, "imx31.rom",
-                                  FSL_IMX31_ROM_SIZE, &err);
+    memory_region_init_rom(&s->rom, NULL, "imx31.rom",
+                           FSL_IMX31_ROM_SIZE, &err);
     if (err) {
         error_propagate(errp, err);
         return;