]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commitdiff
PowerPC 601 / 620 / 970 need a 1MB firmware.
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 29 Oct 2007 10:19:50 +0000 (10:19 +0000)
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 29 Oct 2007 10:19:50 +0000 (10:19 +0000)
This option is not allowed for PowerMac, as it would overlap with NVRAM.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3480 c046a42c-6fe2-441c-8c8c-71466251a162

hw/ppc_chrp.c
hw/ppc_oldworld.c
hw/ppc_prep.c
vl.h

index f71169e53a440ab696fc50be246c7ee418308a25..b97f99f8bddf72d717cc7896845308e23b4a79c7 100644 (file)
@@ -98,6 +98,13 @@ static void ppc_core99_init (int ram_size, int vga_ram_size, int boot_device,
         register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
         envs[i] = env;
     }
+    if (env->nip < 0xFFF80000) {
+        /* Special test for PowerPC 601:
+         * the boot vector is at 0xFFF00100, then we need a 1MB BIOS.
+         * But the NVRAM is located at 0xFFF04000...
+         */
+        cpu_abort(env, "Mac99 hardware can not handle 1 MB BIOS\n");
+    }
 
     /* allocate RAM */
     cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
@@ -113,6 +120,10 @@ static void ppc_core99_init (int ram_size, int vga_ram_size, int boot_device,
         exit(1);
     }
     bios_size = (bios_size + 0xfff) & ~0xfff;
+    if (bios_size > 0x00080000) {
+        /* As the NVRAM is located at 0xFFF04000, we cannot use 1 MB BIOSes */
+        cpu_abort(env, "Mac99 hardware can not handle 1 MB BIOS\n");
+    }
     cpu_register_physical_memory((uint32_t)(-bios_size),
                                  bios_size, bios_offset | IO_MEM_ROM);
 
index 1c25344a77f2f0e07fa69737e7b4674b9fef2c99..946ebd176baabe67c4fd0bf77b4ac0dbfd156b32 100644 (file)
@@ -135,6 +135,13 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size, int boot_device,
         register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
         envs[i] = env;
     }
+    if (env->nip < 0xFFF80000) {
+        /* Special test for PowerPC 601:
+         * the boot vector is at 0xFFF00100, then we need a 1MB BIOS.
+         * But the NVRAM is located at 0xFFF04000...
+         */
+        cpu_abort(env, "G3BW Mac hardware can not handle 1 MB BIOS\n");
+    }
 
     /* allocate RAM */
     cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
@@ -150,6 +157,10 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size, int boot_device,
         exit(1);
     }
     bios_size = (bios_size + 0xfff) & ~0xfff;
+    if (bios_size > 0x00080000) {
+        /* As the NVRAM is located at 0xFFF04000, we cannot use 1 MB BIOSes */
+        cpu_abort(env, "G3BW Mac hardware can not handle 1 MB BIOS\n");
+    }
     cpu_register_physical_memory((uint32_t)(-bios_size),
                                  bios_size, bios_offset | IO_MEM_ROM);
 
index 966617fe4115f40a272c63b7bca141aa6b1943bf..fc9fd910772a98fe520dc74b8984c3f1f397ea64 100644 (file)
@@ -574,6 +574,9 @@ static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device,
         cpu_abort(env, "qemu: could not load PPC PREP bios '%s'\n", buf);
         exit(1);
     }
+    if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
+        cpu_abort(env, "PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
+    }
     bios_size = (bios_size + 0xfff) & ~0xfff;
     cpu_register_physical_memory((uint32_t)(-bios_size),
                                  bios_size, bios_offset | IO_MEM_ROM);
diff --git a/vl.h b/vl.h
index 5a7f74fc33028743d621c982196da4fd1ccaf7b9..964d2eaa331b6f69e27ccd744b4f1b8ecc9edd28 100644 (file)
--- a/vl.h
+++ b/vl.h
@@ -197,7 +197,9 @@ extern unsigned int nb_prom_envs;
 
 /* XXX: make it dynamic */
 #define MAX_BIOS_SIZE (4 * 1024 * 1024)
-#if defined (TARGET_PPC) || defined (TARGET_SPARC64)
+#if defined (TARGET_PPC)
+#define BIOS_SIZE (1024 * 1024)
+#elif defined (TARGET_SPARC64)
 #define BIOS_SIZE ((512 + 32) * 1024)
 #elif defined(TARGET_MIPS)
 #define BIOS_SIZE (4 * 1024 * 1024)