aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/siimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/siimage.c')
-rw-r--r--drivers/ide/pci/siimage.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 0006b9e58567..b75e9bb390a7 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -94,7 +94,7 @@ static unsigned long siimage_selreg(ide_hwif_t *hwif, int r)
94 unsigned long base = (unsigned long)hwif->hwif_data; 94 unsigned long base = (unsigned long)hwif->hwif_data;
95 95
96 base += 0xA0 + r; 96 base += 0xA0 + r;
97 if (hwif->mmio) 97 if (hwif->host_flags & IDE_HFLAG_MMIO)
98 base += hwif->channel << 6; 98 base += hwif->channel << 6;
99 else 99 else
100 base += hwif->channel << 4; 100 base += hwif->channel << 4;
@@ -117,7 +117,7 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
117 unsigned long base = (unsigned long)hwif->hwif_data; 117 unsigned long base = (unsigned long)hwif->hwif_data;
118 118
119 base += 0xA0 + r; 119 base += 0xA0 + r;
120 if (hwif->mmio) 120 if (hwif->host_flags & IDE_HFLAG_MMIO)
121 base += hwif->channel << 6; 121 base += hwif->channel << 6;
122 else 122 else
123 base += hwif->channel << 4; 123 base += hwif->channel << 4;
@@ -190,7 +190,9 @@ static u8 sil_pata_udma_filter(ide_drive_t *drive)
190 unsigned long base = (unsigned long)hwif->hwif_data; 190 unsigned long base = (unsigned long)hwif->hwif_data;
191 u8 scsc, mask = 0; 191 u8 scsc, mask = 0;
192 192
193 scsc = sil_ioread8(dev, base + (hwif->mmio ? 0x4A : 0x8A)); 193 base += (hwif->host_flags & IDE_HFLAG_MMIO) ? 0x4A : 0x8A;
194
195 scsc = sil_ioread8(dev, base);
194 196
195 switch (scsc & 0x30) { 197 switch (scsc & 0x30) {
196 case 0x10: /* 133 */ 198 case 0x10: /* 133 */
@@ -238,8 +240,9 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
238 unsigned long tfaddr = siimage_selreg(hwif, 0x02); 240 unsigned long tfaddr = siimage_selreg(hwif, 0x02);
239 unsigned long base = (unsigned long)hwif->hwif_data; 241 unsigned long base = (unsigned long)hwif->hwif_data;
240 u8 tf_pio = pio; 242 u8 tf_pio = pio;
241 u8 addr_mask = hwif->channel ? (hwif->mmio ? 0xF4 : 0x84) 243 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
242 : (hwif->mmio ? 0xB4 : 0x80); 244 u8 addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84)
245 : (mmio ? 0xB4 : 0x80);
243 u8 mode = 0; 246 u8 mode = 0;
244 u8 unit = drive->select.b.unit; 247 u8 unit = drive->select.b.unit;
245 248
@@ -290,13 +293,13 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed)
290 u16 ultra = 0, multi = 0; 293 u16 ultra = 0, multi = 0;
291 u8 mode = 0, unit = drive->select.b.unit; 294 u8 mode = 0, unit = drive->select.b.unit;
292 unsigned long base = (unsigned long)hwif->hwif_data; 295 unsigned long base = (unsigned long)hwif->hwif_data;
293 u8 scsc = 0, addr_mask = hwif->channel ? 296 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
294 (hwif->mmio ? 0xF4 : 0x84) : 297 u8 scsc = 0, addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84)
295 (hwif->mmio ? 0xB4 : 0x80); 298 : (mmio ? 0xB4 : 0x80);
296 unsigned long ma = siimage_seldev(drive, 0x08); 299 unsigned long ma = siimage_seldev(drive, 0x08);
297 unsigned long ua = siimage_seldev(drive, 0x0C); 300 unsigned long ua = siimage_seldev(drive, 0x0C);
298 301
299 scsc = sil_ioread8 (dev, base + (hwif->mmio ? 0x4A : 0x8A)); 302 scsc = sil_ioread8 (dev, base + (mmio ? 0x4A : 0x8A));
300 mode = sil_ioread8 (dev, base + addr_mask); 303 mode = sil_ioread8 (dev, base + addr_mask);
301 multi = sil_ioread16(dev, ma); 304 multi = sil_ioread16(dev, ma);
302 ultra = sil_ioread16(dev, ua); 305 ultra = sil_ioread16(dev, ua);
@@ -391,7 +394,7 @@ static int siimage_mmio_dma_test_irq(ide_drive_t *drive)
391 394
392static int siimage_dma_test_irq(ide_drive_t *drive) 395static int siimage_dma_test_irq(ide_drive_t *drive)
393{ 396{
394 if (drive->hwif->mmio) 397 if (drive->hwif->host_flags & IDE_HFLAG_MMIO)
395 return siimage_mmio_dma_test_irq(drive); 398 return siimage_mmio_dma_test_irq(drive);
396 else 399 else
397 return siimage_io_dma_test_irq(drive); 400 return siimage_io_dma_test_irq(drive);
@@ -640,8 +643,6 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
640 hwif->irq = dev->irq; 643 hwif->irq = dev->irq;
641 644
642 hwif->dma_base = (unsigned long)addr + (ch ? 0x08 : 0x00); 645 hwif->dma_base = (unsigned long)addr + (ch ? 0x08 : 0x00);
643
644 hwif->mmio = 1;
645} 646}
646 647
647static int is_dev_seagate_sata(ide_drive_t *drive) 648static int is_dev_seagate_sata(ide_drive_t *drive)