summaryrefslogtreecommitdiff
path: root/hw/petalogix_s3adsp1800_mmu.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-08-04 15:55:30 +0300
committerAvi Kivity <avi@redhat.com>2011-08-25 10:56:33 +0300
commitc8a50e596c8eeb41bf5718df5bad6be4080f40c7 (patch)
tree589bfb006ec42863a518debd4775d88a3abfe185 /hw/petalogix_s3adsp1800_mmu.c
parenta1807ef2954d3ddbf9a9bca3949bd0c69fd45a0e (diff)
downloadqemu-c8a50e596c8eeb41bf5718df5bad6be4080f40c7.tar.gz
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/petalogix_s3adsp1800_mmu.c')
-rw-r--r--hw/petalogix_s3adsp1800_mmu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c
index a43fb4c95c..14817452c6 100644
--- a/hw/petalogix_s3adsp1800_mmu.c
+++ b/hw/petalogix_s3adsp1800_mmu.c
@@ -127,7 +127,7 @@ petalogix_s3adsp1800_init(ram_addr_t ram_size,
target_phys_addr_t ddr_base = 0x90000000;
ram_addr_t phys_lmb_bram;
ram_addr_t phys_ram;
- ram_addr_t phys_flash;
+ MemoryRegion *phys_flash = g_new(MemoryRegion, 1);
qemu_irq irq[32], *cpu_irq;
/* init CPUs */
@@ -148,12 +148,14 @@ petalogix_s3adsp1800_init(ram_addr_t ram_size,
phys_ram = qemu_ram_alloc(NULL, "petalogix_s3adsp1800.ram", ram_size);
cpu_register_physical_memory(ddr_base, ram_size, phys_ram | IO_MEM_RAM);
- phys_flash = qemu_ram_alloc(NULL, "petalogix_s3adsp1800.flash", FLASH_SIZE);
+ memory_region_init_rom_device(phys_flash, &pflash_cfi01_ops_be,
+ NULL, "petalogix_s3adsp1800.flash",
+ FLASH_SIZE);
dinfo = drive_get(IF_PFLASH, 0, 0);
pflash_cfi01_register(0xa0000000, phys_flash,
dinfo ? dinfo->bdrv : NULL, (64 * 1024),
FLASH_SIZE >> 16,
- 1, 0x89, 0x18, 0x0000, 0x0, 1);
+ 1, 0x89, 0x18, 0x0000, 0x0);
cpu_irq = microblaze_pic_init_cpu(env);
dev = xilinx_intc_create(0x81800000, cpu_irq[0], 2);