diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-09 20:05:49 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-09 20:05:49 +0000 |
commit | dcac9679febc944f79e82fb9970ad83154de22ac (patch) | |
tree | f3802d48847ce3aef1f9cc6552baeeeb07dd77b2 /hw/mips_jazz.c | |
parent | f78630ab2f4b15d493fa921bb43ddcec4119f6d3 (diff) |
Use load_image_targphys and avoid phys_ram_base.
Signed-off-by: Paul Brook <paul@codesourcery.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7056 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mips_jazz.c')
-rw-r--r-- | hw/mips_jazz.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c index 74755178ba..907e8114bb 100644 --- a/hw/mips_jazz.c +++ b/hw/mips_jazz.c @@ -129,7 +129,6 @@ void mips_jazz_init (ram_addr_t ram_size, int vga_ram_size, enum jazz_model_e jazz_model) { char buf[1024]; - unsigned long bios_offset; int bios_size, n; CPUState *env; qemu_irq *rc4030, *i8259; @@ -141,6 +140,9 @@ void mips_jazz_init (ram_addr_t ram_size, int vga_ram_size, PITState *pit; BlockDriverState *fds[MAX_FD]; qemu_irq esp_reset; + ram_addr_t ram_offset; + ram_addr_t bios_offset; + ram_addr_t vga_ram_offset; /* init CPUs */ if (cpu_model == NULL) { @@ -159,25 +161,27 @@ void mips_jazz_init (ram_addr_t ram_size, int vga_ram_size, qemu_register_reset(main_cpu_reset, env); /* allocate RAM */ - cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); + ram_offset = qemu_ram_alloc(ram_size); + cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM); + + vga_ram_offset = qemu_ram_alloc(vga_ram_size); + bios_offset = qemu_ram_alloc(MAGNUM_BIOS_SIZE); + cpu_register_physical_memory(0x1fc00000LL, + MAGNUM_BIOS_SIZE, bios_offset | IO_MEM_ROM); + cpu_register_physical_memory(0xfff00000LL, + MAGNUM_BIOS_SIZE, bios_offset | IO_MEM_ROM); /* load the BIOS image. */ - bios_offset = ram_size + vga_ram_size; if (bios_name == NULL) bios_name = BIOS_FILENAME; snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name); - bios_size = load_image(buf, phys_ram_base + bios_offset); + bios_size = load_image_targphys(buf, 0xfff00000LL, MAGNUM_BIOS_SIZE); if (bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) { fprintf(stderr, "qemu: Could not load MIPS bios '%s'\n", buf); exit(1); } - cpu_register_physical_memory(0x1fc00000LL, - MAGNUM_BIOS_SIZE, bios_offset | IO_MEM_ROM); - cpu_register_physical_memory(0xfff00000LL, - MAGNUM_BIOS_SIZE, bios_offset | IO_MEM_ROM); - /* Init CPU internal devices */ cpu_mips_irq_init_cpu(env); cpu_mips_clock_init(env); @@ -201,11 +205,11 @@ void mips_jazz_init (ram_addr_t ram_size, int vga_ram_size, /* Video card */ switch (jazz_model) { case JAZZ_MAGNUM: - g364fb_mm_init(phys_ram_base + ram_size, ram_size, vga_ram_size, + g364fb_mm_init(phys_ram_base + vga_ram_offset, ram_size, vga_ram_size, 0x40000000, 0x60000000, 0, rc4030[3]); break; case JAZZ_PICA61: - isa_vga_mm_init(phys_ram_base + ram_size, ram_size, vga_ram_size, + isa_vga_mm_init(phys_ram_base + vga_ram_offset, ram_size, vga_ram_size, 0x40000000, 0x60000000, 0); break; default: |