Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172866
b: refs/heads/master
c: 5600c70
h: refs/heads/master
v: v3
  • Loading branch information
Sergei Shtylyov authored and Jeff Garzik committed Dec 3, 2009
1 parent 71910f6 commit 62f4745
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8e182a90f91456335756d2ce304ad470795d98e1
refs/heads/master: 5600c70e576199a7552e1c0fff43f3fe16f5566e
32 changes: 15 additions & 17 deletions trunk/drivers/ata/pata_hpt37x.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_hpt37x"
#define DRV_VERSION "0.6.12"
#define DRV_VERSION "0.6.14"

struct hpt_clock {
u8 xfer_speed;
Expand Down Expand Up @@ -411,9 +411,8 @@ static void hpt370_set_piomode(struct ata_port *ap, struct ata_device *adev)

pci_read_config_dword(pdev, addr1, &reg);
mode = hpt37x_find_mode(ap, adev->pio_mode);
mode &= ~0x8000000; /* No FIFO in PIO */
mode &= ~0x30070000; /* Leave config bits alone */
reg &= 0x30070000; /* Strip timing bits */
mode &= 0xCFC3FFFF; /* Leave DMA bits alone */
reg &= ~0xCFC3FFFF; /* Strip timing bits */
pci_write_config_dword(pdev, addr1, reg | mode);
}

Expand All @@ -430,8 +429,7 @@ static void hpt370_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 addr1, addr2;
u32 reg;
u32 mode;
u32 reg, mode, mask;
u8 fast;

addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
Expand All @@ -443,11 +441,12 @@ static void hpt370_set_dmamode(struct ata_port *ap, struct ata_device *adev)
fast |= 0x01;
pci_write_config_byte(pdev, addr2, fast);

mask = adev->dma_mode < XFER_UDMA_0 ? 0x31C001FF : 0x303C0000;

pci_read_config_dword(pdev, addr1, &reg);
mode = hpt37x_find_mode(ap, adev->dma_mode);
mode |= 0x8000000; /* FIFO in MWDMA or UDMA */
mode &= ~0xC0000000; /* Leave config bits alone */
reg &= 0xC0000000; /* Strip timing bits */
mode &= mask;
reg &= ~mask;
pci_write_config_dword(pdev, addr1, reg | mode);
}

Expand Down Expand Up @@ -515,9 +514,8 @@ static void hpt372_set_piomode(struct ata_port *ap, struct ata_device *adev)
mode = hpt37x_find_mode(ap, adev->pio_mode);

printk("Find mode for %d reports %X\n", adev->pio_mode, mode);
mode &= ~0x80000000; /* No FIFO in PIO */
mode &= ~0x30070000; /* Leave config bits alone */
reg &= 0x30070000; /* Strip timing bits */
mode &= 0xCFC3FFFF; /* Leave DMA bits alone */
reg &= ~0xCFC3FFFF; /* Strip timing bits */
pci_write_config_dword(pdev, addr1, reg | mode);
}

Expand All @@ -534,8 +532,7 @@ static void hpt372_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 addr1, addr2;
u32 reg;
u32 mode;
u32 reg, mode, mask;
u8 fast;

addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
Expand All @@ -546,12 +543,13 @@ static void hpt372_set_dmamode(struct ata_port *ap, struct ata_device *adev)
fast &= ~0x07;
pci_write_config_byte(pdev, addr2, fast);

mask = adev->dma_mode < XFER_UDMA_0 ? 0x31C001FF : 0x303C0000;

pci_read_config_dword(pdev, addr1, &reg);
mode = hpt37x_find_mode(ap, adev->dma_mode);
printk("Find mode for DMA %d reports %X\n", adev->dma_mode, mode);
mode &= ~0xC0000000; /* Leave config bits alone */
mode |= 0x80000000; /* FIFO in MWDMA or UDMA */
reg &= 0xC0000000; /* Strip timing bits */
mode &= mask;
reg &= ~mask;
pci_write_config_dword(pdev, addr1, reg | mode);
}

Expand Down
17 changes: 8 additions & 9 deletions trunk/drivers/ata/pata_hpt3x2n.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_hpt3x2n"
#define DRV_VERSION "0.3.4"
#define DRV_VERSION "0.3.7"

enum {
HPT_PCI_FAST = (1 << 31),
Expand Down Expand Up @@ -188,9 +188,8 @@ static void hpt3x2n_set_piomode(struct ata_port *ap, struct ata_device *adev)

pci_read_config_dword(pdev, addr1, &reg);
mode = hpt3x2n_find_mode(ap, adev->pio_mode);
mode &= ~0x8000000; /* No FIFO in PIO */
mode &= ~0x30070000; /* Leave config bits alone */
reg &= 0x30070000; /* Strip timing bits */
mode &= 0xCFC3FFFF; /* Leave DMA bits alone */
reg &= ~0xCFC3FFFF; /* Strip timing bits */
pci_write_config_dword(pdev, addr1, reg | mode);
}

Expand All @@ -207,8 +206,7 @@ static void hpt3x2n_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 addr1, addr2;
u32 reg;
u32 mode;
u32 reg, mode, mask;
u8 fast;

addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
Expand All @@ -219,11 +217,12 @@ static void hpt3x2n_set_dmamode(struct ata_port *ap, struct ata_device *adev)
fast &= ~0x07;
pci_write_config_byte(pdev, addr2, fast);

mask = adev->dma_mode < XFER_UDMA_0 ? 0x31C001FF : 0x303C0000;

pci_read_config_dword(pdev, addr1, &reg);
mode = hpt3x2n_find_mode(ap, adev->dma_mode);
mode |= 0x8000000; /* FIFO in MWDMA or UDMA */
mode &= ~0xC0000000; /* Leave config bits alone */
reg &= 0xC0000000; /* Strip timing bits */
mode &= mask;
reg &= ~mask;
pci_write_config_dword(pdev, addr1, reg | mode);
}

Expand Down

0 comments on commit 62f4745

Please sign in to comment.