mirror of https://github.com/xemu-project/xemu.git
mainstone: convert to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
88fa8031bd
commit
02e5c16757
|
@ -17,6 +17,7 @@
|
||||||
#include "flash.h"
|
#include "flash.h"
|
||||||
#include "blockdev.h"
|
#include "blockdev.h"
|
||||||
#include "sysbus.h"
|
#include "sysbus.h"
|
||||||
|
#include "exec-memory.h"
|
||||||
|
|
||||||
/* Device addresses */
|
/* Device addresses */
|
||||||
#define MST_FPGA_PHYS 0x08000000
|
#define MST_FPGA_PHYS 0x08000000
|
||||||
|
@ -90,7 +91,8 @@ static struct arm_boot_info mainstone_binfo = {
|
||||||
.ram_size = 0x04000000,
|
.ram_size = 0x04000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void mainstone_common_init(ram_addr_t ram_size,
|
static void mainstone_common_init(MemoryRegion *address_space_mem,
|
||||||
|
ram_addr_t ram_size,
|
||||||
const char *kernel_filename,
|
const char *kernel_filename,
|
||||||
const char *kernel_cmdline, const char *initrd_filename,
|
const char *kernel_cmdline, const char *initrd_filename,
|
||||||
const char *cpu_model, enum mainstone_model_e model, int arm_id)
|
const char *cpu_model, enum mainstone_model_e model, int arm_id)
|
||||||
|
@ -102,15 +104,16 @@ static void mainstone_common_init(ram_addr_t ram_size,
|
||||||
DriveInfo *dinfo;
|
DriveInfo *dinfo;
|
||||||
int i;
|
int i;
|
||||||
int be;
|
int be;
|
||||||
|
MemoryRegion *rom = g_new(MemoryRegion, 1);
|
||||||
|
|
||||||
if (!cpu_model)
|
if (!cpu_model)
|
||||||
cpu_model = "pxa270-c5";
|
cpu_model = "pxa270-c5";
|
||||||
|
|
||||||
/* Setup CPU & memory */
|
/* Setup CPU & memory */
|
||||||
cpu = pxa270_init(mainstone_binfo.ram_size, cpu_model);
|
cpu = pxa270_init(mainstone_binfo.ram_size, cpu_model);
|
||||||
cpu_register_physical_memory(0, MAINSTONE_ROM,
|
memory_region_init_ram(rom, NULL, "mainstone.rom", MAINSTONE_ROM);
|
||||||
qemu_ram_alloc(NULL, "mainstone.rom",
|
memory_region_set_readonly(rom, true);
|
||||||
MAINSTONE_ROM) | IO_MEM_ROM);
|
memory_region_add_subregion(address_space_mem, 0, rom);
|
||||||
|
|
||||||
#ifdef TARGET_WORDS_BIGENDIAN
|
#ifdef TARGET_WORDS_BIGENDIAN
|
||||||
be = 1;
|
be = 1;
|
||||||
|
@ -169,7 +172,7 @@ static void mainstone_init(ram_addr_t ram_size,
|
||||||
const char *kernel_filename, const char *kernel_cmdline,
|
const char *kernel_filename, const char *kernel_cmdline,
|
||||||
const char *initrd_filename, const char *cpu_model)
|
const char *initrd_filename, const char *cpu_model)
|
||||||
{
|
{
|
||||||
mainstone_common_init(ram_size, kernel_filename,
|
mainstone_common_init(get_system_memory(), ram_size, kernel_filename,
|
||||||
kernel_cmdline, initrd_filename, cpu_model, mainstone, 0x196);
|
kernel_cmdline, initrd_filename, cpu_model, mainstone, 0x196);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue