axis_dev88: convert to memory API (RAM only)

Reviewed-by: Richard Henderson  <rth@twiddle.net>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Avi Kivity 2011-07-25 14:32:34 +03:00
parent fbe15adf8e
commit 5461eb2111
1 changed files with 8 additions and 8 deletions

View File

@ -31,6 +31,7 @@
#include "elf.h" #include "elf.h"
#include "cris-boot.h" #include "cris-boot.h"
#include "blockdev.h" #include "blockdev.h"
#include "exec-memory.h"
#define D(x) #define D(x)
#define DNAND(x) #define DNAND(x)
@ -259,8 +260,9 @@ void axisdev88_init (ram_addr_t ram_size,
int i; int i;
int nand_regs; int nand_regs;
int gpio_regs; int gpio_regs;
ram_addr_t phys_ram; MemoryRegion *address_space_mem = get_system_memory();
ram_addr_t phys_intmem; MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
MemoryRegion *phys_intmem = g_new(MemoryRegion, 1);
/* init CPUs */ /* init CPUs */
if (cpu_model == NULL) { if (cpu_model == NULL) {
@ -269,15 +271,13 @@ void axisdev88_init (ram_addr_t ram_size,
env = cpu_init(cpu_model); env = cpu_init(cpu_model);
/* allocate RAM */ /* allocate RAM */
phys_ram = qemu_ram_alloc(NULL, "axisdev88.ram", ram_size); memory_region_init_ram(phys_ram, NULL, "axisdev88.ram", ram_size);
cpu_register_physical_memory(0x40000000, ram_size, phys_ram | IO_MEM_RAM); memory_region_add_subregion(address_space_mem, 0x40000000, phys_ram);
/* The ETRAX-FS has 128Kb on chip ram, the docs refer to it as the /* The ETRAX-FS has 128Kb on chip ram, the docs refer to it as the
internal memory. */ internal memory. */
phys_intmem = qemu_ram_alloc(NULL, "axisdev88.chipram", INTMEM_SIZE); memory_region_init_ram(phys_intmem, NULL, "axisdev88.chipram", INTMEM_SIZE);
cpu_register_physical_memory(0x38000000, INTMEM_SIZE, memory_region_add_subregion(address_space_mem, 0x38000000, phys_intmem);
phys_intmem | IO_MEM_RAM);
/* Attach a NAND flash to CS1. */ /* Attach a NAND flash to CS1. */
nand = drive_get(IF_MTD, 0, 0); nand = drive_get(IF_MTD, 0, 0);