diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-28 17:44:38 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-28 17:44:38 -0400 |
commit | 165701d9fc0e4e2bf2784119514877484ab361c5 (patch) | |
tree | 68648c704ac30a8d7075ded654912fb5854dae82 /drivers/ide/pci/siimage.c | |
parent | 24a96ae0e34e743f3ee00501ad38f1cb4aa31429 (diff) |
siimage: add sil_* I/O ops
Add sil_iowrite{8,16,32}() and sil_ioread{8,16}() helpers, then use them to
merge code accessing configuration registers through PCI and MMIO together.
[ because of this SATA initialization bits from setup_mmio_siimage() are
moved to init_chipset_siimage() ]
This also cuts code size a bit:
text data bss dec hex filename
4437 164 0 4601 11f9 drivers/ide/pci/siimage.o.before
3979 164 0 4143 102f drivers/ide/pci/siimage.o.after
While at it:
* Use I/O ops directly instead of using ->IN{B,W} and ->OUT{B,W}.
* Fixup CodingStyle in setup_mmio_siimage().
* Rename 'tmpbyte' variable to 'tmp' in init_chipset_siimage().
There should be no functional changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/siimage.c')
-rw-r--r-- | drivers/ide/pci/siimage.c | 299 |
1 files changed, 140 insertions, 159 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index f0c4234bacab..cf8a7594ba3d 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> | 2 | * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> |
3 | * Copyright (C) 2003 Red Hat <alan@redhat.com> | 3 | * Copyright (C) 2003 Red Hat <alan@redhat.com> |
4 | * Copyright (C) 2007 MontaVista Software, Inc. | 4 | * Copyright (C) 2007 MontaVista Software, Inc. |
5 | * Copyright (C) 2007 Bartlomiej Zolnierkiewicz | 5 | * Copyright (C) 2007-2008 Bartlomiej Zolnierkiewicz |
6 | * | 6 | * |
7 | * May be copied or modified under the terms of the GNU General Public License | 7 | * May be copied or modified under the terms of the GNU General Public License |
8 | * | 8 | * |
@@ -124,6 +124,54 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r) | |||
124 | return base; | 124 | return base; |
125 | } | 125 | } |
126 | 126 | ||
127 | static u8 sil_ioread8(struct pci_dev *dev, unsigned long addr) | ||
128 | { | ||
129 | u8 tmp = 0; | ||
130 | |||
131 | if (pci_get_drvdata(dev)) | ||
132 | tmp = readb((void __iomem *)addr); | ||
133 | else | ||
134 | pci_read_config_byte(dev, addr, &tmp); | ||
135 | |||
136 | return tmp; | ||
137 | } | ||
138 | |||
139 | static u16 sil_ioread16(struct pci_dev *dev, unsigned long addr) | ||
140 | { | ||
141 | u16 tmp = 0; | ||
142 | |||
143 | if (pci_get_drvdata(dev)) | ||
144 | tmp = readw((void __iomem *)addr); | ||
145 | else | ||
146 | pci_read_config_word(dev, addr, &tmp); | ||
147 | |||
148 | return tmp; | ||
149 | } | ||
150 | |||
151 | static void sil_iowrite8(struct pci_dev *dev, u8 val, unsigned long addr) | ||
152 | { | ||
153 | if (pci_get_drvdata(dev)) | ||
154 | writeb(val, (void __iomem *)addr); | ||
155 | else | ||
156 | pci_write_config_byte(dev, addr, val); | ||
157 | } | ||
158 | |||
159 | static void sil_iowrite16(struct pci_dev *dev, u16 val, unsigned long addr) | ||
160 | { | ||
161 | if (pci_get_drvdata(dev)) | ||
162 | writew(val, (void __iomem *)addr); | ||
163 | else | ||
164 | pci_write_config_word(dev, addr, val); | ||
165 | } | ||
166 | |||
167 | static void sil_iowrite32(struct pci_dev *dev, u32 val, unsigned long addr) | ||
168 | { | ||
169 | if (pci_get_drvdata(dev)) | ||
170 | writel(val, (void __iomem *)addr); | ||
171 | else | ||
172 | pci_write_config_dword(dev, addr, val); | ||
173 | } | ||
174 | |||
127 | /** | 175 | /** |
128 | * sil_udma_filter - compute UDMA mask | 176 | * sil_udma_filter - compute UDMA mask |
129 | * @drive: IDE device | 177 | * @drive: IDE device |
@@ -139,12 +187,9 @@ static u8 sil_pata_udma_filter(ide_drive_t *drive) | |||
139 | ide_hwif_t *hwif = drive->hwif; | 187 | ide_hwif_t *hwif = drive->hwif; |
140 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 188 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
141 | unsigned long base = (unsigned long) hwif->hwif_data; | 189 | unsigned long base = (unsigned long) hwif->hwif_data; |
142 | u8 mask = 0, scsc = 0; | 190 | u8 mask = 0, scsc; |
143 | 191 | ||
144 | if (hwif->mmio) | 192 | scsc = sil_ioread8(dev, base + (hwif->mmio ? 0x4A : 0x8A)); |
145 | scsc = hwif->INB(base + 0x4A); | ||
146 | else | ||
147 | pci_read_config_byte(dev, 0x8A, &scsc); | ||
148 | 193 | ||
149 | if ((scsc & 0x30) == 0x10) /* 133 */ | 194 | if ((scsc & 0x30) == 0x10) /* 133 */ |
150 | mask = ATA_UDMA6; | 195 | mask = ATA_UDMA6; |
@@ -179,6 +224,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio) | |||
179 | const u16 data_speed[] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 }; | 224 | const u16 data_speed[] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 }; |
180 | 225 | ||
181 | ide_hwif_t *hwif = HWIF(drive); | 226 | ide_hwif_t *hwif = HWIF(drive); |
227 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
182 | ide_drive_t *pair = ide_get_paired_drive(drive); | 228 | ide_drive_t *pair = ide_get_paired_drive(drive); |
183 | u32 speedt = 0; | 229 | u32 speedt = 0; |
184 | u16 speedp = 0; | 230 | u16 speedp = 0; |
@@ -203,36 +249,20 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio) | |||
203 | speedp = data_speed[pio]; | 249 | speedp = data_speed[pio]; |
204 | speedt = tf_speed[tf_pio]; | 250 | speedt = tf_speed[tf_pio]; |
205 | 251 | ||
206 | if (hwif->mmio) { | 252 | sil_iowrite16(dev, speedp, addr); |
207 | hwif->OUTW(speedp, addr); | 253 | sil_iowrite16(dev, speedt, tfaddr); |
208 | hwif->OUTW(speedt, tfaddr); | 254 | |
209 | /* Now set up IORDY */ | 255 | /* now set up IORDY */ |
210 | if (pio > 2) | 256 | speedp = sil_ioread16(dev, tfaddr - 2); |
211 | hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2); | 257 | speedp &= ~0x200; |
212 | else | 258 | if (pio > 2) |
213 | hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2); | 259 | speedp |= 0x200; |
214 | 260 | sil_iowrite16(dev, speedp, tfaddr - 2); | |
215 | mode = hwif->INB(base + addr_mask); | 261 | |
216 | mode &= ~(unit ? 0x30 : 0x03); | 262 | mode = sil_ioread8(dev, base + addr_mask); |
217 | mode |= (unit ? 0x10 : 0x01); | 263 | mode &= ~(unit ? 0x30 : 0x03); |
218 | hwif->OUTB(mode, base + addr_mask); | 264 | mode |= (unit ? 0x10 : 0x01); |
219 | } else { | 265 | sil_iowrite8(dev, mode, base + addr_mask); |
220 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
221 | |||
222 | pci_write_config_word(dev, addr, speedp); | ||
223 | pci_write_config_word(dev, tfaddr, speedt); | ||
224 | pci_read_config_word(dev, tfaddr - 2, &speedp); | ||
225 | speedp &= ~0x200; | ||
226 | /* Set IORDY for mode 3 or 4 */ | ||
227 | if (pio > 2) | ||
228 | speedp |= 0x200; | ||
229 | pci_write_config_word(dev, tfaddr - 2, speedp); | ||
230 | |||
231 | pci_read_config_byte(dev, addr_mask, &mode); | ||
232 | mode &= ~(unit ? 0x30 : 0x03); | ||
233 | mode |= (unit ? 0x10 : 0x01); | ||
234 | pci_write_config_byte(dev, addr_mask, mode); | ||
235 | } | ||
236 | } | 266 | } |
237 | 267 | ||
238 | /** | 268 | /** |
@@ -261,17 +291,10 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
261 | unsigned long ma = siimage_seldev(drive, 0x08); | 291 | unsigned long ma = siimage_seldev(drive, 0x08); |
262 | unsigned long ua = siimage_seldev(drive, 0x0C); | 292 | unsigned long ua = siimage_seldev(drive, 0x0C); |
263 | 293 | ||
264 | if (hwif->mmio) { | 294 | scsc = sil_ioread8(dev, base + (hwif->mmio ? 0x4A : 0x8A)); |
265 | scsc = hwif->INB(base + 0x4A); | 295 | mode = sil_ioread8(dev, base + addr_mask); |
266 | mode = hwif->INB(base + addr_mask); | 296 | multi = sil_ioread16(dev, ma); |
267 | multi = hwif->INW(ma); | 297 | ultra = sil_ioread16(dev, ua); |
268 | ultra = hwif->INW(ua); | ||
269 | } else { | ||
270 | pci_read_config_byte(dev, 0x8A, &scsc); | ||
271 | pci_read_config_byte(dev, addr_mask, &mode); | ||
272 | pci_read_config_word(dev, ma, &multi); | ||
273 | pci_read_config_word(dev, ua, &ultra); | ||
274 | } | ||
275 | 298 | ||
276 | mode &= ~((unit) ? 0x30 : 0x03); | 299 | mode &= ~((unit) ? 0x30 : 0x03); |
277 | ultra &= ~0x3F; | 300 | ultra &= ~0x3F; |
@@ -289,15 +312,9 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
289 | mode |= (unit ? 0x20 : 0x02); | 312 | mode |= (unit ? 0x20 : 0x02); |
290 | } | 313 | } |
291 | 314 | ||
292 | if (hwif->mmio) { | 315 | sil_iowrite8(dev, mode, base + addr_mask); |
293 | hwif->OUTB(mode, base + addr_mask); | 316 | sil_iowrite16(dev, multi, ma); |
294 | hwif->OUTW(multi, ma); | 317 | sil_iowrite16(dev, ultra, ua); |
295 | hwif->OUTW(ultra, ua); | ||
296 | } else { | ||
297 | pci_write_config_byte(dev, addr_mask, mode); | ||
298 | pci_write_config_word(dev, ma, multi); | ||
299 | pci_write_config_word(dev, ua, ultra); | ||
300 | } | ||
301 | } | 318 | } |
302 | 319 | ||
303 | /* returns 1 if dma irq issued, 0 otherwise */ | 320 | /* returns 1 if dma irq issued, 0 otherwise */ |
@@ -460,26 +477,21 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name) | |||
460 | { | 477 | { |
461 | resource_size_t bar5 = pci_resource_start(dev, 5); | 478 | resource_size_t bar5 = pci_resource_start(dev, 5); |
462 | unsigned long barsize = pci_resource_len(dev, 5); | 479 | unsigned long barsize = pci_resource_len(dev, 5); |
463 | u8 tmpbyte = 0; | ||
464 | void __iomem *ioaddr; | 480 | void __iomem *ioaddr; |
465 | u32 tmp, irq_mask; | ||
466 | 481 | ||
467 | /* | 482 | /* |
468 | * Drop back to PIO if we can't map the mmio. Some | 483 | * Drop back to PIO if we can't map the mmio. Some |
469 | * systems seem to get terminally confused in the PCI | 484 | * systems seem to get terminally confused in the PCI |
470 | * spaces. | 485 | * spaces. |
471 | */ | 486 | */ |
472 | 487 | if (!request_mem_region(bar5, barsize, name)) { | |
473 | if(!request_mem_region(bar5, barsize, name)) | ||
474 | { | ||
475 | printk(KERN_WARNING "siimage: IDE controller MMIO ports not available.\n"); | 488 | printk(KERN_WARNING "siimage: IDE controller MMIO ports not available.\n"); |
476 | return 0; | 489 | return 0; |
477 | } | 490 | } |
478 | 491 | ||
479 | ioaddr = ioremap(bar5, barsize); | 492 | ioaddr = ioremap(bar5, barsize); |
480 | 493 | ||
481 | if (ioaddr == NULL) | 494 | if (ioaddr == NULL) { |
482 | { | ||
483 | release_mem_region(bar5, barsize); | 495 | release_mem_region(bar5, barsize); |
484 | return 0; | 496 | return 0; |
485 | } | 497 | } |
@@ -487,62 +499,6 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name) | |||
487 | pci_set_master(dev); | 499 | pci_set_master(dev); |
488 | pci_set_drvdata(dev, (void *) ioaddr); | 500 | pci_set_drvdata(dev, (void *) ioaddr); |
489 | 501 | ||
490 | if (pdev_is_sata(dev)) { | ||
491 | /* make sure IDE0/1 interrupts are not masked */ | ||
492 | irq_mask = (1 << 22) | (1 << 23); | ||
493 | tmp = readl(ioaddr + 0x48); | ||
494 | if (tmp & irq_mask) { | ||
495 | tmp &= ~irq_mask; | ||
496 | writel(tmp, ioaddr + 0x48); | ||
497 | readl(ioaddr + 0x48); /* flush */ | ||
498 | } | ||
499 | writel(0, ioaddr + 0x148); | ||
500 | writel(0, ioaddr + 0x1C8); | ||
501 | } | ||
502 | |||
503 | writeb(0, ioaddr + 0xB4); | ||
504 | writeb(0, ioaddr + 0xF4); | ||
505 | tmpbyte = readb(ioaddr + 0x4A); | ||
506 | |||
507 | switch(tmpbyte & 0x30) { | ||
508 | case 0x00: | ||
509 | /* In 100 MHz clocking, try and switch to 133 */ | ||
510 | writeb(tmpbyte|0x10, ioaddr + 0x4A); | ||
511 | break; | ||
512 | case 0x10: | ||
513 | /* On 133Mhz clocking */ | ||
514 | break; | ||
515 | case 0x20: | ||
516 | /* On PCIx2 clocking */ | ||
517 | break; | ||
518 | case 0x30: | ||
519 | /* Clocking is disabled */ | ||
520 | /* 133 clock attempt to force it on */ | ||
521 | writeb(tmpbyte & ~0x20, ioaddr + 0x4A); | ||
522 | break; | ||
523 | } | ||
524 | |||
525 | tmpbyte = readb(ioaddr + 0x4A); | ||
526 | |||
527 | writeb( 0x72, ioaddr + 0xA1); | ||
528 | writew( 0x328A, ioaddr + 0xA2); | ||
529 | writel(0x62DD62DD, ioaddr + 0xA4); | ||
530 | writel(0x43924392, ioaddr + 0xA8); | ||
531 | writel(0x40094009, ioaddr + 0xAC); | ||
532 | writeb( 0x72, ioaddr + 0xE1); | ||
533 | writew( 0x328A, ioaddr + 0xE2); | ||
534 | writel(0x62DD62DD, ioaddr + 0xE4); | ||
535 | writel(0x43924392, ioaddr + 0xE8); | ||
536 | writel(0x40094009, ioaddr + 0xEC); | ||
537 | |||
538 | if (pdev_is_sata(dev)) { | ||
539 | writel(0xFFFF0000, ioaddr + 0x108); | ||
540 | writel(0xFFFF0000, ioaddr + 0x188); | ||
541 | writel(0x00680000, ioaddr + 0x148); | ||
542 | writel(0x00680000, ioaddr + 0x1C8); | ||
543 | } | ||
544 | |||
545 | proc_reports_siimage(dev, (tmpbyte>>4), name); | ||
546 | return 1; | 502 | return 1; |
547 | } | 503 | } |
548 | 504 | ||
@@ -557,50 +513,80 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name) | |||
557 | 513 | ||
558 | static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, const char *name) | 514 | static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, const char *name) |
559 | { | 515 | { |
560 | u8 rev = dev->revision, tmpbyte = 0, BA5_EN = 0; | 516 | unsigned long base, scsc_addr; |
517 | void __iomem *ioaddr = NULL; | ||
518 | u8 rev = dev->revision, tmp = 0, BA5_EN = 0; | ||
561 | 519 | ||
562 | pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, rev ? 1 : 255); | 520 | pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, rev ? 1 : 255); |
563 | 521 | ||
564 | pci_read_config_byte(dev, 0x8A, &BA5_EN); | 522 | pci_read_config_byte(dev, 0x8A, &BA5_EN); |
565 | if ((BA5_EN & 0x01) || (pci_resource_start(dev, 5))) { | 523 | |
566 | if (setup_mmio_siimage(dev, name)) { | 524 | if ((BA5_EN & 0x01) || pci_resource_start(dev, 5)) { |
567 | return 0; | 525 | if (setup_mmio_siimage(dev, name)) |
526 | ioaddr = pci_get_drvdata(dev); | ||
527 | } | ||
528 | |||
529 | base = (unsigned long)ioaddr; | ||
530 | |||
531 | if (ioaddr && pdev_is_sata(dev)) { | ||
532 | u32 tmp32, irq_mask; | ||
533 | |||
534 | /* make sure IDE0/1 interrupts are not masked */ | ||
535 | irq_mask = (1 << 22) | (1 << 23); | ||
536 | tmp32 = readl(ioaddr + 0x48); | ||
537 | if (tmp32 & irq_mask) { | ||
538 | tmp32 &= ~irq_mask; | ||
539 | writel(tmp32, ioaddr + 0x48); | ||
540 | readl(ioaddr + 0x48); /* flush */ | ||
568 | } | 541 | } |
542 | writel(0, ioaddr + 0x148); | ||
543 | writel(0, ioaddr + 0x1C8); | ||
569 | } | 544 | } |
570 | 545 | ||
571 | pci_write_config_byte(dev, 0x80, 0x00); | 546 | sil_iowrite8(dev, 0, base ? (base + 0xB4) : 0x80); |
572 | pci_write_config_byte(dev, 0x84, 0x00); | 547 | sil_iowrite8(dev, 0, base ? (base + 0xF4) : 0x84); |
573 | pci_read_config_byte(dev, 0x8A, &tmpbyte); | 548 | |
574 | switch(tmpbyte & 0x30) { | 549 | scsc_addr = base ? (base + 0x4A) : 0x8A; |
575 | case 0x00: | 550 | tmp = sil_ioread8(dev, scsc_addr); |
576 | /* 133 clock attempt to force it on */ | 551 | |
577 | pci_write_config_byte(dev, 0x8A, tmpbyte|0x10); | 552 | switch (tmp & 0x30) { |
578 | case 0x30: | 553 | case 0x00: |
579 | /* if clocking is disabled */ | 554 | /* On 100MHz clocking, try and switch to 133MHz */ |
580 | /* 133 clock attempt to force it on */ | 555 | sil_iowrite8(dev, tmp | 0x10, scsc_addr); |
581 | pci_write_config_byte(dev, 0x8A, tmpbyte & ~0x20); | 556 | break; |
582 | case 0x10: | 557 | case 0x30: |
583 | /* 133 already */ | 558 | /* Clocking is disabled, attempt to force 133MHz clocking. */ |
584 | break; | 559 | sil_iowrite8(dev, tmp & ~0x20, scsc_addr); |
585 | case 0x20: | 560 | case 0x10: |
586 | /* BIOS set PCI x2 clocking */ | 561 | /* On 133Mhz clocking. */ |
587 | break; | 562 | break; |
563 | case 0x20: | ||
564 | /* On PCIx2 clocking. */ | ||
565 | break; | ||
588 | } | 566 | } |
589 | 567 | ||
590 | pci_read_config_byte(dev, 0x8A, &tmpbyte); | 568 | tmp = sil_ioread8(dev, scsc_addr); |
591 | 569 | ||
592 | pci_write_config_byte(dev, 0xA1, 0x72); | 570 | sil_iowrite8(dev, 0x72, base + 0xA1); |
593 | pci_write_config_word(dev, 0xA2, 0x328A); | 571 | sil_iowrite16(dev, 0x328A, base + 0xA2); |
594 | pci_write_config_dword(dev, 0xA4, 0x62DD62DD); | 572 | sil_iowrite32(dev, 0x62DD62DD, base + 0xA4); |
595 | pci_write_config_dword(dev, 0xA8, 0x43924392); | 573 | sil_iowrite32(dev, 0x43924392, base + 0xA8); |
596 | pci_write_config_dword(dev, 0xAC, 0x40094009); | 574 | sil_iowrite32(dev, 0x40094009, base + 0xAC); |
597 | pci_write_config_byte(dev, 0xB1, 0x72); | 575 | sil_iowrite8(dev, 0x72, base ? (base + 0xE1) : 0xB1); |
598 | pci_write_config_word(dev, 0xB2, 0x328A); | 576 | sil_iowrite16(dev, 0x328A, base ? (base + 0xE2) : 0xB2); |
599 | pci_write_config_dword(dev, 0xB4, 0x62DD62DD); | 577 | sil_iowrite32(dev, 0x62DD62DD, base ? (base + 0xE4) : 0xB4); |
600 | pci_write_config_dword(dev, 0xB8, 0x43924392); | 578 | sil_iowrite32(dev, 0x43924392, base ? (base + 0xE8) : 0xB8); |
601 | pci_write_config_dword(dev, 0xBC, 0x40094009); | 579 | sil_iowrite32(dev, 0x40094009, base ? (base + 0xEC) : 0xBC); |
580 | |||
581 | if (base && pdev_is_sata(dev)) { | ||
582 | writel(0xFFFF0000, ioaddr + 0x108); | ||
583 | writel(0xFFFF0000, ioaddr + 0x188); | ||
584 | writel(0x00680000, ioaddr + 0x148); | ||
585 | writel(0x00680000, ioaddr + 0x1C8); | ||
586 | } | ||
587 | |||
588 | proc_reports_siimage(dev, tmp >> 4, name); | ||
602 | 589 | ||
603 | proc_reports_siimage(dev, (tmpbyte>>4), name); | ||
604 | return 0; | 590 | return 0; |
605 | } | 591 | } |
606 | 592 | ||
@@ -752,12 +738,7 @@ static u8 __devinit sil_cable_detect(ide_hwif_t *hwif) | |||
752 | { | 738 | { |
753 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 739 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
754 | unsigned long addr = siimage_selreg(hwif, 0); | 740 | unsigned long addr = siimage_selreg(hwif, 0); |
755 | u8 ata66 = 0; | 741 | u8 ata66 = sil_ioread8(dev, addr); |
756 | |||
757 | if (pci_get_drvdata(dev) == NULL) | ||
758 | pci_read_config_byte(dev, addr, &ata66); | ||
759 | else | ||
760 | ata66 = hwif->INB(addr); | ||
761 | 742 | ||
762 | return (ata66 & 0x01) ? ATA_CBL_PATA80 : ATA_CBL_PATA40; | 743 | return (ata66 & 0x01) ? ATA_CBL_PATA80 : ATA_CBL_PATA40; |
763 | } | 744 | } |