From patchwork Tue Aug 30 09:56:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 1112582 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7U9vJoY022203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 30 Aug 2011 09:57:40 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QyL3t-0007M6-DI; Tue, 30 Aug 2011 09:56:53 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QyL3s-0007xl-Qg; Tue, 30 Aug 2011 09:56:52 +0000 Received: from am1ehsobe005.messaging.microsoft.com ([213.199.154.208] helo=AM1EHSOBE005.bigfish.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QyL3Z-0007u2-HW for linux-arm-kernel@lists.infradead.org; Tue, 30 Aug 2011 09:56:34 +0000 Received: from mail116-am1-R.bigfish.com (10.3.201.244) by AM1EHSOBE005.bigfish.com (10.3.204.25) with Microsoft SMTP Server id 14.1.225.22; Tue, 30 Aug 2011 09:56:30 +0000 Received: from mail116-am1 (localhost.localdomain [127.0.0.1]) by mail116-am1-R.bigfish.com (Postfix) with ESMTP id 9AC6512801E0; Tue, 30 Aug 2011 09:56:30 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail116-am1 (localhost.localdomain [127.0.0.1]) by mail116-am1 (MessageSwitch) id 1314698190352022_1703; Tue, 30 Aug 2011 09:56:30 +0000 (UTC) Received: from AM1EHSMHS013.bigfish.com (unknown [10.3.201.253]) by mail116-am1.bigfish.com (Postfix) with ESMTP id 450F2195004D; Tue, 30 Aug 2011 09:56:30 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS013.bigfish.com (10.3.207.151) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 30 Aug 2011 09:56:21 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.323.2; Tue, 30 Aug 2011 04:56:19 -0500 Received: from x-VirtualBox.ap.freescale.net (x-VirtualBox.ap.freescale.net [10.192.242.136]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p7U9uC6t014049; Tue, 30 Aug 2011 04:56:17 -0500 (CDT) From: Richard Zhu To: Subject: [PATCH V7 2/5] ahci_plt Add the board_ids and pi refer to different features Date: Tue, 30 Aug 2011 17:56:07 +0800 Message-ID: <1314698171-7937-2-git-send-email-richard.zhu@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1314698171-7937-1-git-send-email-richard.zhu@linaro.org> References: <1314698171-7937-1-git-send-email-richard.zhu@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110830_055633_846039_B9C078FC X-CRM114-Status: GOOD ( 19.64 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [213.199.154.208 listed in list.dnswl.org] Cc: kernel@pengutronix.de, eric.miao@linaro.org, linux-ide@vger.kernel.org, Richard Zhu , eric@eukrea.com, avorontsov@ru.mvista.com, jgarzik@pobox.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 30 Aug 2011 09:57:40 +0000 (UTC) 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 --- 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 #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)