From patchwork Wed May 27 10:13:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 6489051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0547CC0020 for ; Wed, 27 May 2015 10:21:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 278E22069D for ; Wed, 27 May 2015 10:21:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30C112069B for ; Wed, 27 May 2015 10:20:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxYPp-00051W-C7; Wed, 27 May 2015 10:18:25 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxYMg-0002Py-MV for linux-arm-kernel@bombadil.infradead.org; Wed, 27 May 2015 10:15:10 +0000 Received: from mail-bn1bon0133.outbound.protection.outlook.com ([157.56.111.133] helo=na01-bn1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxYMa-00068f-Ss for linux-arm-kernel@lists.infradead.org; Wed, 27 May 2015 10:15:06 +0000 Received: from BLUPR03MB1377.namprd03.prod.outlook.com (10.163.81.11) by BLUPR03MB456.namprd03.prod.outlook.com (10.141.78.148) with Microsoft SMTP Server (TLS) id 15.1.172.17; Wed, 27 May 2015 10:14:41 +0000 Received: from CO2PR03CA0047.namprd03.prod.outlook.com (10.141.194.174) by BLUPR03MB1377.namprd03.prod.outlook.com (10.163.81.11) with Microsoft SMTP Server (TLS) id 15.1.172.22; Wed, 27 May 2015 10:14:39 +0000 Received: from BY2FFO11FD050.protection.gbl (2a01:111:f400:7c0c::184) by CO2PR03CA0047.outlook.office365.com (2a01:111:e400:1414::46) with Microsoft SMTP Server (TLS) id 15.1.166.22 via Frontend Transport; Wed, 27 May 2015 10:14:39 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; lists.infradead.org; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD050.mail.protection.outlook.com (10.1.15.187) with Microsoft SMTP Server (TLS) id 15.1.172.14 via Frontend Transport; Wed, 27 May 2015 10:14:39 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t4RAESMW006521; Wed, 27 May 2015 03:14:36 -0700 From: Dong Aisheng To: Subject: [PATCH 3/6] mmc: sdhci-esdhc-imx: add ADMA Length Mismatch errata fix Date: Wed, 27 May 2015 18:13:28 +0800 Message-ID: <1432721611-31214-4-git-send-email-aisheng.dong@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432721611-31214-1-git-send-email-aisheng.dong@freescale.com> References: <1432721611-31214-1-git-send-email-aisheng.dong@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD050; 1:qrlfHBvrCvYNVTGJzOLPKGDSV8Vd6+Wks7YKudlddJX/mTrdYKYnCw4iKk6cuxjfVqItce4q4MWtcG5RFIuYIk+XQbnQd0xoi+427G3gzP3IY0rubmqV6TJmaF+w37cYzxUiyxJ2xlUJcVunNrWqCTsK8g5/AiYtolFQ1aXRSqkszycjK6RZid3jCvhWAp+jR7++tkadfnAnv+KsXy8Zt0v+GyG0klWTgP/CrSSen4vqeDIkpyQVVZdTtMcLau4qlsocHUt072nUUc2geg4LuFRN/S5pWa8lExTeCPdJlYc0HZkuwoGbzNi/xLbB51iH6PYPUWJ1n8sAc0wd4kc6ww== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(189002)(199003)(46102003)(50226001)(68736005)(2950100001)(33646002)(104016003)(77096005)(50466002)(92566002)(36756003)(77156002)(62966003)(48376002)(69596002)(19580405001)(106466001)(19580395003)(230783001)(105606002)(229853001)(2351001)(86362001)(87936001)(97736004)(189998001)(85426001)(6806004)(64706001)(4001540100001)(81156007)(5001860100001)(47776003)(5001830100001)(110136002)(5001960100002)(76176999)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB1377; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1377; 2:a4Rx5YjzKhNfbvtzXDqEM3FFPv29n4C1YnEgUOSb2LAda5xJxt35eO2RFxkG81lI; 2:TCTOcP+vxzjWf1AtDm9zizrEaB+Tv4ez5z+XlT7GV/n5OaAR7RJqMv3Hf19bgC4yfB+RIN6Dw94uqseOUmRHRbvJfujpHnDZVaNmslm1sLu50v+JxSHAj/bAJ1qdJYgtHDSTXehVG+ilueVq1M2IU89t9+TkRKG3VJMU4eBHAOS5cXcqcL2AuAyDX7gsBvnzn5BBK56QTH7X2L8GDbjt5VrTe5DNCknp+UnUWKiAmsU=; 6:tG8T0REoCzklHCd4SP6uXSLx9j9691lAI5V/CHcHi0C0aN16lutPX3oH7fiHeKXd1XXXev0lGUV7/LKrFQzBPF+cz0X1EswLPOJcP/BnDrb8roTgMUE/ERF10co5/3Tc7tFeUFUEp9g9FwXLxfyGlQqPKyAyWfz3BetY9wmmWm6x/sPJj+DFs/96/uUxoBjuDnBp1lVbyUdBZhbq0qMGvsRpzxpE7QutQ/1TbNBABNy1gbHDrz/lvj7hWUeouPePYYzUCoTqyitd5dAl1Ct/Cfk2nGcDqYBaSZQslTis98g00e7TViHTLEykzTmf7fU0OuQRQD6QNRhyLXoyrtF23Q==; 3:C/v1CQ9ydvdC0oPb4JyOZb1Y/v30+wPOWzsJn1TTg3ckejN6rYdlKMz8dik85xIqZivM/JkhiVxscBJeZ3MibzLq/mF5bHHE8VhgEns364dZ+0S8D5stkR5XFDOMJVimoVkUILZtnQ939+6Lu1Eq9Ihpl1p7CFSQFJl1SP3bQFnPh5Bu42gttMJZwKEMtCC6aGnm7bXjMofryHJzHUPZ6vtzVkCwuC1+JKEK4197wIIXus19V8UbP/wLDLWnhctEHZ76YgJj8yiDHtP6f+oYAiDqSCKtxZrc2qMSYB8Kt9w8KByW8hSpgMsWuXRl51q2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1377; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB456; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520003)(3002001); SRVR:BLUPR03MB1377; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1377; X-Forefront-PRVS: 05891FB07F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB1377; 9:habJ8e0A8jqNzWbPJa1Ih/MBh5ySrzNOv2mAeTuPk2?= =?us-ascii?Q?aSc36QARIQ35ohZYHaRK1qBjQNrJ4luJHlMV96+7mfY9YeDjyqFD2dj/eUly?= =?us-ascii?Q?HvakK44R86m8x3hxSpJ20V/FffMnmYC+Gr+JJ9Y7FVYpFKSfxdJ76oJx9pCw?= =?us-ascii?Q?p8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EM4x0y7?= =?us-ascii?Q?D24mf+Xz0m0d5dbmzqvH95RQsB?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1377; 3:dO9WR2337Cl33gXEMkrsA/37LrUoCDl8trsJq0dJyG/BQZmXYXToWyLlY5sfFDw2uKfTwRmprgEc6+4Y5gi5xwSY1aY4kVkegZPqx6vT5K24pPhqhukwfcEpone3tpHDZZl3zTjSaDPvQ221qoYQyQ==; 10:UUUfcMlU/Q+0GMTCzgCvIJ6ncCKxJCtO0MelkV1T7DckvX9kFgZMusl5FTHLTi4OkJJEJiMwHrvGuq1oM0npZuT1BmI5KegmgvWLq2mqX6s=; 6:pLgpA9e8bzzUrfZAVsGQtTrXWm35bL4W02ZLWWpnZA/UkK7HkK5bNtGcuwzn8iCh X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2015 10:14:39.0890 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1377 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB456; 2:4sGo7mAHaHtuJMVDl8neQ/RY/QEkZIcn5M+7RuzVl+35w2IFwPlSzTjDsD5J742W; 2:O3C35blb6MrOVWJkY8YazeNV7UeQCl6v+lDqY20aOTs1OfSAUx7Ah515KiGzBRQFl+lFHIkHwnRfLZTOmLDkdqWgQhRYc/P8cPSGkvLozE/vTghYdANPoNc17d3ZTmnM98tZFpW65r48R8Z/p+tUG0MhrZ98QNDySrgz7Zjt0zXQdRNziSqHiyYnIja77va0Q++UwiBKzLTKqM3HJahKFPYEXDO4XcCVuJo1Z7nx/Xk=; 9:oJ/2w6UCZNchIX99VUei+y+kjgmTuurr9lV9m6xXxRYGqJYG+wk/iQD2198kK2eh9H8Blb3MuctXPXhcLU+uI3rVNBX375jewIeGhy03CScPD2QMPf4suh5XNZHLB5wKNVjRsF/lPHY6HJB78NVXdA== X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150527_061505_060361_4DD8FE4B X-CRM114-Status: GOOD ( 10.40 ) X-Spam-Score: -3.0 (---) Cc: ulf.hansson@linaro.org, chris@printf.net, b51421@freescale.com, shawn.guo@linaro.org, b29396@freescale.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The uSDHC has an ADMA Length Mismatch errata ERR004536 which may cause ADMA work abnormally. The errata has already been fixed for i.MX6Q TO1.2 and i.MX6DL TO1.1 by enable the bit 7 in 0x6c register. Unfortunately this fix is not included in i.MX6SL. So we disable ADMA for i.MX6SL and use SDMA instead. Signed-off-by: Dong Aisheng --- drivers/mmc/host/sdhci-esdhc-imx.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index fda07eb..a3b82d1 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -112,6 +112,12 @@ #define ESDHC_FLAG_STD_TUNING BIT(5) /* The IP has SDHCI_CAPABILITIES_1 register */ #define ESDHC_FLAG_HAVE_CAP1 BIT(6) +/* + * The IP has errata ERR004536 + * uSDHC: ADMA Length Mismatch Error occurs if the AHB read access is slow, + * when reading data from the card + */ +#define ESDHC_FLAG_ERR004536 BIT(7) struct esdhc_soc_data { u32 flags; @@ -139,7 +145,7 @@ static struct esdhc_soc_data usdhc_imx6q_data = { static struct esdhc_soc_data usdhc_imx6sl_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING - | ESDHC_FLAG_HAVE_CAP1, + | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_ERR004536, }; struct pltfm_imx_data { @@ -991,6 +997,13 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) writel(0x08100810, host->ioaddr + ESDHC_WTMK_LVL); host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN; host->mmc->caps |= MMC_CAP_1_8V_DDR; + + /* + * errata ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL + * TO1.1, it's harmless for MX6SL + */ + writel(readl(host->ioaddr + 0x6c) | BIT(7), + host->ioaddr + 0x6c); } if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) @@ -1002,6 +1015,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP, host->ioaddr + ESDHC_TUNING_CTRL); + if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536) + host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; + boarddata = &imx_data->boarddata; if (sdhci_esdhc_imx_probe_dt(pdev, host, boarddata) < 0) { if (!host->mmc->parent->platform_data) {