mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
RAM usage information in machine definition.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4246 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
@@ -2093,7 +2093,7 @@ uint32_t cpu_get_physical_page_desc(target_phys_addr_t addr)
|
||||
ram_addr_t qemu_ram_alloc(unsigned int size)
|
||||
{
|
||||
ram_addr_t addr;
|
||||
if ((phys_ram_alloc_offset + size) >= phys_ram_size) {
|
||||
if ((phys_ram_alloc_offset + size) > phys_ram_size) {
|
||||
fprintf(stderr, "Not enough memory (requested_size = %u, max memory = %d)\n",
|
||||
size, phys_ram_size);
|
||||
abort();
|
||||
|
||||
@@ -91,4 +91,5 @@ QEMUMachine an5206_machine = {
|
||||
"an5206",
|
||||
"Arnewsh 5206",
|
||||
an5206_init,
|
||||
512,
|
||||
};
|
||||
|
||||
@@ -14,6 +14,8 @@ typedef struct QEMUMachine {
|
||||
const char *name;
|
||||
const char *desc;
|
||||
QEMUMachineInitFunc *init;
|
||||
#define RAMSIZE_FIXED (1 << 0)
|
||||
size_t ram_require;
|
||||
struct QEMUMachine *next;
|
||||
} QEMUMachine;
|
||||
|
||||
|
||||
@@ -124,4 +124,5 @@ QEMUMachine bareetraxfs_machine = {
|
||||
"bareetraxfs",
|
||||
"Bare ETRAX FS board",
|
||||
bareetraxfs_init,
|
||||
0x800000,
|
||||
};
|
||||
|
||||
@@ -125,10 +125,12 @@ QEMUMachine connex_machine = {
|
||||
"connex",
|
||||
"Gumstix Connex (PXA255)",
|
||||
connex_init,
|
||||
(0x05000000 + PXA2XX_INTERNAL_SIZE) | RAMSIZE_FIXED,
|
||||
};
|
||||
|
||||
QEMUMachine verdex_machine = {
|
||||
"verdex",
|
||||
"Gumstix Verdex (PXA270)",
|
||||
verdex_init,
|
||||
(0x12000000 + PXA2XX_INTERNAL_SIZE) | RAMSIZE_FIXED,
|
||||
};
|
||||
|
||||
+8
-7
@@ -231,7 +231,7 @@ static CPUWriteMemoryFunc *integratorcm_writefn[] = {
|
||||
integratorcm_write
|
||||
};
|
||||
|
||||
static void integratorcm_init(int memsz, uint32_t flash_offset)
|
||||
static void integratorcm_init(int memsz)
|
||||
{
|
||||
int iomemtype;
|
||||
integratorcm_state *s;
|
||||
@@ -258,7 +258,7 @@ static void integratorcm_init(int memsz, uint32_t flash_offset)
|
||||
}
|
||||
memcpy(integrator_spd + 73, "QEMU-MEMORY", 11);
|
||||
s->cm_init = 0x00000112;
|
||||
s->flash_offset = flash_offset;
|
||||
s->flash_offset = qemu_ram_alloc(0x100000);
|
||||
|
||||
iomemtype = cpu_register_io_memory(0, integratorcm_readfn,
|
||||
integratorcm_writefn, s);
|
||||
@@ -480,7 +480,7 @@ static void integratorcp_init(int ram_size, int vga_ram_size,
|
||||
const char *initrd_filename, const char *cpu_model)
|
||||
{
|
||||
CPUState *env;
|
||||
uint32_t bios_offset;
|
||||
uint32_t ram_offset;
|
||||
qemu_irq *pic;
|
||||
qemu_irq *cpu_pic;
|
||||
int sd;
|
||||
@@ -492,15 +492,15 @@ static void integratorcp_init(int ram_size, int vga_ram_size,
|
||||
fprintf(stderr, "Unable to find CPU definition\n");
|
||||
exit(1);
|
||||
}
|
||||
bios_offset = ram_size + vga_ram_size;
|
||||
ram_offset = qemu_ram_alloc(ram_size);
|
||||
/* ??? On a real system the first 1Mb is mapped as SSRAM or boot flash. */
|
||||
/* ??? RAM shoud repeat to fill physical memory space. */
|
||||
/* SDRAM at address zero*/
|
||||
cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
|
||||
cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM);
|
||||
/* And again at address 0x80000000 */
|
||||
cpu_register_physical_memory(0x80000000, ram_size, IO_MEM_RAM);
|
||||
cpu_register_physical_memory(0x80000000, ram_size, ram_offset | IO_MEM_RAM);
|
||||
|
||||
integratorcm_init(ram_size >> 20, bios_offset);
|
||||
integratorcm_init(ram_size >> 20);
|
||||
cpu_pic = arm_pic_init_cpu(env);
|
||||
pic = icp_pic_init(0x14000000, cpu_pic[ARM_PIC_CPU_IRQ],
|
||||
cpu_pic[ARM_PIC_CPU_FIQ]);
|
||||
@@ -543,4 +543,5 @@ QEMUMachine integratorcp_machine = {
|
||||
"integratorcp",
|
||||
"ARM Integrator/CP (ARM926EJ-S)",
|
||||
integratorcp_init,
|
||||
0x100000,
|
||||
};
|
||||
|
||||
+13
-10
@@ -59,6 +59,10 @@ static struct keymap map[0xE0] = {
|
||||
|
||||
enum mainstone_model_e { mainstone };
|
||||
|
||||
#define MAINSTONE_RAM 0x04000000
|
||||
#define MAINSTONE_ROM 0x00800000
|
||||
#define MAINSTONE_FLASH 0x02000000
|
||||
|
||||
static struct arm_boot_info mainstone_binfo = {
|
||||
.loader_start = PXA2XX_SDRAM_BASE,
|
||||
.ram_size = 0x04000000,
|
||||
@@ -69,9 +73,6 @@ static void mainstone_common_init(int ram_size, int vga_ram_size,
|
||||
const char *kernel_cmdline, const char *initrd_filename,
|
||||
const char *cpu_model, enum mainstone_model_e model, int arm_id)
|
||||
{
|
||||
uint32_t mainstone_ram = mainstone_binfo.ram_size;
|
||||
uint32_t mainstone_rom = 0x00800000;
|
||||
uint32_t mainstone_flash = 0x02000000;
|
||||
uint32_t sector_len = 256 * 1024;
|
||||
target_phys_addr_t mainstone_flash_base[] = { MST_FLASH_0, MST_FLASH_1 };
|
||||
struct pxa2xx_state_s *cpu;
|
||||
@@ -82,17 +83,17 @@ static void mainstone_common_init(int ram_size, int vga_ram_size,
|
||||
cpu_model = "pxa270-c5";
|
||||
|
||||
/* Setup CPU & memory */
|
||||
if (ram_size < mainstone_ram + mainstone_rom + 2 * mainstone_flash +
|
||||
if (ram_size < MAINSTONE_RAM + MAINSTONE_ROM + 2 * MAINSTONE_FLASH +
|
||||
PXA2XX_INTERNAL_SIZE) {
|
||||
fprintf(stderr, "This platform requires %i bytes of memory\n",
|
||||
mainstone_ram + mainstone_rom + 2 * mainstone_flash +
|
||||
MAINSTONE_RAM + MAINSTONE_ROM + 2 * MAINSTONE_FLASH +
|
||||
PXA2XX_INTERNAL_SIZE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cpu = pxa270_init(mainstone_ram, ds, cpu_model);
|
||||
cpu_register_physical_memory(0, mainstone_rom,
|
||||
qemu_ram_alloc(mainstone_rom) | IO_MEM_ROM);
|
||||
cpu = pxa270_init(mainstone_binfo.ram_size, ds, cpu_model);
|
||||
cpu_register_physical_memory(0, MAINSTONE_ROM,
|
||||
qemu_ram_alloc(MAINSTONE_ROM) | IO_MEM_ROM);
|
||||
|
||||
/* Setup initial (reset) machine state */
|
||||
cpu->env->regs[15] = mainstone_binfo.loader_start;
|
||||
@@ -107,9 +108,9 @@ static void mainstone_common_init(int ram_size, int vga_ram_size,
|
||||
}
|
||||
|
||||
if (!pflash_cfi01_register(mainstone_flash_base[i],
|
||||
qemu_ram_alloc(mainstone_flash),
|
||||
qemu_ram_alloc(MAINSTONE_FLASH),
|
||||
drives_table[index].bdrv, sector_len,
|
||||
mainstone_flash / sector_len, 4, 0, 0, 0, 0)) {
|
||||
MAINSTONE_FLASH / sector_len, 4, 0, 0, 0, 0)) {
|
||||
fprintf(stderr, "qemu: Error registering flash memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -146,4 +147,6 @@ QEMUMachine mainstone2_machine = {
|
||||
"mainstone",
|
||||
"Mainstone II (PXA27x)",
|
||||
mainstone_init,
|
||||
(MAINSTONE_RAM + MAINSTONE_ROM + 2 * MAINSTONE_FLASH +
|
||||
PXA2XX_INTERNAL_SIZE) | RAMSIZE_FIXED,
|
||||
};
|
||||
|
||||
@@ -308,4 +308,5 @@ QEMUMachine mcf5208evb_machine = {
|
||||
"mcf5208evb",
|
||||
"MCF5206EVB",
|
||||
mcf5208evb_init,
|
||||
16384,
|
||||
};
|
||||
|
||||
@@ -277,10 +277,12 @@ QEMUMachine mips_magnum_machine = {
|
||||
"magnum",
|
||||
"MIPS Magnum",
|
||||
mips_magnum_init,
|
||||
MAGNUM_BIOS_SIZE + VGA_RAM_SIZE,
|
||||
};
|
||||
|
||||
QEMUMachine mips_pica61_machine = {
|
||||
"pica61",
|
||||
"Acer Pica 61",
|
||||
mips_pica61_init,
|
||||
MAGNUM_BIOS_SIZE + VGA_RAM_SIZE,
|
||||
};
|
||||
|
||||
@@ -949,4 +949,5 @@ QEMUMachine mips_malta_machine = {
|
||||
"malta",
|
||||
"MIPS Malta Core LV",
|
||||
mips_malta_init,
|
||||
VGA_RAM_SIZE + BIOS_SIZE,
|
||||
};
|
||||
|
||||
@@ -195,4 +195,5 @@ QEMUMachine mips_mipssim_machine = {
|
||||
"mipssim",
|
||||
"MIPS MIPSsim platform",
|
||||
mips_mipssim_init,
|
||||
BIOS_SIZE + VGA_RAM_SIZE /* unused */,
|
||||
};
|
||||
|
||||
@@ -286,4 +286,5 @@ QEMUMachine mips_machine = {
|
||||
"mips",
|
||||
"mips r4k platform",
|
||||
mips_r4k_init,
|
||||
VGA_RAM_SIZE + BIOS_SIZE,
|
||||
};
|
||||
|
||||
@@ -941,4 +941,5 @@ QEMUMachine n800_machine = {
|
||||
"n800",
|
||||
"Nokia N800 aka. RX-34 tablet (OMAP2420)",
|
||||
n800_init,
|
||||
(0x08000000 + 0x00010000 + OMAP242X_SRAM_SIZE) | RAMSIZE_FIXED,
|
||||
};
|
||||
|
||||
@@ -274,4 +274,5 @@ QEMUMachine palmte_machine = {
|
||||
"cheetah",
|
||||
"Palm Tungsten|E aka. Cheetah PDA (OMAP310)",
|
||||
palmte_init,
|
||||
(0x02000000 + 0x00800000 + OMAP15XX_SRAM_SIZE) | RAMSIZE_FIXED,
|
||||
};
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
#define VGABIOS_FILENAME "vgabios.bin"
|
||||
#define VGABIOS_CIRRUS_FILENAME "vgabios-cirrus.bin"
|
||||
|
||||
#define PC_MAX_BIOS_SIZE (4 * 1024 * 1024)
|
||||
|
||||
/* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables. */
|
||||
#define ACPI_DATA_SIZE 0x10000
|
||||
|
||||
@@ -1018,10 +1020,12 @@ QEMUMachine pc_machine = {
|
||||
"pc",
|
||||
"Standard PC",
|
||||
pc_init_pci,
|
||||
VGA_RAM_SIZE + PC_MAX_BIOS_SIZE,
|
||||
};
|
||||
|
||||
QEMUMachine isapc_machine = {
|
||||
"isapc",
|
||||
"ISA-only PC",
|
||||
pc_init_isa,
|
||||
VGA_RAM_SIZE + PC_MAX_BIOS_SIZE,
|
||||
};
|
||||
|
||||
@@ -360,6 +360,7 @@ QEMUMachine ref405ep_machine = {
|
||||
"ref405ep",
|
||||
"ref405ep",
|
||||
ref405ep_init,
|
||||
(128 * 1024 * 1024 + 4096 + 512 * 1024 + BIOS_SIZE) | RAMSIZE_FIXED,
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -642,4 +643,5 @@ QEMUMachine taihu_machine = {
|
||||
"taihu",
|
||||
"taihu",
|
||||
taihu_405ep_init,
|
||||
(128 * 1024 * 1024 + 4096 + BIOS_SIZE + 32 * 1024 * 1024) | RAMSIZE_FIXED,
|
||||
};
|
||||
|
||||
@@ -335,4 +335,5 @@ QEMUMachine core99_machine = {
|
||||
"mac99",
|
||||
"Mac99 based PowerMAC",
|
||||
ppc_core99_init,
|
||||
BIOS_SIZE + VGA_RAM_SIZE,
|
||||
};
|
||||
|
||||
@@ -370,4 +370,5 @@ QEMUMachine heathrow_machine = {
|
||||
"g3bw",
|
||||
"Heathrow based PowerMAC",
|
||||
ppc_heathrow_init,
|
||||
BIOS_SIZE + VGA_RAM_SIZE,
|
||||
};
|
||||
|
||||
@@ -764,4 +764,5 @@ QEMUMachine prep_machine = {
|
||||
"prep",
|
||||
"PowerPC PREP platform",
|
||||
ppc_prep_init,
|
||||
BIOS_SIZE + VGA_RAM_SIZE,
|
||||
};
|
||||
|
||||
@@ -69,5 +69,6 @@ static void r2d_init(int ram_size, int vga_ram_size,
|
||||
QEMUMachine r2d_machine = {
|
||||
"r2d",
|
||||
"r2d-plus board",
|
||||
r2d_init
|
||||
r2d_init,
|
||||
SDRAM_SIZE | RAMSIZE_FIXED
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user