aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorJose Alberto Reguero <jareguero@telefonica.net>2008-03-13 18:22:24 -0400
committerJeff Garzik <jeff@garzik.org>2008-03-17 08:30:32 -0400
commitc40e7cb89f9d36924131ef708ff1f16a76611add (patch)
treed5a9348c45c037e1c9224a00c2937f5c718fd8ed /drivers/ata
parent4a38e733a75d52e84772fc00d88e32032a235e75 (diff)
ahci: Add Marvell 6121 SATA support
Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ahci.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index bbfccdbba3ab..17ee6ed985d9 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -591,6 +591,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
591 591
592 /* Marvell */ 592 /* Marvell */
593 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ 593 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */
594 { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */
594 595
595 /* Generic, PCI class code for AHCI */ 596 /* Generic, PCI class code for AHCI */
596 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 597 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
@@ -665,6 +666,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
665 void __iomem *mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR]; 666 void __iomem *mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR];
666 u32 cap, port_map; 667 u32 cap, port_map;
667 int i; 668 int i;
669 int mv;
668 670
669 /* make sure AHCI mode is enabled before accessing CAP */ 671 /* make sure AHCI mode is enabled before accessing CAP */
670 ahci_enable_ahci(mmio); 672 ahci_enable_ahci(mmio);
@@ -700,12 +702,16 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
700 * presence register, as bit 4 (counting from 0) 702 * presence register, as bit 4 (counting from 0)
701 */ 703 */
702 if (hpriv->flags & AHCI_HFLAG_MV_PATA) { 704 if (hpriv->flags & AHCI_HFLAG_MV_PATA) {
705 if (pdev->device == 0x6121)
706 mv = 0x3;
707 else
708 mv = 0xf;
703 dev_printk(KERN_ERR, &pdev->dev, 709 dev_printk(KERN_ERR, &pdev->dev,
704 "MV_AHCI HACK: port_map %x -> %x\n", 710 "MV_AHCI HACK: port_map %x -> %x\n",
705 hpriv->port_map, 711 port_map,
706 hpriv->port_map & 0xf); 712 port_map & mv);
707 713
708 port_map &= 0xf; 714 port_map &= mv;
709 } 715 }
710 716
711 /* cross check port_map and cap.n_ports */ 717 /* cross check port_map and cap.n_ports */
@@ -1172,9 +1178,14 @@ static void ahci_init_controller(struct ata_host *host)
1172 int i; 1178 int i;
1173 void __iomem *port_mmio; 1179 void __iomem *port_mmio;
1174 u32 tmp; 1180 u32 tmp;
1181 int mv;
1175 1182
1176 if (hpriv->flags & AHCI_HFLAG_MV_PATA) { 1183 if (hpriv->flags & AHCI_HFLAG_MV_PATA) {
1177 port_mmio = __ahci_port_base(host, 4); 1184 if (pdev->device == 0x6121)
1185 mv = 2;
1186 else
1187 mv = 4;
1188 port_mmio = __ahci_port_base(host, mv);
1178 1189
1179 writel(0, port_mmio + PORT_IRQ_MASK); 1190 writel(0, port_mmio + PORT_IRQ_MASK);
1180 1191