/* * AHCI glue platform driver for Marvell EBU SOCs * * Copyright (C) 2014 Marvell * * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> * Marcin Wojtas <mw@semihalf.com> * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied.
*/
staticvoid ahci_mvebu_regret_option(struct ahci_host_priv *hpriv)
{ /* * Enable the regret bit to allow the SATA unit to regret a * request that didn't receive an acknowlegde and avoid a * deadlock
*/
writel(0x4, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_ADDR);
writel(0x80, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA);
}
/** * ahci_mvebu_stop_engine * * @ap: Target ata port * * Errata Ref#226 - SATA Disk HOT swap issue when connected through * Port Multiplier in FIS-based Switching mode. * * To avoid the issue, according to design, the bits[11:8, 0] of * register PxFBS are cleared when Port Command and Status (0x18) bit[0] * changes its value from 1 to 0, i.e. falling edge of Port * Command and Status bit[0] sends PULSE that resets PxFBS * bits[11:8; 0]. * * This function is used to override function of "ahci_stop_engine" * from libahci.c by adding the mvebu work around(WA) to save PxFBS * value before the PxCMD ST write of 0, then restore PxFBS value. * * Return: 0 on success; Error code otherwise.
*/ staticint ahci_mvebu_stop_engine(struct ata_port *ap)
{ void __iomem *port_mmio = ahci_port_base(ap);
u32 tmp, port_fbs;
tmp = readl(port_mmio + PORT_CMD);
/* check if the HBA is idle */ if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0) return 0;
/* save the port PxFBS register for later restore */
port_fbs = readl(port_mmio + PORT_FBS);
/* * bit #15 PxCMD signal doesn't clear PxFBS, * restore the PxFBS register right after clearing the PxCMD ST, * no need to wait for the PxCMD bit #15.
*/
writel(port_fbs, port_mmio + PORT_FBS);
/* wait for engine to stop. This could be as long as 500 msec */
tmp = ata_wait_register(ap, port_mmio + PORT_CMD,
PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500); if (tmp & PORT_CMD_LIST_ON) return -EIO;
MODULE_DESCRIPTION("Marvell EBU AHCI SATA driver");
MODULE_AUTHOR("Thomas Petazzoni , Marcin Wojtas ");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:ahci_mvebu");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.