aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_mv.c
diff options
context:
space:
mode:
authorMark Lord <liml@rtr.ca>2006-05-19 16:29:21 -0400
committerJeff Garzik <jeff@garzik.org>2006-05-20 00:31:45 -0400
commiteb46d684600ac145501805a294c94675e82eab2e (patch)
treee99ef2ae9cdc1b21229e42eb075e6c5b8c60db3b /drivers/scsi/sata_mv.c
parent615ab95342f6245026d8974b9724f7ea57d9a184 (diff)
[PATCH] sata_mv: chip initialization fixes
The interface control register of the 60xx (and later) Marvell chip requires certain bits to always be set when writing to it. These bits incorrectly read-back as zeros, so the pattern must be ORed in with each write of the register. Also, bit 12 should NOT be set (note that Marvell's own driver also had bit-12 wrong here). While we're at it, we also now do pci_set_master() in the init code. Signed-off-by: Mark Lord <liml@rtr.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/sata_mv.c')
-rw-r--r--drivers/scsi/sata_mv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index 3ed2f333d5a9..bb2409e761d0 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -1885,7 +1885,8 @@ static void mv_channel_reset(struct mv_host_priv *hpriv, void __iomem *mmio,
1885 1885
1886 if (IS_60XX(hpriv)) { 1886 if (IS_60XX(hpriv)) {
1887 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); 1887 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL);
1888 ifctl |= (1 << 12) | (1 << 7); 1888 ifctl |= (1 << 7); /* enable gen2i speed */
1889 ifctl = (ifctl & 0xfff) | 0x9b1000; /* from chip spec */
1889 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); 1890 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL);
1890 } 1891 }
1891 1892
@@ -2250,7 +2251,8 @@ static int mv_init_host(struct pci_dev *pdev, struct ata_probe_ent *probe_ent,
2250 void __iomem *port_mmio = mv_port_base(mmio, port); 2251 void __iomem *port_mmio = mv_port_base(mmio, port);
2251 2252
2252 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); 2253 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL);
2253 ifctl |= (1 << 12); 2254 ifctl |= (1 << 7); /* enable gen2i speed */
2255 ifctl = (ifctl & 0xfff) | 0x9b1000; /* from chip spec */
2254 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); 2256 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL);
2255 } 2257 }
2256 2258
@@ -2351,6 +2353,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2351 if (rc) { 2353 if (rc) {
2352 return rc; 2354 return rc;
2353 } 2355 }
2356 pci_set_master(pdev);
2354 2357
2355 rc = pci_request_regions(pdev, DRV_NAME); 2358 rc = pci_request_regions(pdev, DRV_NAME);
2356 if (rc) { 2359 if (rc) {