From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUfOr-0005Sh-Bk for qemu-devel@nongnu.org; Tue, 12 Jan 2010 06:59:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUfOk-0005ND-Uu for qemu-devel@nongnu.org; Tue, 12 Jan 2010 06:59:03 -0500 Received: from [199.232.76.173] (port=52119 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUfOj-0005MM-7X for qemu-devel@nongnu.org; Tue, 12 Jan 2010 06:58:57 -0500 Received: from cantor.suse.de ([195.135.220.2]:34619 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NUfOi-0003ww-Gs for qemu-devel@nongnu.org; Tue, 12 Jan 2010 06:58:56 -0500 From: Alexander Graf Date: Tue, 12 Jan 2010 12:58:44 +0100 Message-Id: <1263297526-13518-8-git-send-email-agraf@suse.de> In-Reply-To: <1263297526-13518-1-git-send-email-agraf@suse.de> References: <1263297526-13518-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 7/9] PPC: Use macio IDE controller for Newworld List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Aurelien Jarno Per default Linux doesn't come with a lot of storage adapters enabled on Mac configurations. The one that's pretty much always present is the pmac-ide, while the cmd64x is almost never included in any distribution. So let's switch to use the MacIO based IDE controller. There is corresponding OpenBIOS code to get interrupts working properly. Signed-off-by: Alexander Graf --- hw/ppc_newworld.c | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c index 6c7a537..c08211e 100644 --- a/hw/ppc_newworld.c +++ b/hw/ppc_newworld.c @@ -110,6 +110,7 @@ static void ppc_core99_init (ram_addr_t ram_size, int nvram_mem_index; int vga_bios_size, bios_size; int pic_mem_index, dbdma_mem_index, cuda_mem_index, escc_mem_index; + int ide_mem_index[3]; int ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; void *fw_cfg; @@ -340,11 +341,16 @@ static void ppc_core99_init (ram_addr_t ram_size, fprintf(stderr, "qemu: too many IDE bus\n"); exit(1); } - for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) { - hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS); - } dbdma = DBDMA_init(&dbdma_mem_index); - pci_cmd646_ide_init(pci_bus, hd, 0); + + /* We only emulate 2 out of 3 IDE controllers for now */ + ide_mem_index[0] = -1; + hd[0] = drive_get(IF_IDE, 0, 0); + hd[1] = drive_get(IF_IDE, 0, 1); + ide_mem_index[1] = pmac_ide_init(hd, pic[0x0d], dbdma, 0x16, pic[0x02]); + hd[0] = drive_get(IF_IDE, 1, 0); + hd[1] = drive_get(IF_IDE, 1, 1); + ide_mem_index[2] = pmac_ide_init(hd, pic[0x0e], dbdma, 0x1a, pic[0x02]); /* cuda also initialize ADB */ cuda_init(&cuda_mem_index, pic[0x19]); @@ -354,7 +360,7 @@ static void ppc_core99_init (ram_addr_t ram_size, macio_init(pci_bus, PCI_DEVICE_ID_APPLE_UNI_N_KEYL, 0, pic_mem_index, - dbdma_mem_index, cuda_mem_index, NULL, 0, NULL, + dbdma_mem_index, cuda_mem_index, NULL, 3, ide_mem_index, escc_mem_index); if (usb_enabled) { -- 1.6.0.2