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/milkymist.c | |
parent | a1807ef2954d3ddbf9a9bca3949bd0c69fd45a0e (diff) |
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/milkymist.c')
-rw-r--r-- | hw/milkymist.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/milkymist.c b/hw/milkymist.c index 93288c8401..092d8b072b 100644 --- a/hw/milkymist.c +++ b/hw/milkymist.c @@ -82,7 +82,7 @@ milkymist_init(ram_addr_t ram_size_not_used, int kernel_size; DriveInfo *dinfo; ram_addr_t phys_sdram; - ram_addr_t phys_flash; + MemoryRegion *phys_flash = g_new(MemoryRegion, 1); qemu_irq irq[32], *cpu_irq; int i; char *bios_filename; @@ -113,13 +113,14 @@ milkymist_init(ram_addr_t ram_size_not_used, cpu_register_physical_memory(sdram_base, sdram_size, phys_sdram | IO_MEM_RAM); - phys_flash = qemu_ram_alloc(NULL, "milkymist.flash", flash_size); + memory_region_init_rom_device(phys_flash, &pflash_cfi01_ops_be, + NULL, "milkymist.flash", flash_size); dinfo = drive_get(IF_PFLASH, 0, 0); /* Numonyx JS28F256J3F105 */ pflash_cfi01_register(flash_base, phys_flash, dinfo ? dinfo->bdrv : NULL, flash_sector_size, flash_size / flash_sector_size, 2, - 0x00, 0x89, 0x00, 0x1d, 1); + 0x00, 0x89, 0x00, 0x1d); /* create irq lines */ cpu_irq = qemu_allocate_irqs(cpu_irq_handler, env, 1); |