El Martes, 11 de Marzo de 2008, Jose Alberto Reguero escribió: > El Martes, 11 de Marzo de 2008, Jeff Garzik escribió: > > Mourad De Clerck wrote: > > > Hello, > > > > > > I was wondering what the status was of Marvell 6121 SATA support. I've > > > seen earlier messages saying it was pretty much working with the AHCI > > > driver, and that it would be merged in mainline soon, but that was in > > > 2.6.22 times. > > > > > > I've not seen support for it in 2.6.25-rc5's ahci, so I guess I > > > shouldn't expect it in 2.6.25? > > > > I would just add the PCI ID to ahci.c, it should most likely work... > > > > Jeff > > I use this patch for kernels 2.6.25-rc > > Jose Alberto Attached is a patch against 2.6.25-rc5 kernel to add suport for Marvell 6121 SATA. Signed-off-by: Jose Alberto Reguero <jareguero@xxxxxxxxxxxxxx> Jose Alberto
--- linux-2.6.25-rc5/drivers/ata/ahci.c 2008-03-10 06:22:27.000000000 +0100 +++ linux-2.6.25-rc5.new/drivers/ata/ahci.c 2008-03-13 22:06:22.000000000 +0100 @@ -575,6 +575,7 @@ /* Marvell */ { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ + { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ /* Generic, PCI class code for AHCI */ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, @@ -649,6 +650,7 @@ void __iomem *mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR]; u32 cap, port_map; int i; + int mv; /* make sure AHCI mode is enabled before accessing CAP */ ahci_enable_ahci(mmio); @@ -684,12 +686,16 @@ * presence register, as bit 4 (counting from 0) */ if (hpriv->flags & AHCI_HFLAG_MV_PATA) { + if (pdev->device == 0x6121) + mv = 0x3; + else + mv = 0xf; dev_printk(KERN_ERR, &pdev->dev, "MV_AHCI HACK: port_map %x -> %x\n", - hpriv->port_map, - hpriv->port_map & 0xf); + port_map, + port_map & mv); - port_map &= 0xf; + port_map &= mv; } /* cross check port_map and cap.n_ports */ @@ -1150,9 +1156,14 @@ int i; void __iomem *port_mmio; u32 tmp; + int mv; if (hpriv->flags & AHCI_HFLAG_MV_PATA) { - port_mmio = __ahci_port_base(host, 4); + if (pdev->device == 0x6121) + mv = 2; + else + mv = 4; + port_mmio = __ahci_port_base(host, mv); writel(0, port_mmio + PORT_IRQ_MASK);