From cfe5f011042456ad6ebd815f5ce4177befedd79a Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 4 Aug 2011 15:55:30 +0300 Subject: 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. In order to get the correct opaque into the MemoryRegion object, the allocation scheme is changed so that the flash emulation code allocates memory, instead of the caller. This clears a FIXME in the flash code. Signed-off-by: Avi Kivity --- hw/mainstone.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hw/mainstone.c') diff --git a/hw/mainstone.c b/hw/mainstone.c index 4792f0e..c0524d7 100644 --- a/hw/mainstone.c +++ b/hw/mainstone.c @@ -126,10 +126,9 @@ static void mainstone_common_init(ram_addr_t ram_size, exit(1); } - if (!pflash_cfi01_register(mainstone_flash_base[i], - qemu_ram_alloc(NULL, i ? "mainstone.flash1" : - "mainstone.flash0", - MAINSTONE_FLASH), + if (!pflash_cfi01_register(mainstone_flash_base[i], NULL, + i ? "mainstone.flash1" : "mainstone.flash0", + MAINSTONE_FLASH, dinfo->bdrv, sector_len, MAINSTONE_FLASH / sector_len, 4, 0, 0, 0, 0, be)) { -- cgit v1.1