From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJTdY-0006ug-69 for qemu-devel@nongnu.org; Thu, 17 Jul 2008 09:35:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJTdX-0006u4-2r for qemu-devel@nongnu.org; Thu, 17 Jul 2008 09:35:11 -0400 Received: from [199.232.76.173] (port=57827 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJTdW-0006tm-Ek for qemu-devel@nongnu.org; Thu, 17 Jul 2008 09:35:10 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]:44753) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJTdU-00065C-Lx for qemu-devel@nongnu.org; Thu, 17 Jul 2008 09:35:08 -0400 Message-ID: <487F4AAA.3050904@eu.citrix.com> Date: Thu, 17 Jul 2008 14:35:38 +0100 From: Stefano Stabellini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] [UPDATE] ide: enable single word DMA Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ian Jackson This is an updated version of the patch that enables single word DMA in the emulated ide drive. I improved the set transfer mode DMA switch, making sure that mdma is deactivated when sdma is active and vice versa. Signed-off-by: Stefano Stabellini --- diff --git a/hw/ide.c b/hw/ide.c index 337621d..104e7dc 100644 --- a/hw/ide.c +++ b/hw/ide.c @@ -569,6 +569,7 @@ static void ide_identify(IDEState *s) put_le16(p + 59, 0x100 | s->mult_sectors); put_le16(p + 60, s->nb_sectors); put_le16(p + 61, s->nb_sectors >> 16); + put_le16(p + 62, 0x07); /* single word dma0-2 supported */ put_le16(p + 63, 0x07); /* mdma0-2 supported */ put_le16(p + 65, 120); put_le16(p + 66, 120); @@ -620,6 +621,7 @@ static void ide_atapi_identify(IDEState *s) #ifdef USE_DMA_CDROM put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */ put_le16(p + 53, 7); /* words 64-70, 54-58, 88 valid */ + put_le16(p + 62, 7); /* single word dma0-2 supported */ put_le16(p + 63, 7); /* mdma0-2 supported */ put_le16(p + 64, 0x3f); /* PIO modes supported */ #else @@ -2194,14 +2196,22 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val) switch (s->nsector >> 3) { case 0x00: /* pio default */ case 0x01: /* pio mode */ + put_le16(s->identify_data + 62,0x07); + put_le16(s->identify_data + 63,0x07); + put_le16(s->identify_data + 88,0x3f); + break; + case 0x02: /* sigle word dma mode*/ + put_le16(s->identify_data + 62,0x07 | (1 << (val + 8))); put_le16(s->identify_data + 63,0x07); put_le16(s->identify_data + 88,0x3f); break; case 0x04: /* mdma mode */ + put_le16(s->identify_data + 62,0x07); put_le16(s->identify_data + 63,0x07 | (1 << (val + 8))); put_le16(s->identify_data + 88,0x3f); break; case 0x08: /* udma mode */ + put_le16(s->identify_data + 62,0x07); put_le16(s->identify_data + 63,0x07); put_le16(s->identify_data + 88,0x3f | (1 << (val + 8))); break;