diff options
Diffstat (limited to 'hw/gumstix.c')
-rw-r--r-- | hw/gumstix.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/hw/gumstix.c b/hw/gumstix.c index d3a4bb4c67..853f7e1ee8 100644 --- a/hw/gumstix.c +++ b/hw/gumstix.c @@ -48,8 +48,7 @@ static void connex_init(ram_addr_t ram_size, { PXA2xxState *cpu; DriveInfo *dinfo; - const MemoryRegionOps *flash_ops; - MemoryRegion *flash = g_new(MemoryRegion, 1); + int be; uint32_t connex_rom = 0x01000000; uint32_t connex_ram = 0x04000000; @@ -64,15 +63,14 @@ static void connex_init(ram_addr_t ram_size, } #ifdef TARGET_WORDS_BIGENDIAN - flash_ops = &pflash_cfi01_ops_be; + be = 1; #else - flash_ops = &pflash_cfi01_ops_le; + be = 0; #endif - memory_region_init_rom_device(flash, flash_ops, - NULL, "connext.rom", connex_rom); - if (!pflash_cfi01_register(0x00000000, flash, + if (!pflash_cfi01_register(0x00000000, qemu_ram_alloc(NULL, "connext.rom", + connex_rom), dinfo->bdrv, sector_len, connex_rom / sector_len, - 2, 0, 0, 0, 0)) { + 2, 0, 0, 0, 0, be)) { fprintf(stderr, "qemu: Error registering flash memory.\n"); exit(1); } @@ -89,8 +87,7 @@ static void verdex_init(ram_addr_t ram_size, { PXA2xxState *cpu; DriveInfo *dinfo; - MemoryRegion *flash = g_new(MemoryRegion, 1); - const MemoryRegionOps *flash_ops; + int be; uint32_t verdex_rom = 0x02000000; uint32_t verdex_ram = 0x10000000; @@ -105,15 +102,14 @@ static void verdex_init(ram_addr_t ram_size, } #ifdef TARGET_WORDS_BIGENDIAN - flash_ops = &pflash_cfi01_ops_be; + be = 1; #else - flash_ops = &pflash_cfi01_ops_le; + be = 0; #endif - memory_region_init_rom_device(flash, flash_ops, - NULL, "verdex.rom", verdex_rom); - if (!pflash_cfi01_register(0x00000000, flash, + if (!pflash_cfi01_register(0x00000000, qemu_ram_alloc(NULL, "verdex.rom", + verdex_rom), dinfo->bdrv, sector_len, verdex_rom / sector_len, - 2, 0, 0, 0, 0)) { + 2, 0, 0, 0, 0, be)) { fprintf(stderr, "qemu: Error registering flash memory.\n"); exit(1); } |