diff options
-rw-r--r-- | drivers/ata/pata_cmd64x.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c index 15841a563694..449162cbf93e 100644 --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c | |||
@@ -197,7 +197,7 @@ static void cmd64x_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
197 | static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) | 197 | static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) |
198 | { | 198 | { |
199 | static const u8 udma_data[] = { | 199 | static const u8 udma_data[] = { |
200 | 0x31, 0x21, 0x11, 0x25, 0x15, 0x05 | 200 | 0x30, 0x20, 0x10, 0x20, 0x10, 0x00 |
201 | }; | 201 | }; |
202 | static const u8 mwdma_data[] = { | 202 | static const u8 mwdma_data[] = { |
203 | 0x30, 0x20, 0x10 | 203 | 0x30, 0x20, 0x10 |
@@ -213,12 +213,21 @@ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) | |||
213 | pci_read_config_byte(pdev, pciD, ®D); | 213 | pci_read_config_byte(pdev, pciD, ®D); |
214 | pci_read_config_byte(pdev, pciU, ®U); | 214 | pci_read_config_byte(pdev, pciU, ®U); |
215 | 215 | ||
216 | regD &= ~(0x20 << shift); | 216 | /* DMA bits off */ |
217 | regU &= ~(0x35 << shift); | 217 | regD &= ~(0x20 << adev->devno); |
218 | /* DMA control bits */ | ||
219 | regU &= ~(0x30 << shift); | ||
220 | /* DMA timing bits */ | ||
221 | regU &= ~(0x05 << adev->devno); | ||
218 | 222 | ||
219 | if (adev->dma_mode >= XFER_UDMA_0) | 223 | if (adev->dma_mode >= XFER_UDMA_0) { |
224 | /* Merge thge timing value */ | ||
220 | regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; | 225 | regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; |
221 | else | 226 | /* Merge the control bits */ |
227 | regU |= 1 << adev->devno; /* UDMA on */ | ||
228 | if (adev->dma_mode > 2) /* 15nS timing */ | ||
229 | regU |= 4 << adev->devno; | ||
230 | } else | ||
222 | regD |= mwdma_data[adev->dma_mode - XFER_MW_DMA_0] << shift; | 231 | regD |= mwdma_data[adev->dma_mode - XFER_MW_DMA_0] << shift; |
223 | 232 | ||
224 | regD |= 0x20 << adev->devno; | 233 | regD |= 0x20 << adev->devno; |
@@ -239,8 +248,8 @@ static void cmd648_bmdma_stop(struct ata_queued_cmd *qc) | |||
239 | struct ata_port *ap = qc->ap; | 248 | struct ata_port *ap = qc->ap; |
240 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 249 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
241 | u8 dma_intr; | 250 | u8 dma_intr; |
242 | int dma_reg = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; | 251 | int dma_mask = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; |
243 | int dma_mask = ap->port_no ? ARTTIM2 : CFR; | 252 | int dma_reg = ap->port_no ? ARTTIM2 : CFR; |
244 | 253 | ||
245 | ata_bmdma_stop(qc); | 254 | ata_bmdma_stop(qc); |
246 | 255 | ||