aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-dma.c14
-rw-r--r--drivers/ide/pci/sgiioc4.c20
-rw-r--r--drivers/ide/pci/siimage.c1
-rw-r--r--include/linux/ide.h1
4 files changed, 10 insertions, 26 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 9069766f236e..56efed6742d4 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -799,8 +799,6 @@ static int ide_release_iomio_dma(ide_hwif_t *hwif)
799 release_region(hwif->dma_base, 8); 799 release_region(hwif->dma_base, 8);
800 if (hwif->extra_ports) 800 if (hwif->extra_ports)
801 release_region(hwif->extra_base, hwif->extra_ports); 801 release_region(hwif->extra_base, hwif->extra_ports);
802 if (hwif->dma_base2)
803 release_region(hwif->dma_base, 8);
804 return 1; 802 return 1;
805} 803}
806 804
@@ -872,19 +870,9 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int port
872 } 870 }
873 871
874 if(hwif->mate) 872 if(hwif->mate)
875 hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base; 873 hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base:base;
876 else 874 else
877 hwif->dma_master = base; 875 hwif->dma_master = base;
878 if (hwif->dma_base2) {
879 if (!request_region(hwif->dma_base2, ports, hwif->name))
880 {
881 printk(" -- Error, secondary ports in use.\n");
882 release_region(base, ports);
883 if (hwif->extra_ports)
884 release_region(hwif->extra_base, hwif->extra_ports);
885 return 1;
886 }
887 }
888 return 0; 876 return 0;
889} 877}
890 878
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index d8a0d87df734..f3fe287fbd89 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -220,7 +220,7 @@ sgiioc4_ide_dma_end(ide_drive_t * drive)
220 ide_hwif_t *hwif = HWIF(drive); 220 ide_hwif_t *hwif = HWIF(drive);
221 u64 dma_base = hwif->dma_base; 221 u64 dma_base = hwif->dma_base;
222 int dma_stat = 0; 222 int dma_stat = 0;
223 unsigned long *ending_dma = (unsigned long *) hwif->dma_base2; 223 unsigned long *ending_dma = ide_get_hwifdata(hwif);
224 224
225 hwif->OUTL(IOC4_S_DMA_STOP, dma_base + IOC4_DMA_CTRL * 4); 225 hwif->OUTL(IOC4_S_DMA_STOP, dma_base + IOC4_DMA_CTRL * 4);
226 226
@@ -369,6 +369,7 @@ ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
369{ 369{
370 void __iomem *virt_dma_base; 370 void __iomem *virt_dma_base;
371 int num_ports = sizeof (ioc4_dma_regs_t); 371 int num_ports = sizeof (ioc4_dma_regs_t);
372 void *pad;
372 373
373 printk(KERN_INFO "%s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name, 374 printk(KERN_INFO "%s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name,
374 dma_base, dma_base + num_ports - 1); 375 dma_base, dma_base + num_ports - 1);
@@ -400,17 +401,14 @@ ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
400 401
401 hwif->sg_max_nents = IOC4_PRD_ENTRIES; 402 hwif->sg_max_nents = IOC4_PRD_ENTRIES;
402 403
403 hwif->dma_base2 = (unsigned long) 404 pad = pci_alloc_consistent(hwif->pci_dev, IOC4_IDE_CACHELINE_SIZE,
404 pci_alloc_consistent(hwif->pci_dev, 405 (dma_addr_t *) &(hwif->dma_status));
405 IOC4_IDE_CACHELINE_SIZE,
406 (dma_addr_t *) &(hwif->dma_status));
407 406
408 if (!hwif->dma_base2) 407 if (pad) {
409 goto dma_base2alloc_failure; 408 ide_set_hwifdata(hwif, pad);
410 409 return;
411 return; 410 }
412 411
413dma_base2alloc_failure:
414 pci_free_consistent(hwif->pci_dev, 412 pci_free_consistent(hwif->pci_dev,
415 IOC4_PRD_ENTRIES * IOC4_PRD_BYTES, 413 IOC4_PRD_ENTRIES * IOC4_PRD_BYTES,
416 hwif->dmatable_cpu, hwif->dmatable_dma); 414 hwif->dmatable_cpu, hwif->dmatable_dma);
@@ -476,7 +474,7 @@ sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive)
476 hwif->OUTL(dma_addr, dma_base + IOC4_DMA_PTR_L * 4); 474 hwif->OUTL(dma_addr, dma_base + IOC4_DMA_PTR_L * 4);
477 475
478 /* Address of the Ending DMA */ 476 /* Address of the Ending DMA */
479 memset((unsigned int *) hwif->dma_base2, 0, IOC4_IDE_CACHELINE_SIZE); 477 memset(ide_get_hwifdata(hwif), 0, IOC4_IDE_CACHELINE_SIZE);
480 ending_dma_addr = cpu_to_le32(hwif->dma_status); 478 ending_dma_addr = cpu_to_le32(hwif->dma_status);
481 hwif->OUTL(ending_dma_addr, dma_base + IOC4_DMA_END_ADDR * 4); 479 hwif->OUTL(ending_dma_addr, dma_base + IOC4_DMA_END_ADDR * 4);
482 480
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 20b392948f36..697f566fb90a 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -898,7 +898,6 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
898 base = (unsigned long) addr; 898 base = (unsigned long) addr;
899 899
900 hwif->dma_base = base + (ch ? 0x08 : 0x00); 900 hwif->dma_base = base + (ch ? 0x08 : 0x00);
901 hwif->dma_base2 = base + (ch ? 0x18 : 0x10);
902 hwif->mmio = 2; 901 hwif->mmio = 2;
903} 902}
904 903
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 097d16e5ab37..a9a9e33e448f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -774,7 +774,6 @@ typedef struct hwif_s {
774 unsigned long dma_status; /* dma status register */ 774 unsigned long dma_status; /* dma status register */
775 unsigned long dma_vendor3; /* dma vendor 3 register */ 775 unsigned long dma_vendor3; /* dma vendor 3 register */
776 unsigned long dma_prdtable; /* actual prd table address */ 776 unsigned long dma_prdtable; /* actual prd table address */
777 unsigned long dma_base2; /* extended base addr for dma ports */
778 777
779 unsigned long config_data; /* for use by chipset-specific code */ 778 unsigned long config_data; /* for use by chipset-specific code */
780 unsigned long select_data; /* for use by chipset-specific code */ 779 unsigned long select_data; /* for use by chipset-specific code */