aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci_platform.c
diff options
context:
space:
mode:
authorRichard Zhu <richard.zhu@linaro.org>2011-09-28 03:41:54 -0400
committerJeff Garzik <jgarzik@redhat.com>2011-10-08 00:07:15 -0400
commit904c04feaf13ed58790a34a0b11cd7b885b94b4b (patch)
tree503a2711d23b655246e4b296ad5bd8480719b741 /drivers/ata/ahci_platform.c
parente8411fbad67a6fe3f989cf6391df7c72bf4a1f9e (diff)
[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: Richard Zhu <richard.zhu@linaro.org> Acked-by: Eric Miao <eric.miao@linaro.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/ahci_platform.c')
-rw-r--r--drivers/ata/ahci_platform.c44
1 files changed, 38 insertions, 6 deletions
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 6fef1fa75c54..c03277d37748 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -23,6 +23,41 @@
23#include <linux/ahci_platform.h> 23#include <linux/ahci_platform.h>
24#include "ahci.h" 24#include "ahci.h"
25 25
26enum ahci_type {
27 AHCI, /* standard platform ahci */
28 IMX53_AHCI, /* ahci on i.mx53 */
29};
30
31static struct platform_device_id ahci_devtype[] = {
32 {
33 .name = "ahci",
34 .driver_data = AHCI,
35 }, {
36 .name = "imx53-ahci",
37 .driver_data = IMX53_AHCI,
38 }, {
39 /* sentinel */
40 }
41};
42MODULE_DEVICE_TABLE(platform, ahci_devtype);
43
44
45static const struct ata_port_info ahci_port_info[] = {
46 /* by features */
47 [AHCI] = {
48 .flags = AHCI_FLAG_COMMON,
49 .pio_mask = ATA_PIO4,
50 .udma_mask = ATA_UDMA6,
51 .port_ops = &ahci_ops,
52 },
53 [IMX53_AHCI] = {
54 .flags = AHCI_FLAG_COMMON,
55 .pio_mask = ATA_PIO4,
56 .udma_mask = ATA_UDMA6,
57 .port_ops = &ahci_pmp_retry_srst_ops,
58 },
59};
60
26static struct scsi_host_template ahci_platform_sht = { 61static struct scsi_host_template ahci_platform_sht = {
27 AHCI_SHT("ahci_platform"), 62 AHCI_SHT("ahci_platform"),
28}; 63};
@@ -31,12 +66,8 @@ static int __init ahci_probe(struct platform_device *pdev)
31{ 66{
32 struct device *dev = &pdev->dev; 67 struct device *dev = &pdev->dev;
33 struct ahci_platform_data *pdata = dev->platform_data; 68 struct ahci_platform_data *pdata = dev->platform_data;
34 struct ata_port_info pi = { 69 const struct platform_device_id *id = platform_get_device_id(pdev);
35 .flags = AHCI_FLAG_COMMON, 70 struct ata_port_info pi = ahci_port_info[id->driver_data];
36 .pio_mask = ATA_PIO4,
37 .udma_mask = ATA_UDMA6,
38 .port_ops = &ahci_ops,
39 };
40 const struct ata_port_info *ppi[] = { &pi, NULL }; 71 const struct ata_port_info *ppi[] = { &pi, NULL };
41 struct ahci_host_priv *hpriv; 72 struct ahci_host_priv *hpriv;
42 struct ata_host *host; 73 struct ata_host *host;
@@ -177,6 +208,7 @@ static struct platform_driver ahci_driver = {
177 .name = "ahci", 208 .name = "ahci",
178 .owner = THIS_MODULE, 209 .owner = THIS_MODULE,
179 }, 210 },
211 .id_table = ahci_devtype,
180}; 212};
181 213
182static int __init ahci_init(void) 214static int __init ahci_init(void)