aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc_prep.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-23 22:34:16 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-23 22:34:16 +0000
commita2a444d6e097d0890a47e83ca6cf7dab35d043e2 (patch)
tree72db3a6920ce91130f94045d8c723515d912387d /hw/ppc_prep.c
parent4b3686faeefab6279f6d395fcf56ea5405d040da (diff)
downloadqemu-a2a444d6e097d0890a47e83ca6cf7dab35d043e2.zip
qemu-a2a444d6e097d0890a47e83ca6cf7dab35d043e2.tar.gz
qemu-a2a444d6e097d0890a47e83ca6cf7dab35d043e2.tar.bz2
PowerPC merge
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@862 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ppc_prep.c')
-rw-r--r--hw/ppc_prep.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 0578399..4b50a178 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -937,18 +937,28 @@ void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
PPC_init_hw(/*env,*/ ram_size, KERNEL_LOAD_ADDR, ret,
KERNEL_STACK_ADDR, boot_device, initrd_filename);
} else {
+ int bios_ram_offset;
+
+#define BIOS_START 0x00800000
+
/* allocate ROM */
- // snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
- snprintf(buf, sizeof(buf), "%s", BIOS_FILENAME);
- printf("load BIOS at %p\n", phys_ram_base + 0x000f0000);
- ret = load_image(buf, phys_ram_base + 0x000f0000);
- if (ret != 0x10000) {
+ snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+ bios_ram_offset = ram_size + vga_ram_size;
+ printf("load BIOS at 0x%08x\n", BIOS_START);
+ ret = load_image(buf, phys_ram_base + bios_ram_offset);
+ if (ret != BIOS_SIZE) {
fprintf(stderr, "qemu: could not load PPC bios '%s' (%d)\n%m\n",
buf, ret);
exit(1);
}
+ global_env->nip = BIOS_START + BIOS_SIZE - 4;
+ cpu_register_physical_memory(BIOS_START, BIOS_SIZE,
+ IO_MEM_ROM | bios_ram_offset);
}
+ /* Register CPU as a 74x/75x */
+ cpu_ppc_register(cpu_single_env, 0x00080000);
+ /* Set time-base frequency to 100 Mhz */
cpu_ppc_tb_init(cpu_single_env, 100UL * 1000UL * 1000UL);
/* init basic PC hardware */