From: Richard Zhu <richard.zhu@linaro.org> To: linux-arm-kernel@lists.infradead.org Cc: jgarzik@pobox.com, kernel@pengutronix.de, linux-ide@vger.kernel.org, avorontsov@ru.mvista.com, eric@eukrea.com, eric.miao@linaro.org, Richard Zhu <richard.zhu@linaro.org> Subject: [PATCH V7 2/5] ahci_plt Add the board_ids and pi refer to different features Date: Wed, 31 Aug 2011 11:50:32 +0800 [thread overview] Message-ID: <1314762635-3923-3-git-send-email-richard.zhu@linaro.org> (raw) In-Reply-To: <1314762635-3923-1-git-send-email-richard.zhu@linaro.org> 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> --- drivers/ata/ahci_platform.c | 44 +++++++++++++++++++++++++++++++++++++----- 1 files changed, 38 insertions(+), 6 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 6fef1fa..c03277d 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -23,6 +23,41 @@ #include <linux/ahci_platform.h> #include "ahci.h" +enum ahci_type { + AHCI, /* standard platform ahci */ + IMX53_AHCI, /* ahci on i.mx53 */ +}; + +static struct platform_device_id ahci_devtype[] = { + { + .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"), }; @@ -31,12 +66,8 @@ static int __init ahci_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_platform_data *pdata = dev->platform_data; - struct ata_port_info pi = { - .flags = AHCI_FLAG_COMMON, - .pio_mask = ATA_PIO4, - .udma_mask = ATA_UDMA6, - .port_ops = &ahci_ops, - }; + 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) -- 1.7.1
WARNING: multiple messages have this Message-ID (diff)
From: richard.zhu@linaro.org (Richard Zhu) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V7 2/5] ahci_plt Add the board_ids and pi refer to different features Date: Wed, 31 Aug 2011 11:50:32 +0800 [thread overview] Message-ID: <1314762635-3923-3-git-send-email-richard.zhu@linaro.org> (raw) In-Reply-To: <1314762635-3923-1-git-send-email-richard.zhu@linaro.org> 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> --- drivers/ata/ahci_platform.c | 44 +++++++++++++++++++++++++++++++++++++----- 1 files changed, 38 insertions(+), 6 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 6fef1fa..c03277d 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -23,6 +23,41 @@ #include <linux/ahci_platform.h> #include "ahci.h" +enum ahci_type { + AHCI, /* standard platform ahci */ + IMX53_AHCI, /* ahci on i.mx53 */ +}; + +static struct platform_device_id ahci_devtype[] = { + { + .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"), }; @@ -31,12 +66,8 @@ static int __init ahci_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_platform_data *pdata = dev->platform_data; - struct ata_port_info pi = { - .flags = AHCI_FLAG_COMMON, - .pio_mask = ATA_PIO4, - .udma_mask = ATA_UDMA6, - .port_ops = &ahci_ops, - }; + 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) -- 1.7.1
next prev parent reply other threads:[~2011-08-31 3:50 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-31 3:50 [PATCH V7 0/5] imx53 ahci driver v7 Richard Zhu 2011-08-31 3:50 ` Richard Zhu 2011-08-31 3:50 ` [PATCH V7 1/5] AHCI Add the AHCI SATA feature on the MX53 platforms Richard Zhu 2011-08-31 3:50 ` Richard Zhu 2011-08-31 10:03 ` Arnaud Patard 2011-08-31 10:03 ` Arnaud Patard (Rtp) 2011-08-31 11:04 ` Eric Miao 2011-08-31 11:04 ` Eric Miao 2011-09-20 20:30 ` Sascha Hauer 2011-09-20 20:30 ` Sascha Hauer 2011-09-21 5:04 ` Richard Zhu 2011-09-21 5:04 ` Richard Zhu 2011-09-21 7:02 ` Sascha Hauer 2011-09-21 7:02 ` Sascha Hauer 2011-09-21 7:32 ` Shawn Guo 2011-09-21 7:32 ` Shawn Guo 2011-09-21 7:05 ` Richard Zhu 2011-09-21 7:05 ` Richard Zhu 2011-09-22 18:12 ` Jeff Garzik 2011-09-22 18:12 ` Jeff Garzik 2011-09-22 18:31 ` Anton Vorontsov 2011-09-22 18:31 ` Anton Vorontsov 2011-08-31 3:50 ` Richard Zhu [this message] 2011-08-31 3:50 ` [PATCH V7 2/5] ahci_plt Add the board_ids and pi refer to different features Richard Zhu 2011-08-31 8:28 ` Eric Miao 2011-08-31 8:28 ` Eric Miao 2011-08-31 3:50 ` [PATCH V7 3/5] MX53 Enable the AHCI SATA on MX53 ARD board Richard Zhu 2011-08-31 3:50 ` Richard Zhu 2011-08-31 3:50 ` [PATCH V7 4/5] MX53 Enable the AHCI SATA on MX53 LOCO board Richard Zhu 2011-08-31 3:50 ` Richard Zhu 2011-08-31 3:50 ` [PATCH V7 5/5] MX53 Enable the AHCI SATA on MX53 SMD board Richard Zhu 2011-08-31 3:50 ` Richard Zhu 2011-08-31 6:55 ` [PATCH V7 0/5] imx53 ahci driver v7 Arnaud Patard 2011-08-31 6:55 ` Arnaud Patard (Rtp) 2011-08-31 7:16 ` Richard Zhu 2011-08-31 7:16 ` Richard Zhu -- strict thread matches above, loose matches on Subject: below -- 2011-08-30 9:56 [PATCH V7 1/5] AHCI Add the AHCI SATA feature on the MX53 platforms Richard Zhu 2011-08-30 9:56 ` [PATCH V7 2/5] ahci_plt Add the board_ids and pi refer to different features Richard Zhu 2011-08-30 9:56 ` Richard Zhu
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1314762635-3923-3-git-send-email-richard.zhu@linaro.org \ --to=richard.zhu@linaro.org \ --cc=avorontsov@ru.mvista.com \ --cc=eric.miao@linaro.org \ --cc=eric@eukrea.com \ --cc=jgarzik@pobox.com \ --cc=kernel@pengutronix.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-ide@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.