mirror of https://gitlab.com/qemu-project/qemu
petalogix_s2adsp1800: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
d7973c774c
commit
589f0aaddd
|
@ -35,6 +35,7 @@
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
#include "blockdev.h"
|
#include "blockdev.h"
|
||||||
|
#include "exec-memory.h"
|
||||||
|
|
||||||
#include "microblaze_pic_cpu.h"
|
#include "microblaze_pic_cpu.h"
|
||||||
|
|
||||||
|
@ -125,9 +126,10 @@ petalogix_s3adsp1800_init(ram_addr_t ram_size,
|
||||||
DriveInfo *dinfo;
|
DriveInfo *dinfo;
|
||||||
int i;
|
int i;
|
||||||
target_phys_addr_t ddr_base = 0x90000000;
|
target_phys_addr_t ddr_base = 0x90000000;
|
||||||
ram_addr_t phys_lmb_bram;
|
MemoryRegion *phys_lmb_bram = g_new(MemoryRegion, 1);
|
||||||
ram_addr_t phys_ram;
|
MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
|
||||||
qemu_irq irq[32], *cpu_irq;
|
qemu_irq irq[32], *cpu_irq;
|
||||||
|
MemoryRegion *sysmem = get_system_memory();
|
||||||
|
|
||||||
/* init CPUs */
|
/* init CPUs */
|
||||||
if (cpu_model == NULL) {
|
if (cpu_model == NULL) {
|
||||||
|
@ -139,13 +141,13 @@ petalogix_s3adsp1800_init(ram_addr_t ram_size,
|
||||||
qemu_register_reset(main_cpu_reset, env);
|
qemu_register_reset(main_cpu_reset, env);
|
||||||
|
|
||||||
/* Attach emulated BRAM through the LMB. */
|
/* Attach emulated BRAM through the LMB. */
|
||||||
phys_lmb_bram = qemu_ram_alloc(NULL, "petalogix_s3adsp1800.lmb_bram",
|
memory_region_init_ram(phys_lmb_bram, NULL,
|
||||||
LMB_BRAM_SIZE);
|
"petalogix_s3adsp1800.lmb_bram", LMB_BRAM_SIZE);
|
||||||
cpu_register_physical_memory(0x00000000, LMB_BRAM_SIZE,
|
memory_region_add_subregion(sysmem, 0x00000000, phys_lmb_bram);
|
||||||
phys_lmb_bram | IO_MEM_RAM);
|
|
||||||
|
|
||||||
phys_ram = qemu_ram_alloc(NULL, "petalogix_s3adsp1800.ram", ram_size);
|
memory_region_init_ram(phys_ram, NULL, "petalogix_s3adsp1800.ram",
|
||||||
cpu_register_physical_memory(ddr_base, ram_size, phys_ram | IO_MEM_RAM);
|
ram_size);
|
||||||
|
memory_region_add_subregion(sysmem, ddr_base, phys_ram);
|
||||||
|
|
||||||
dinfo = drive_get(IF_PFLASH, 0, 0);
|
dinfo = drive_get(IF_PFLASH, 0, 0);
|
||||||
pflash_cfi01_register(0xa0000000,
|
pflash_cfi01_register(0xa0000000,
|
||||||
|
|
Loading…
Reference in New Issue