summary refs log tree commit diff stats
path: root/hw/r2d.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-25 07:48:24 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-25 07:48:24 -0500
commit8ef9ea85a2cc1007eaefa53e6871f1f83bcef22d (patch)
treefe43017f2bf431bc55a90b28e6c0e9357c4d46bd /hw/r2d.c
parent444dc48298c480e42e15a8fe676be737d8a6b2a1 (diff)
parent2b90ca040c59d73943061e49f39455964e8af158 (diff)
downloadfocaccia-qemu-8ef9ea85a2cc1007eaefa53e6871f1f83bcef22d.tar.gz
focaccia-qemu-8ef9ea85a2cc1007eaefa53e6871f1f83bcef22d.zip
Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging
Diffstat (limited to 'hw/r2d.c')
-rw-r--r--hw/r2d.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/r2d.c b/hw/r2d.c
index 96a7ff8c35..41aa2c2bd2 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -235,6 +235,7 @@ static void r2d_init(ram_addr_t ram_size,
     qemu_irq *irq;
     DriveInfo *dinfo;
     int i;
+    MemoryRegion *flash = g_new(MemoryRegion, 1);
 
     if (!cpu_model)
         cpu_model = "SH7751R";
@@ -267,11 +268,13 @@ static void r2d_init(ram_addr_t ram_size,
 
     /* onboard flash memory */
     dinfo = drive_get(IF_PFLASH, 0, 0);
-    pflash_cfi02_register(0x0, qemu_ram_alloc(NULL, "r2d.flash", FLASH_SIZE),
+    memory_region_init_rom_device(flash, &pflash_cfi02_ops_le,
+                                  NULL, "r2d.flash", FLASH_SIZE);
+    pflash_cfi02_register(0x0, flash,
                           dinfo ? dinfo->bdrv : NULL, (16 * 1024),
                           FLASH_SIZE >> 16,
                           1, 4, 0x0000, 0x0000, 0x0000, 0x0000,
-                          0x555, 0x2aa, 0);
+                          0x555, 0x2aa);
 
     /* NIC: rtl8139 on-board, and 2 slots. */
     for (i = 0; i < nb_nics; i++)