Switch Mac99 to OpenBIOS

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6560 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2009-02-08 15:59:36 +00:00
parent aa71cf802e
commit 006f3a48e0
4 changed files with 17 additions and 16 deletions

View File

@ -32,10 +32,12 @@
#include "net.h" #include "net.h"
#include "sysemu.h" #include "sysemu.h"
#include "boards.h" #include "boards.h"
#include "fw_cfg.h"
#include "escc.h" #include "escc.h"
#define MAX_IDE_BUS 2 #define MAX_IDE_BUS 2
#define VGA_BIOS_SIZE 65536 #define VGA_BIOS_SIZE 65536
#define CFG_ADDR 0xf0000510
/* debug UniNorth */ /* debug UniNorth */
//#define DEBUG_UNIN //#define DEBUG_UNIN
@ -103,6 +105,7 @@ static void ppc_core99_init (ram_addr_t ram_size, int vga_ram_size,
int ppc_boot_device; int ppc_boot_device;
int index; int index;
BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
void *fw_cfg;
void *dbdma; void *dbdma;
linux_boot = (kernel_filename != NULL); linux_boot = (kernel_filename != NULL);
@ -135,20 +138,16 @@ static void ppc_core99_init (ram_addr_t ram_size, int vga_ram_size,
/* allocate and load BIOS */ /* allocate and load BIOS */
bios_offset = qemu_ram_alloc(BIOS_SIZE); bios_offset = qemu_ram_alloc(BIOS_SIZE);
if (bios_name == NULL) if (bios_name == NULL)
bios_name = BIOS_FILENAME; bios_name = PROM_FILENAME;
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name); snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
bios_size = load_image(buf, phys_ram_base + bios_offset); cpu_register_physical_memory(PROM_ADDR, BIOS_SIZE, bios_offset | IO_MEM_ROM);
/* Load OpenBIOS (ELF) */
bios_size = load_elf(buf, 0, NULL, NULL, NULL);
if (bios_size < 0 || bios_size > BIOS_SIZE) { if (bios_size < 0 || bios_size > BIOS_SIZE) {
cpu_abort(env, "qemu: could not load PowerPC bios '%s'\n", buf); cpu_abort(env, "qemu: could not load PowerPC bios '%s'\n", buf);
exit(1); 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);
/* allocate and load VGA BIOS */ /* allocate and load VGA BIOS */
vga_bios_offset = qemu_ram_alloc(VGA_BIOS_SIZE); vga_bios_offset = qemu_ram_alloc(VGA_BIOS_SIZE);
@ -337,8 +336,10 @@ static void ppc_core99_init (ram_addr_t ram_size, int vga_ram_size,
graphic_width, graphic_height, graphic_depth); graphic_width, graphic_height, graphic_depth);
/* No PCI init: the BIOS will do it */ /* No PCI init: the BIOS will do it */
/* Special port to get debug messages from Open-Firmware */ fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL); fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_MAC99);
} }
QEMUMachine core99_machine = { QEMUMachine core99_machine = {

View File

@ -42,7 +42,7 @@
firmware implementation. The goal is to implement a 100% IEEE firmware implementation. The goal is to implement a 100% IEEE
1275-1994 (referred to as Open Firmware) compliant firmware. 1275-1994 (referred to as Open Firmware) compliant firmware.
The included Sparc32 and Sparc64 images are built from SVN revision 395. The included Sparc32 and Sparc64 images are built from SVN revision 395.
The included PowerPC image is built from SVN revision 418. The included PowerPC image is built from SVN revision 450.
- The PXE roms come from Rom-o-Matic etherboot 5.4.2. - The PXE roms come from Rom-o-Matic etherboot 5.4.2.
pcnet32:pcnet32 -- [0x1022,0x2000] pcnet32:pcnet32 -- [0x1022,0x2000]

Binary file not shown.

View File

@ -2433,7 +2433,7 @@ QEMU emulates the following PowerMac peripherals:
@itemize @minus @itemize @minus
@item @item
UniNorth PCI Bridge UniNorth or Grackle PCI Bridge
@item @item
PCI VGA compatible card with VESA Bochs Extensions PCI VGA compatible card with VESA Bochs Extensions
@item @item
@ -2471,9 +2471,9 @@ QEMU uses the Open Hack'Ware Open Firmware Compatible BIOS available at
@url{http://perso.magic.fr/l_indien/OpenHackWare/index.htm}. @url{http://perso.magic.fr/l_indien/OpenHackWare/index.htm}.
Since version 0.9.1, QEMU uses OpenBIOS @url{http://www.openbios.org/} Since version 0.9.1, QEMU uses OpenBIOS @url{http://www.openbios.org/}
for the g3beige PowerMac machine. OpenBIOS is a free (GPL v2) portable for the g3beige and mac99 PowerMac machines. OpenBIOS is a free (GPL
firmware implementation. The goal is to implement a 100% IEEE v2) portable firmware implementation. The goal is to implement a 100%
1275-1994 (referred to as Open Firmware) compliant firmware. IEEE 1275-1994 (referred to as Open Firmware) compliant firmware.
@c man begin OPTIONS @c man begin OPTIONS