diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-07-18 16:49:42 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-07-18 16:49:42 +0000 |
commit | d1b5c20dcde176df50f1955e498af252e87a3e9d (patch) | |
tree | b4076e0936042b8b6aca71e74e160357d2ef5114 /hw | |
parent | b68558517e8286e9d737e4f351939b86ff3892ec (diff) |
ide: enable single word DMA, by Stefano Stabellini.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4890 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ide.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; |