Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 904c04fe authored by Richard Zhu's avatar Richard Zhu Committed by Jeff Garzik
Browse files

[libata] ahci_platform: Add the board_ids and pi refer to different features



On imx53 AHCI, soft reset fails with IPMS set when PMP
is enabled but SATA HDD/ODD is connected to SATA port,
do soft reset again to port 0.
So the 'ahci_pmp_retry_srst_ops' is required when imx53
ahci is present.

Signed-off-by: default avatarRichard Zhu <richard.zhu@linaro.org>
Acked-by: default avatarEric Miao <eric.miao@linaro.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent e8411fba
Loading
Loading
Loading
Loading
+38 −6
Original line number Diff line number Diff line
@@ -23,20 +23,51 @@
#include <linux/ahci_platform.h>
#include "ahci.h"

static struct scsi_host_template ahci_platform_sht = {
	AHCI_SHT("ahci_platform"),
enum ahci_type {
	AHCI,		/* standard platform ahci */
	IMX53_AHCI,	/* ahci on i.mx53 */
};

static int __init ahci_probe(struct platform_device *pdev)
static struct platform_device_id ahci_devtype[] = {
	{
	struct device *dev = &pdev->dev;
	struct ahci_platform_data *pdata = dev->platform_data;
	struct ata_port_info pi = {
		.name = "ahci",
		.driver_data = AHCI,
	}, {
		.name = "imx53-ahci",
		.driver_data = IMX53_AHCI,
	}, {
		/* sentinel */
	}
};
MODULE_DEVICE_TABLE(platform, ahci_devtype);


static const struct ata_port_info ahci_port_info[] = {
	/* by features */
	[AHCI] = {
		.flags		= AHCI_FLAG_COMMON,
		.pio_mask	= ATA_PIO4,
		.udma_mask	= ATA_UDMA6,
		.port_ops	= &ahci_ops,
	},
	[IMX53_AHCI] = {
		.flags		= AHCI_FLAG_COMMON,
		.pio_mask	= ATA_PIO4,
		.udma_mask	= ATA_UDMA6,
		.port_ops	= &ahci_pmp_retry_srst_ops,
	},
};

static struct scsi_host_template ahci_platform_sht = {
	AHCI_SHT("ahci_platform"),
};

static int __init ahci_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct ahci_platform_data *pdata = dev->platform_data;
	const struct platform_device_id *id = platform_get_device_id(pdev);
	struct ata_port_info pi = ahci_port_info[id->driver_data];
	const struct ata_port_info *ppi[] = { &pi, NULL };
	struct ahci_host_priv *hpriv;
	struct ata_host *host;
@@ -177,6 +208,7 @@ static struct platform_driver ahci_driver = {
		.name = "ahci",
		.owner = THIS_MODULE,
	},
	.id_table	= ahci_devtype,
};

static int __init ahci_init(void)