From patchwork Wed Sep 28 07:41:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 4388 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 21D7623EF6 for ; Wed, 28 Sep 2011 07:44:01 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 17FACA1825C for ; Wed, 28 Sep 2011 07:44:01 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 23so445125fxe.11 for ; Wed, 28 Sep 2011 00:44:01 -0700 (PDT) Received: by 10.223.57.17 with SMTP id a17mr8998303fah.65.1317195840964; Wed, 28 Sep 2011 00:44:00 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.3.234 with SMTP id f10cs102743laf; Wed, 28 Sep 2011 00:44:00 -0700 (PDT) Received: by 10.224.208.7 with SMTP id ga7mr6633974qab.254.1317195839686; Wed, 28 Sep 2011 00:43:59 -0700 (PDT) Received: from TX2EHSOBE005.bigfish.com (tx2ehsobe003.messaging.microsoft.com. [65.55.88.13]) by mx.google.com with ESMTPS id fo10si19092987qab.112.2011.09.28.00.43.59 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Sep 2011 00:43:59 -0700 (PDT) Received-SPF: neutral (google.com: 65.55.88.13 is neither permitted nor denied by best guess record for domain of richard.zhu@linaro.org) client-ip=65.55.88.13; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.13 is neither permitted nor denied by best guess record for domain of richard.zhu@linaro.org) smtp.mail=richard.zhu@linaro.org Received: from mail76-tx2-R.bigfish.com (10.9.14.237) by TX2EHSOBE005.bigfish.com (10.9.40.25) with Microsoft SMTP Server id 14.1.225.22; Wed, 28 Sep 2011 07:43:58 +0000 Received: from mail76-tx2 (localhost.localdomain [127.0.0.1]) by mail76-tx2-R.bigfish.com (Postfix) with ESMTP id 3F6CF200397; Wed, 28 Sep 2011 07:43:58 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h) 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-SS: 0,13, X-FB-DOMAIN-IP-MATCH: fail Received: from mail76-tx2 (localhost.localdomain [127.0.0.1]) by mail76-tx2 (MessageSwitch) id 1317195765227922_8650; Wed, 28 Sep 2011 07:42:45 +0000 (UTC) Received: from TX2EHSMHS014.bigfish.com (unknown [10.9.14.247]) by mail76-tx2.bigfish.com (Postfix) with ESMTP id 1843362823A; Wed, 28 Sep 2011 07:42:13 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS014.bigfish.com (10.9.99.114) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 28 Sep 2011 07:42:11 +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.7; Wed, 28 Sep 2011 02:42:10 -0500 Received: from x-VirtualBox.ap.freescale.net ([10.192.242.136]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p8S7g0rM009714; Wed, 28 Sep 2011 02:42:07 -0500 (CDT) From: Richard Zhu To: CC: , , , , , , Richard Zhu Subject: [PATCH V9 2/5] ahci_plt Add the board_ids and pi refer to different features Date: Wed, 28 Sep 2011 15:41:54 +0800 Message-ID: <1317195717-21174-3-git-send-email-richard.zhu@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1317195717-21174-1-git-send-email-richard.zhu@linaro.org> References: <1317195717-21174-1-git-send-email-richard.zhu@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com 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 Acked-by: Eric Miao --- 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)