diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-15 12:52:53 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-15 12:52:53 -0400 |
commit | c9ef59ff01b6bd1c7360a64fcc8556a1193c2ed0 (patch) | |
tree | 5bd24f0d0f720ab29f9a5b5a2156a620e2ff2113 /drivers/ide/siimage.c | |
parent | 6dae44f9a55f13765c877687602cd2bf1a057cfd (diff) |
ide: IORDY handling fixes
Add ide_pio_need_iordy() helper and convert host drivers to use it.
This fixes it8172, it8213, pdc202xx_old, piix, slc90e66 and siimage
host drivers to handle IORDY correctly.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/siimage.c')
-rw-r--r-- | drivers/ide/siimage.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c index bd82d228608c..6a643fdf0e6e 100644 --- a/drivers/ide/siimage.c +++ b/drivers/ide/siimage.c | |||
@@ -32,7 +32,6 @@ | |||
32 | * smarter code in libata. | 32 | * smarter code in libata. |
33 | * | 33 | * |
34 | * TODO: | 34 | * TODO: |
35 | * - IORDY fixes | ||
36 | * - VDMA support | 35 | * - VDMA support |
37 | */ | 36 | */ |
38 | 37 | ||
@@ -234,8 +233,7 @@ static u8 sil_sata_udma_filter(ide_drive_t *drive) | |||
234 | * @pio: PIO mode number | 233 | * @pio: PIO mode number |
235 | * | 234 | * |
236 | * Load the timing settings for this device mode into the | 235 | * Load the timing settings for this device mode into the |
237 | * controller. If we are in PIO mode 3 or 4 turn on IORDY | 236 | * controller. |
238 | * monitoring (bit 9). The TF timing is bits 31:16 | ||
239 | */ | 237 | */ |
240 | 238 | ||
241 | static void sil_set_pio_mode(ide_drive_t *drive, u8 pio) | 239 | static void sil_set_pio_mode(ide_drive_t *drive, u8 pio) |
@@ -276,13 +274,16 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio) | |||
276 | /* now set up IORDY */ | 274 | /* now set up IORDY */ |
277 | speedp = sil_ioread16(dev, tfaddr - 2); | 275 | speedp = sil_ioread16(dev, tfaddr - 2); |
278 | speedp &= ~0x200; | 276 | speedp &= ~0x200; |
279 | if (pio > 2) | ||
280 | speedp |= 0x200; | ||
281 | sil_iowrite16(dev, speedp, tfaddr - 2); | ||
282 | 277 | ||
283 | mode = sil_ioread8(dev, base + addr_mask); | 278 | mode = sil_ioread8(dev, base + addr_mask); |
284 | mode &= ~(unit ? 0x30 : 0x03); | 279 | mode &= ~(unit ? 0x30 : 0x03); |
285 | mode |= unit ? 0x10 : 0x01; | 280 | |
281 | if (ide_pio_need_iordy(drive, pio)) { | ||
282 | speedp |= 0x200; | ||
283 | mode |= unit ? 0x10 : 0x01; | ||
284 | } | ||
285 | |||
286 | sil_iowrite16(dev, speedp, tfaddr - 2); | ||
286 | sil_iowrite8(dev, mode, base + addr_mask); | 287 | sil_iowrite8(dev, mode, base + addr_mask); |
287 | } | 288 | } |
288 | 289 | ||