Revision 72e4d255 hw/an5206.c

b/hw/an5206.c
12 12
#include "boards.h"
13 13
#include "loader.h"
14 14
#include "elf.h"
15
#include "exec-memory.h"
15 16

  
16 17
#define KERNEL_LOAD_ADDR 0x10000
17 18
#define AN5206_MBAR_ADDR 0x10000000
......
37 38
    int kernel_size;
38 39
    uint64_t elf_entry;
39 40
    target_phys_addr_t entry;
41
    MemoryRegion *address_space_mem = get_system_memory();
42
    MemoryRegion *ram = g_new(MemoryRegion, 1);
43
    MemoryRegion *sram = g_new(MemoryRegion, 1);
40 44

  
41 45
    if (!cpu_model)
42 46
        cpu_model = "m5206";
......
52 56
    env->rambar0 = AN5206_RAMBAR_ADDR | 1;
53 57

  
54 58
    /* DRAM at address zero */
55
    cpu_register_physical_memory(0, ram_size,
56
        qemu_ram_alloc(NULL, "an5206.ram", ram_size) | IO_MEM_RAM);
59
    memory_region_init_ram(ram, NULL, "an5206.ram", ram_size);
60
    memory_region_add_subregion(address_space_mem, 0, ram);
57 61

  
58 62
    /* Internal SRAM.  */
59
    cpu_register_physical_memory(AN5206_RAMBAR_ADDR, 512,
60
        qemu_ram_alloc(NULL, "an5206.sram", 512) | IO_MEM_RAM);
63
    memory_region_init_ram(sram, NULL, "an5206.sram", 512);
64
    memory_region_add_subregion(address_space_mem, AN5206_RAMBAR_ADDR, sram);
61 65

  
62 66
    mcf5206_init(AN5206_MBAR_ADDR, env);
63 67

  

Also available in: Unified diff