qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 03/23] prep: Prepare emulation of an IBM RS/6000 6015


From: Andreas Färber
Subject: [Qemu-devel] [RFC 03/23] prep: Prepare emulation of an IBM RS/6000 6015 / 7020 (40p)
Date: Tue, 14 Jun 2011 04:37:37 +0200

Signed-off-by: Hervé Poussineau <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
 hw/ppc_prep.c |   62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index b3efd3c..071c149 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -763,6 +763,61 @@ static void ppc_prep_init (ram_addr_t ram_size,
     register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL);
 }
 
+static void ibm_40p_init(ram_addr_t ram_size,
+                         const char *boot_device,
+                         const char *kernel_filename,
+                         const char *kernel_cmdline,
+                         const char *initrd_filename,
+                         const char *cpu_model)
+{
+    CPUState *env;
+    char *filename;
+    int bios_size;
+    ram_addr_t ram_offset, bios_offset;
+
+    // IBM E15 graphic adapter (S3 Vision864)
+    // PowerPC 601
+    // PCI, ISA
+    // 16 MB RAM
+    // Audio Crystal 4231
+    // SCSI-2
+    // Parallel ECP / 2 Serials 16550 (on Super I/O)
+
+    /* init CPU */
+    if (cpu_model == NULL)
+        cpu_model = "601";
+    env = ppc_prep_new_cpu(cpu_model);
+
+    /* allocate RAM */
+    ram_offset = qemu_ram_alloc(NULL, "ppc_prep.ram", ram_size);
+    cpu_register_physical_memory(0, ram_size, ram_offset);
+
+    /* allocate and load BIOS */
+    bios_offset = qemu_ram_alloc(NULL, "ppc_prep.bios", BIOS_SIZE);
+    if (bios_name == NULL)
+        bios_name = "P12H0456.IMG";
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+    if (filename) {
+        bios_size = get_image_size(filename);
+    } else {
+        bios_size = -1;
+    }
+    if (bios_size > 0 && bios_size <= BIOS_SIZE) {
+        target_phys_addr_t bios_addr;
+        bios_size = (bios_size + 0xfff) & ~0xfff;
+        bios_addr = (uint32_t)(-BIOS_SIZE);
+        cpu_register_physical_memory(bios_addr, bios_size,
+                                     bios_offset | IO_MEM_ROM);
+        bios_size = load_image_targphys(filename, bios_addr, bios_size);
+    }
+    if (bios_size < 0 || bios_size > BIOS_SIZE) {
+        hw_error("qemu: could not load PPC PReP bios '%s'\n", bios_name);
+    }
+    if (filename) {
+        qemu_free(filename);
+    }
+}
+
 static QEMUMachine prep_machine = {
     .name = "prep",
     .desc = "PowerPC PREP platform",
@@ -770,9 +825,16 @@ static QEMUMachine prep_machine = {
     .max_cpus = MAX_CPUS,
 };
 
+static QEMUMachine ibm_40p_machine = {
+    .name = "40p",
+    .desc = "IBM RS/6000 7020 (40p)",
+    .init = ibm_40p_init,
+};
+
 static void prep_machine_init(void)
 {
     qemu_register_machine(&prep_machine);
+    qemu_register_machine(&ibm_40p_machine);
 }
 
 machine_init(prep_machine_init);
-- 
1.7.5.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]