diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index 3cb69d5..7fa6164 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c @@ -270,9 +270,11 @@ static void sil_bmdma_stop(struct ata_queued_cmd *qc) struct ata_port *ap = qc->ap; void __iomem *mmio_base = ap->host->iomap[SIL_MMIO_BAR]; void __iomem *bmdma2 = mmio_base + sil_port[ap->port_no].bmdma2; + u32 tmp; /* clear start/stop bit - can safely always write 0 */ - iowrite8(0, bmdma2); + tmp = ioread32(bmdma2) & 0xffffff00; + iowrite32(tmp | 0, bmdma2); /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */ ata_sff_dma_pause(ap); @@ -296,14 +298,17 @@ static void sil_bmdma_start(struct ata_queued_cmd *qc) struct ata_port *ap = qc->ap; void __iomem *mmio_base = ap->host->iomap[SIL_MMIO_BAR]; void __iomem *bmdma2 = mmio_base + sil_port[ap->port_no].bmdma2; - u8 dmactl = ATA_DMA_START; + u32 dmactl = ATA_DMA_START; + u32 tmp; /* set transfer direction, start host DMA transaction Note: For Large Block Transfer to work, the DMA must be started using the bmdma2 register. */ if (!rw) dmactl |= ATA_DMA_WR; - iowrite8(dmactl, bmdma2); + + tmp = ioread32(bmdma2) & 0xffffff00; + iowrite32(tmp | dmactl, bmdma2); } /* The way God intended PCI IDE scatter/gather lists to look and behave... */ @@ -571,13 +576,13 @@ static void sil_freeze(struct ata_port *ap) * This is because the controller will not give us access to the * taskfile registers while a DMA is in progress */ - iowrite8(ioread8(ap->ioaddr.bmdma_addr) & ~SIL_DMA_ENABLE, - ap->ioaddr.bmdma_addr); + tmp = ioread32(ap->ioaddr.bmdma_addr); + iowrite32(tmp & ~SIL_DMA_ENABLE, ap->ioaddr.bmdma_addr); /* According to ata_bmdma_stop, an HDMA transition requires * on PIO cycle. But we can't read a taskfile register. */ - ioread8(ap->ioaddr.bmdma_addr); + ioread32(ap->ioaddr.bmdma_addr); } static void sil_thaw(struct ata_port *ap) @@ -667,7 +672,7 @@ static void sil_init_controller(struct ata_host *host) { struct pci_dev *pdev = to_pci_dev(host->dev); void __iomem *mmio_base = host->iomap[SIL_MMIO_BAR]; - u8 cls; + u32 cls; u32 tmp; int i; @@ -676,9 +681,12 @@ static void sil_init_controller(struct ata_host *host) if (cls) { cls >>= 3; cls++; /* cls = (line_size/8)+1 */ - for (i = 0; i < host->n_ports; i++) - writew(cls << 8 | cls, + for (i = 0; i < host->n_ports; i++) { + tmp = readl(mmio_base + sil_port[i].fifo_cfg) & + 0xffff0000; + writel(tmp | cls << 8 | cls, mmio_base + sil_port[i].fifo_cfg); + } } else dev_printk(KERN_WARNING, &pdev->dev, "cache line size not set. Driver may not function\n");