From patchwork Tue Feb 9 16:37:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 44913 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 54CEBB7D18 for ; Wed, 10 Feb 2010 03:38:05 +1100 (EST) Received: from localhost ([127.0.0.1]:53076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Net6A-0006HL-Cp for incoming@patchwork.ozlabs.org; Tue, 09 Feb 2010 11:38:02 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Net5W-0006GJ-0y for qemu-devel@nongnu.org; Tue, 09 Feb 2010 11:37:22 -0500 Received: from [199.232.76.173] (port=50197 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Net5V-0006Fl-JP for qemu-devel@nongnu.org; Tue, 09 Feb 2010 11:37:21 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Net5N-0007CU-8W for qemu-devel@nongnu.org; Tue, 09 Feb 2010 11:37:20 -0500 Received: from cantor2.suse.de ([195.135.220.15]:43973 helo=mx2.suse.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Net5M-0007CI-KP for qemu-devel@nongnu.org; Tue, 09 Feb 2010 11:37:12 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 2D5CD87D82; Tue, 9 Feb 2010 17:37:11 +0100 (CET) From: Alexander Graf To: qemu-devel@nongnu.org Date: Tue, 9 Feb 2010 17:37:06 +0100 Message-Id: <1265733430-9656-7-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1265733430-9656-1-git-send-email-agraf@suse.de> References: <1265733430-9656-1-git-send-email-agraf@suse.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: blauwirbel@gmail.com, aurelien@aurel32.net, mst@redhat.com Subject: [Qemu-devel] [PATCH 06/10] PPC: Use macio IDE controller for Newworld X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 49b5e04..dafd37c 100644 --- a/hw/ppc_newworld.c +++ b/hw/ppc_newworld.c @@ -134,6 +134,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; @@ -364,11 +365,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]); @@ -378,7 +384,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) {