]> Git Repo - qemu.git/blobdiff - hw/ppc_chrp.c
update from latest Bochs BIOS
[qemu.git] / hw / ppc_chrp.c
index 8fb8e5d205dbc427d8ab966183797849aaa28142..4437a1038e2cd0b304e7d99a75b8c1b7729bea65 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include "vl.h"
+#include "hw.h"
+#include "ppc.h"
 #include "ppc_mac.h"
+#include "nvram.h"
+#include "pc.h"
+#include "pci.h"
+#include "net.h"
+#include "sysemu.h"
+#include "boards.h"
+
+#define MAX_IDE_BUS 2
 
 /* UniN device */
 static void unin_writel (void *opaque, target_phys_addr_t addr, uint32_t value)
@@ -50,7 +59,6 @@ static CPUReadMemoryFunc *unin_read[] = {
 /* PowerPC Mac99 hardware initialisation */
 static void ppc_core99_init (int ram_size, int vga_ram_size,
                              const char *boot_device, DisplayState *ds,
-                             const char **fd_filename, int snapshot,
                              const char *kernel_filename,
                              const char *kernel_cmdline,
                              const char *initrd_filename,
@@ -75,6 +83,8 @@ static void ppc_core99_init (int ram_size, int vga_ram_size,
     int pic_mem_index, dbdma_mem_index, cuda_mem_index;
     int ide_mem_index[2];
     int ppc_boot_device;
+    int index;
+    BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
 
     linux_boot = (kernel_filename != NULL);
 
@@ -249,7 +259,7 @@ static void ppc_core99_init (int ram_size, int vga_ram_size,
     pci_vga_init(pci_bus, ds, phys_ram_base + ram_size,
                  ram_size, vga_ram_size,
                  vga_bios_offset, vga_bios_size);
-    
+
     /* XXX: suppress that */
     dummy_irq = i8259_init(NULL);
 
@@ -260,15 +270,26 @@ static void ppc_core99_init (int ram_size, int vga_ram_size,
             nd_table[i].model = "ne2k_pci";
         pci_nic_init(pci_bus, &nd_table[i], -1);
     }
+    if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) {
+        fprintf(stderr, "qemu: too many IDE bus\n");
+        exit(1);
+    }
+    for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
+        index = drive_get_index(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
+        if (index != -1)
+            hd[i] = drives_table[index].bdrv;
+        else
+            hd[i] = NULL;
+    }
 #if 1
-    ide_mem_index[0] = pmac_ide_init(&bs_table[0], pic[0x13]);
-    ide_mem_index[1] = pmac_ide_init(&bs_table[2], pic[0x14]);
+    ide_mem_index[0] = pmac_ide_init(&hd[0], pic[0x13]);
+    ide_mem_index[1] = pmac_ide_init(&hd[2], pic[0x14]);
 #else
-    pci_cmd646_ide_init(pci_bus, &bs_table[0], 0);
+    pci_cmd646_ide_init(pci_bus, &hd[0], 0);
 #endif
     /* cuda also initialize ADB */
     cuda_init(&cuda_mem_index, pic[0x19]);
-    
+
     adb_kbd_init(&adb_bus);
     adb_mouse_init(&adb_bus);
 
@@ -308,7 +329,7 @@ static void ppc_core99_init (int ram_size, int vga_ram_size,
 
     /* Special port to get debug messages from Open-Firmware */
     register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL);
- }
+}
 
 QEMUMachine core99_machine = {
     "mac99",
This page took 0.026018 seconds and 4 git commands to generate.