diff options
author | Avi Kivity <avi@redhat.com> | 2011-08-04 15:55:30 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-08-25 10:56:33 +0300 |
commit | c8a50e596c8eeb41bf5718df5bad6be4080f40c7 (patch) | |
tree | 589bfb006ec42863a518debd4775d88a3abfe185 /hw/collie.c | |
parent | a1807ef2954d3ddbf9a9bca3949bd0c69fd45a0e (diff) | |
download | qemu-c8a50e596c8eeb41bf5718df5bad6be4080f40c7.zip qemu-c8a50e596c8eeb41bf5718df5bad6be4080f40c7.tar.gz qemu-c8a50e596c8eeb41bf5718df5bad6be4080f40c7.tar.bz2 |
pflash_cfi01/pflash_cfi02: convert to memory API
cfi02 is annoying in that is ignores some address bits; we probably
want explicit support in the memory API for that.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/collie.c')
-rw-r--r-- | hw/collie.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/hw/collie.c b/hw/collie.c index 156404d..0b955e0 100644 --- a/hw/collie.c +++ b/hw/collie.c @@ -26,7 +26,7 @@ static void collie_init(ram_addr_t ram_size, { StrongARMState *s; DriveInfo *dinfo; - ram_addr_t phys_flash; + MemoryRegion *phys_flash = g_new(MemoryRegion, 2); if (!cpu_model) { cpu_model = "sa1110"; @@ -34,17 +34,19 @@ static void collie_init(ram_addr_t ram_size, s = sa1110_init(collie_binfo.ram_size, cpu_model); - phys_flash = qemu_ram_alloc(NULL, "collie.fl1", 0x02000000); + memory_region_init_rom_device(&phys_flash[0], &pflash_cfi01_ops_le, + NULL, "collie.fl1", 0x02000000); dinfo = drive_get(IF_PFLASH, 0, 0); - pflash_cfi01_register(SA_CS0, phys_flash, + pflash_cfi01_register(SA_CS0, &phys_flash[0], dinfo ? dinfo->bdrv : NULL, (64 * 1024), - 512, 4, 0x00, 0x00, 0x00, 0x00, 0); + 512, 4, 0x00, 0x00, 0x00, 0x00); - phys_flash = qemu_ram_alloc(NULL, "collie.fl2", 0x02000000); + memory_region_init_rom_device(&phys_flash[1], &pflash_cfi01_ops_le, + NULL, "collie.fl2", 0x02000000); dinfo = drive_get(IF_PFLASH, 0, 1); - pflash_cfi01_register(SA_CS1, phys_flash, + pflash_cfi01_register(SA_CS1, &phys_flash[1], dinfo ? dinfo->bdrv : NULL, (64 * 1024), - 512, 4, 0x00, 0x00, 0x00, 0x00, 0); + 512, 4, 0x00, 0x00, 0x00, 0x00); sysbus_create_simple("scoop", 0x40800000, NULL); |