summaryrefslogtreecommitdiff
path: root/hw/z2.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-25 14:39:18 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-25 14:39:18 -0500
commitc072937128956e0a24d60087b23985eed9b7e000 (patch)
tree30dbbf868845acd99099c7165769f1762fa40e28 /hw/z2.c
parent0cb13d491b839af4ffbd9052299d2433dc27f201 (diff)
downloadqemu-c072937128956e0a24d60087b23985eed9b7e000.tar.gz
qemu-c072937128956e0a24d60087b23985eed9b7e000.tar.bz2
qemu-c072937128956e0a24d60087b23985eed9b7e000.zip
Revert "Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging"
This reverts commit 8ef9ea85a2cc1007eaefa53e6871f1f83bcef22d, reversing changes made to 444dc48298c480e42e15a8fe676be737d8a6b2a1. From Avi: Please revert the entire pull (git revert 8ef9ea85a2cc1) while I work this out - it isn't trivial. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/z2.c')
-rw-r--r--hw/z2.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/hw/z2.c b/hw/z2.c
index d7b8d5327b..f93a1bf0fe 100644
--- a/hw/z2.c
+++ b/hw/z2.c
@@ -280,11 +280,10 @@ static void z2_init(ram_addr_t ram_size,
uint32_t sector_len = 0x10000;
PXA2xxState *cpu;
DriveInfo *dinfo;
- const MemoryRegionOps *flash_ops;
+ int be;
void *z2_lcd;
i2c_bus *bus;
DeviceState *wm;
- MemoryRegion *flash = g_new(MemoryRegion, 1);
if (!cpu_model) {
cpu_model = "pxa270-c5";
@@ -294,9 +293,9 @@ static void z2_init(ram_addr_t ram_size,
cpu = pxa270_init(z2_binfo.ram_size, cpu_model);
#ifdef TARGET_WORDS_BIGENDIAN
- flash_ops = &pflash_cfi01_ops_be;
+ be = 1;
#else
- flash_ops = &pflash_cfi01_ops_le;
+ be = 0;
#endif
dinfo = drive_get(IF_PFLASH, 0, 0);
if (!dinfo) {
@@ -305,11 +304,11 @@ static void z2_init(ram_addr_t ram_size,
exit(1);
}
- memory_region_init_rom_device(flash, flash_ops,
- NULL, "z2.flash0", Z2_FLASH_SIZE);
- if (!pflash_cfi01_register(Z2_FLASH_BASE, flash,
+ if (!pflash_cfi01_register(Z2_FLASH_BASE,
+ qemu_ram_alloc(NULL, "z2.flash0", Z2_FLASH_SIZE),
dinfo->bdrv, sector_len,
- Z2_FLASH_SIZE / sector_len, 4, 0, 0, 0, 0)) {
+ Z2_FLASH_SIZE / sector_len, 4, 0, 0, 0, 0,
+ be)) {
fprintf(stderr, "qemu: Error registering flash memory.\n");
exit(1);
}