diff options
author | Avi Kivity <avi@redhat.com> | 2011-08-04 15:55:30 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-09-04 17:46:51 +0300 |
commit | cfe5f011042456ad6ebd815f5ce4177befedd79a (patch) | |
tree | 9f5620f326451109ea9f43d27a8eb98d1f24541a /hw/lm32_boards.c | |
parent | ccbecf6237db9eed57923b961d48a75c77c7aebd (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.
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 <avi@redhat.com>
Diffstat (limited to 'hw/lm32_boards.c')
-rw-r--r-- | hw/lm32_boards.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/lm32_boards.c b/hw/lm32_boards.c index d18aad7435..e4acac1740 100644 --- a/hw/lm32_boards.c +++ b/hw/lm32_boards.c @@ -77,7 +77,6 @@ static void lm32_evr_init(ram_addr_t ram_size_not_used, CPUState *env; DriveInfo *dinfo; ram_addr_t phys_ram; - ram_addr_t phys_flash; qemu_irq *cpu_irq, irq[32]; ResetInfo *reset_info; int i; @@ -108,10 +107,9 @@ static void lm32_evr_init(ram_addr_t ram_size_not_used, phys_ram = qemu_ram_alloc(NULL, "lm32_evr.sdram", ram_size); cpu_register_physical_memory(ram_base, ram_size, phys_ram | IO_MEM_RAM); - phys_flash = qemu_ram_alloc(NULL, "lm32_evr.flash", flash_size); dinfo = drive_get(IF_PFLASH, 0, 0); /* Spansion S29NS128P */ - pflash_cfi02_register(flash_base, phys_flash, + pflash_cfi02_register(flash_base, NULL, "lm32_evr.flash", flash_size, dinfo ? dinfo->bdrv : NULL, flash_sector_size, flash_size / flash_sector_size, 1, 2, 0x01, 0x7e, 0x43, 0x00, 0x555, 0x2aa, 1); @@ -165,7 +163,6 @@ static void lm32_uclinux_init(ram_addr_t ram_size_not_used, CPUState *env; DriveInfo *dinfo; ram_addr_t phys_ram; - ram_addr_t phys_flash; qemu_irq *cpu_irq, irq[32]; HWSetup *hw; ResetInfo *reset_info; @@ -203,10 +200,9 @@ static void lm32_uclinux_init(ram_addr_t ram_size_not_used, phys_ram = qemu_ram_alloc(NULL, "lm32_uclinux.sdram", ram_size); cpu_register_physical_memory(ram_base, ram_size, phys_ram | IO_MEM_RAM); - phys_flash = qemu_ram_alloc(NULL, "lm32_uclinux.flash", flash_size); dinfo = drive_get(IF_PFLASH, 0, 0); /* Spansion S29NS128P */ - pflash_cfi02_register(flash_base, phys_flash, + pflash_cfi02_register(flash_base, NULL, "lm32_uclinux.flash", flash_size, dinfo ? dinfo->bdrv : NULL, flash_sector_size, flash_size / flash_sector_size, 1, 2, 0x01, 0x7e, 0x43, 0x00, 0x555, 0x2aa, 1); |