Commit d1b5c20dcde176df50f1955e498af252e87a3e9d
1 parent
b6855851
ide: enable single word DMA, by Stefano Stabellini.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4890 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
10 additions
and
0 deletions
hw/ide.c
| ... | ... | @@ -569,6 +569,7 @@ static void ide_identify(IDEState *s) |
| 569 | 569 | put_le16(p + 59, 0x100 | s->mult_sectors); |
| 570 | 570 | put_le16(p + 60, s->nb_sectors); |
| 571 | 571 | put_le16(p + 61, s->nb_sectors >> 16); |
| 572 | + put_le16(p + 62, 0x07); /* single word dma0-2 supported */ | |
| 572 | 573 | put_le16(p + 63, 0x07); /* mdma0-2 supported */ |
| 573 | 574 | put_le16(p + 65, 120); |
| 574 | 575 | put_le16(p + 66, 120); |
| ... | ... | @@ -620,6 +621,7 @@ static void ide_atapi_identify(IDEState *s) |
| 620 | 621 | #ifdef USE_DMA_CDROM |
| 621 | 622 | put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */ |
| 622 | 623 | put_le16(p + 53, 7); /* words 64-70, 54-58, 88 valid */ |
| 624 | + put_le16(p + 62, 7); /* single word dma0-2 supported */ | |
| 623 | 625 | put_le16(p + 63, 7); /* mdma0-2 supported */ |
| 624 | 626 | put_le16(p + 64, 0x3f); /* PIO modes supported */ |
| 625 | 627 | #else |
| ... | ... | @@ -2194,14 +2196,22 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val) |
| 2194 | 2196 | switch (s->nsector >> 3) { |
| 2195 | 2197 | case 0x00: /* pio default */ |
| 2196 | 2198 | case 0x01: /* pio mode */ |
| 2199 | + put_le16(s->identify_data + 62,0x07); | |
| 2200 | + put_le16(s->identify_data + 63,0x07); | |
| 2201 | + put_le16(s->identify_data + 88,0x3f); | |
| 2202 | + break; | |
| 2203 | + case 0x02: /* sigle word dma mode*/ | |
| 2204 | + put_le16(s->identify_data + 62,0x07 | (1 << (val + 8))); | |
| 2197 | 2205 | put_le16(s->identify_data + 63,0x07); |
| 2198 | 2206 | put_le16(s->identify_data + 88,0x3f); |
| 2199 | 2207 | break; |
| 2200 | 2208 | case 0x04: /* mdma mode */ |
| 2209 | + put_le16(s->identify_data + 62,0x07); | |
| 2201 | 2210 | put_le16(s->identify_data + 63,0x07 | (1 << (val + 8))); |
| 2202 | 2211 | put_le16(s->identify_data + 88,0x3f); |
| 2203 | 2212 | break; |
| 2204 | 2213 | case 0x08: /* udma mode */ |
| 2214 | + put_le16(s->identify_data + 62,0x07); | |
| 2205 | 2215 | put_le16(s->identify_data + 63,0x07); |
| 2206 | 2216 | put_le16(s->identify_data + 88,0x3f | (1 << (val + 8))); |
| 2207 | 2217 | break; | ... | ... |