Commit 4c823cff9e0a3a11d917869dfbc8ae94bff26bba
1 parent
d2123ead
PowerPC 601 / 620 / 970 need a 1MB firmware.
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
Showing
4 changed files
with
28 additions
and
1 deletions
hw/ppc_chrp.c
| @@ -98,6 +98,13 @@ static void ppc_core99_init (int ram_size, int vga_ram_size, int boot_device, | @@ -98,6 +98,13 @@ static void ppc_core99_init (int ram_size, int vga_ram_size, int boot_device, | ||
| 98 | register_savevm("cpu", 0, 3, cpu_save, cpu_load, env); | 98 | register_savevm("cpu", 0, 3, cpu_save, cpu_load, env); |
| 99 | envs[i] = env; | 99 | envs[i] = env; |
| 100 | } | 100 | } |
| 101 | + if (env->nip < 0xFFF80000) { | ||
| 102 | + /* Special test for PowerPC 601: | ||
| 103 | + * the boot vector is at 0xFFF00100, then we need a 1MB BIOS. | ||
| 104 | + * But the NVRAM is located at 0xFFF04000... | ||
| 105 | + */ | ||
| 106 | + cpu_abort(env, "Mac99 hardware can not handle 1 MB BIOS\n"); | ||
| 107 | + } | ||
| 101 | 108 | ||
| 102 | /* allocate RAM */ | 109 | /* allocate RAM */ |
| 103 | cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); | 110 | 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, | @@ -113,6 +120,10 @@ static void ppc_core99_init (int ram_size, int vga_ram_size, int boot_device, | ||
| 113 | exit(1); | 120 | exit(1); |
| 114 | } | 121 | } |
| 115 | bios_size = (bios_size + 0xfff) & ~0xfff; | 122 | bios_size = (bios_size + 0xfff) & ~0xfff; |
| 123 | + if (bios_size > 0x00080000) { | ||
| 124 | + /* As the NVRAM is located at 0xFFF04000, we cannot use 1 MB BIOSes */ | ||
| 125 | + cpu_abort(env, "Mac99 hardware can not handle 1 MB BIOS\n"); | ||
| 126 | + } | ||
| 116 | cpu_register_physical_memory((uint32_t)(-bios_size), | 127 | cpu_register_physical_memory((uint32_t)(-bios_size), |
| 117 | bios_size, bios_offset | IO_MEM_ROM); | 128 | bios_size, bios_offset | IO_MEM_ROM); |
| 118 | 129 |
hw/ppc_oldworld.c
| @@ -135,6 +135,13 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size, int boot_device, | @@ -135,6 +135,13 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size, int boot_device, | ||
| 135 | register_savevm("cpu", 0, 3, cpu_save, cpu_load, env); | 135 | register_savevm("cpu", 0, 3, cpu_save, cpu_load, env); |
| 136 | envs[i] = env; | 136 | envs[i] = env; |
| 137 | } | 137 | } |
| 138 | + if (env->nip < 0xFFF80000) { | ||
| 139 | + /* Special test for PowerPC 601: | ||
| 140 | + * the boot vector is at 0xFFF00100, then we need a 1MB BIOS. | ||
| 141 | + * But the NVRAM is located at 0xFFF04000... | ||
| 142 | + */ | ||
| 143 | + cpu_abort(env, "G3BW Mac hardware can not handle 1 MB BIOS\n"); | ||
| 144 | + } | ||
| 138 | 145 | ||
| 139 | /* allocate RAM */ | 146 | /* allocate RAM */ |
| 140 | cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); | 147 | 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, | @@ -150,6 +157,10 @@ static void ppc_heathrow_init (int ram_size, int vga_ram_size, int boot_device, | ||
| 150 | exit(1); | 157 | exit(1); |
| 151 | } | 158 | } |
| 152 | bios_size = (bios_size + 0xfff) & ~0xfff; | 159 | bios_size = (bios_size + 0xfff) & ~0xfff; |
| 160 | + if (bios_size > 0x00080000) { | ||
| 161 | + /* As the NVRAM is located at 0xFFF04000, we cannot use 1 MB BIOSes */ | ||
| 162 | + cpu_abort(env, "G3BW Mac hardware can not handle 1 MB BIOS\n"); | ||
| 163 | + } | ||
| 153 | cpu_register_physical_memory((uint32_t)(-bios_size), | 164 | cpu_register_physical_memory((uint32_t)(-bios_size), |
| 154 | bios_size, bios_offset | IO_MEM_ROM); | 165 | bios_size, bios_offset | IO_MEM_ROM); |
| 155 | 166 |
hw/ppc_prep.c
| @@ -574,6 +574,9 @@ static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device, | @@ -574,6 +574,9 @@ static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device, | ||
| 574 | cpu_abort(env, "qemu: could not load PPC PREP bios '%s'\n", buf); | 574 | cpu_abort(env, "qemu: could not load PPC PREP bios '%s'\n", buf); |
| 575 | exit(1); | 575 | exit(1); |
| 576 | } | 576 | } |
| 577 | + if (env->nip < 0xFFF80000 && bios_size < 0x00100000) { | ||
| 578 | + cpu_abort(env, "PowerPC 601 / 620 / 970 need a 1MB BIOS\n"); | ||
| 579 | + } | ||
| 577 | bios_size = (bios_size + 0xfff) & ~0xfff; | 580 | bios_size = (bios_size + 0xfff) & ~0xfff; |
| 578 | cpu_register_physical_memory((uint32_t)(-bios_size), | 581 | cpu_register_physical_memory((uint32_t)(-bios_size), |
| 579 | bios_size, bios_offset | IO_MEM_ROM); | 582 | bios_size, bios_offset | IO_MEM_ROM); |
vl.h
| @@ -197,7 +197,9 @@ extern unsigned int nb_prom_envs; | @@ -197,7 +197,9 @@ extern unsigned int nb_prom_envs; | ||
| 197 | 197 | ||
| 198 | /* XXX: make it dynamic */ | 198 | /* XXX: make it dynamic */ |
| 199 | #define MAX_BIOS_SIZE (4 * 1024 * 1024) | 199 | #define MAX_BIOS_SIZE (4 * 1024 * 1024) |
| 200 | -#if defined (TARGET_PPC) || defined (TARGET_SPARC64) | 200 | +#if defined (TARGET_PPC) |
| 201 | +#define BIOS_SIZE (1024 * 1024) | ||
| 202 | +#elif defined (TARGET_SPARC64) | ||
| 201 | #define BIOS_SIZE ((512 + 32) * 1024) | 203 | #define BIOS_SIZE ((512 + 32) * 1024) |
| 202 | #elif defined(TARGET_MIPS) | 204 | #elif defined(TARGET_MIPS) |
| 203 | #define BIOS_SIZE (4 * 1024 * 1024) | 205 | #define BIOS_SIZE (4 * 1024 * 1024) |