diff options
Diffstat (limited to 'drivers/ide/pci/atiixp.c')
-rw-r--r-- | drivers/ide/pci/atiixp.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index 524e65de4398..982ac31fa995 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c | |||
@@ -291,8 +291,12 @@ fast_ata_pio: | |||
291 | 291 | ||
292 | static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) | 292 | static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) |
293 | { | 293 | { |
294 | u8 udma_mode = 0; | ||
295 | u8 ch = hwif->channel; | ||
296 | struct pci_dev *pdev = hwif->pci_dev; | ||
297 | |||
294 | if (!hwif->irq) | 298 | if (!hwif->irq) |
295 | hwif->irq = hwif->channel ? 15 : 14; | 299 | hwif->irq = ch ? 15 : 14; |
296 | 300 | ||
297 | hwif->autodma = 0; | 301 | hwif->autodma = 0; |
298 | hwif->tuneproc = &atiixp_tuneproc; | 302 | hwif->tuneproc = &atiixp_tuneproc; |
@@ -308,8 +312,12 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) | |||
308 | hwif->mwdma_mask = 0x06; | 312 | hwif->mwdma_mask = 0x06; |
309 | hwif->swdma_mask = 0x04; | 313 | hwif->swdma_mask = 0x04; |
310 | 314 | ||
311 | /* FIXME: proper cable detection needed */ | 315 | pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode); |
312 | hwif->udma_four = 1; | 316 | if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40) |
317 | hwif->udma_four = 1; | ||
318 | else | ||
319 | hwif->udma_four = 0; | ||
320 | |||
313 | hwif->ide_dma_host_on = &atiixp_ide_dma_host_on; | 321 | hwif->ide_dma_host_on = &atiixp_ide_dma_host_on; |
314 | hwif->ide_dma_host_off = &atiixp_ide_dma_host_off; | 322 | hwif->ide_dma_host_off = &atiixp_ide_dma_host_off; |
315 | hwif->ide_dma_check = &atiixp_dma_check; | 323 | hwif->ide_dma_check = &atiixp_dma_check; |
@@ -320,19 +328,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) | |||
320 | hwif->drives[0].autodma = hwif->autodma; | 328 | hwif->drives[0].autodma = hwif->autodma; |
321 | } | 329 | } |
322 | 330 | ||
323 | static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif) | ||
324 | { | ||
325 | |||
326 | hwif->atapi_dma = 1; | ||
327 | hwif->ultra_mask = 0x7f; | ||
328 | hwif->mwdma_mask = 0x07; | ||
329 | hwif->swdma_mask = 0x07; | ||
330 | |||
331 | if (!noautodma) | ||
332 | hwif->autodma = 1; | ||
333 | hwif->drives[0].autodma = hwif->autodma; | ||
334 | hwif->drives[1].autodma = hwif->autodma; | ||
335 | } | ||
336 | 331 | ||
337 | static ide_pci_device_t atiixp_pci_info[] __devinitdata = { | 332 | static ide_pci_device_t atiixp_pci_info[] __devinitdata = { |
338 | { /* 0 */ | 333 | { /* 0 */ |
@@ -343,12 +338,13 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = { | |||
343 | .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, | 338 | .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, |
344 | .bootable = ON_BOARD, | 339 | .bootable = ON_BOARD, |
345 | },{ /* 1 */ | 340 | },{ /* 1 */ |
346 | .name = "ATI SB600 SATA Legacy IDE", | 341 | .name = "SB600_PATA", |
347 | .init_hwif = init_hwif_sb600_legacy, | 342 | .init_hwif = init_hwif_atiixp, |
348 | .channels = 2, | 343 | .channels = 1, |
349 | .autodma = AUTODMA, | 344 | .autodma = AUTODMA, |
350 | .bootable = ON_BOARD, | 345 | .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}}, |
351 | } | 346 | .bootable = ON_BOARD, |
347 | }, | ||
352 | }; | 348 | }; |
353 | 349 | ||
354 | /** | 350 | /** |
@@ -369,7 +365,7 @@ static struct pci_device_id atiixp_pci_tbl[] = { | |||
369 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 365 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
370 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 366 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
371 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 367 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
372 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 368 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, |
373 | { 0, }, | 369 | { 0, }, |
374 | }; | 370 | }; |
375 | MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); | 371 | MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); |
@@ -380,7 +376,7 @@ static struct pci_driver driver = { | |||
380 | .probe = atiixp_init_one, | 376 | .probe = atiixp_init_one, |
381 | }; | 377 | }; |
382 | 378 | ||
383 | static int atiixp_ide_init(void) | 379 | static int __init atiixp_ide_init(void) |
384 | { | 380 | { |
385 | return ide_pci_register_driver(&driver); | 381 | return ide_pci_register_driver(&driver); |
386 | } | 382 | } |