From patchwork Fri Apr 15 17:29:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8854281 Return-Path: X-Original-To: patchwork-linux-mmc@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 B84EABF29F for ; Fri, 15 Apr 2016 17:52:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE6DF2021F for ; Fri, 15 Apr 2016 17:52:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA76B20218 for ; Fri, 15 Apr 2016 17:52:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750985AbcDORw5 (ORCPT ); Fri, 15 Apr 2016 13:52:57 -0400 Received: from mail-by2on0054.outbound.protection.outlook.com ([207.46.100.54]:23376 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750910AbcDORw4 (ORCPT ); Fri, 15 Apr 2016 13:52:56 -0400 Received: from BY2PR03CA073.namprd03.prod.outlook.com (10.141.249.46) by BN1PR0301MB0705.namprd03.prod.outlook.com (10.160.78.12) with Microsoft SMTP Server (TLS) id 15.1.453.26; Fri, 15 Apr 2016 17:37:51 +0000 Received: from BY2FFO11FD022.protection.gbl (2a01:111:f400:7c0c::108) by BY2PR03CA073.outlook.office365.com (2a01:111:e400:2c5d::46) with Microsoft SMTP Server (TLS) id 15.1.453.26 via Frontend Transport; Fri, 15 Apr 2016 17:37:50 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BY2FFO11FD022.mail.protection.outlook.com (10.1.15.211) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Fri, 15 Apr 2016 17:37:50 +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 u3FHb2HQ019919; Fri, 15 Apr 2016 10:37:47 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH 15/23] mmc: sdhci-esdhc-imx: support setting tuning start point Date: Sat, 16 Apr 2016 01:29:39 +0800 Message-ID: <1460741387-23815-16-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> References: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131052154706469118; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(586003)(33646002)(47776003)(19580395003)(19580405001)(229853001)(106466001)(85426001)(77096005)(230783001)(5008740100001)(6806005)(81166005)(87936001)(2351001)(4326007)(48376002)(104016004)(189998001)(92566002)(50466002)(36756003)(5003940100001)(2906002)(1096002)(1220700001)(11100500001)(76176999)(50986999)(50226001)(86362001)(105606002)(110136002)(2950100001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0705; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD022; 1:76HgitnjfozIA/z2w+NaAfpV4kcA8mkZ0ZGZARIPSd6t1V/Arew44G8aZfLVPt9j6Y5CrGwLl0wXKwNKA1r4+qYuXcrlBmcxeNnRBrhMisE99tg1cZrdEMq1NPRqYcVxYpkUgA417N1cSzTvIVolShkOWW4Le5rcdxyTyrKvGf3ueMW4MFKhLqED9HBD5wea+DdegMUzrMNtLNF4afQjYlJYmRjAeBEbHa9OzhU21LO6VEiAUNoDqMG96ilFqdToT8Hd4Q0nGcKTmsG6ekiLw1FA0R09SXIQazi4leR0hTX83b8gidhfBhBuiO59/SQWMNccUztFEeYqCch1PuLVNMgD8K0mV1phT6qM97WwU4MxlMw2IF59z3a8A6/nrFxHnw2Qvg5bFDbwSIC7j5hiKNx6xWbW18y8uuG2vAQ6L7ajTEmS5pFuL8mbxLzo3bCpOjczRZfI0201X0V2tJzVef/gUFnWgLMy+0UbcaqgZEkQRiOrv62LmA3z2qJ8Q/dLkYARBZRV0nhTkVQ6vx5hCSwDm5QNuO5qYYOxlv1qJQrOid3xybu4/KDZDaTfeI4s/c8+zYsSr2hclYul892EsvBtKli7l5gZ1JiJYkgDdtf6NT2W3sHeaaMaizSpg8bm MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f2d7fd9e-6851-4d7d-20fe-08d36554aacb X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0705; 2:xPVIlpaqCpkqHxdSlw1DLxnO9DamYZGtN1d1FI/dlC5smWCv0wvGurUAB18EGvz2GJ6DU7vRcNnF2Hc1QCq48lHiBO93iNXMmgWa2yN6pDg21WXA2fui73o6FpxkZk7asBNXMJa2HWY/VRJgMVyjh5kNPF4APqSIib7lLBbzcxfOKGkwtmEXQP8sLiD1EL2/; 3:im6dgs+VhKHNKFAiIcEh9irugrE/w3EQ3mHUS/OJofA13MhV0UH4twBrnyO3g0+P1nDB1aMNTRImqWSmxnqpK1sRwVVWWu6Ky05UuBBdqU+XDbydo20XdVyuE2bKF3e0XLGnm+cZE8ihMnbEpAJN8QHJxPTQIb48zczyVhFb6qnkM/DmpY8mzT8O1IjwtoXf2ezqYmU5bMn+DtvaRPOe5Y1ukTcmggVQpF5aJOlc9Qc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0705; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0705; 25:IgvOeQH8dXXMmUXaumU53iL6IExsy4sogY18ZzpALXEkedi33FXdPRQbh4d1FuewfoHyUekBxvvu6uwj2BMvOSY6SAmQ2jx3+UpQ60xHDrXxXPn2yc3AZ3/lCoI8BjE3aIoldcS+CGMMVwDq52J+m9WmbZXX3kWVxV0xV2FXz3i6Tvhub+1leIHwS5EPW6A2fom0VZXvTdJC7KbqUEB9e1qXCiE5Z8aDZWSbN359SHxkXWh/X4n7/LMhhh0SfNUhC3RUG+F0aoKt183ojjw84S2y+wxg3J9bJbVxXCF+Mm3EvpIRxakvV9+zk+ZwFFuK22VrjniSUwa1xifAVe+pAoXUwbVoS3tjsRq7Qa5puhnQKR5Dc/CsufOqZgjV/jgWDY4n9wtVylX5pCDlqe8oZflnYso9X6t/Y2x0Hhcb9fbN+JEWUo84ZRN3mc8UVEW/9uMR3CcHHBKsCeBYYtZdnkFjl52qgm9GxOeXy6DySgkkumfNJwmz7cPiYZfJryfIkLY00YkS6UBIYG4umIvkRfI3mqYRfqe6OTOuUST9qrcG1NJJNWoIHe3PM74nqh+nCTvSQvjBG/a6iaTqgXIyYWiiBxwbcLVZboS7TV5mKTMsVLeB8hlwhnmiTBc5dCFxCfeeXRa53i82kDkoEqXx+w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13018025)(13024025)(5005006)(13015025)(13017025)(13023025)(3002001)(10201501046)(6055026); SRVR:BN1PR0301MB0705; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0705; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0705; 4:H7jCQvirNqG+MnDcbB5OPzTjjhJCNyyIA/XGVrcIwpDURpBOix31J6knN3KA1Hdh/PePXja/F7nh9+G03pwxC5sghbc6FR6SIbuk57jthr8Qe7P2zapxAxuskRLrxC/ECV0cDAEs3nXXoILfeooQLOVLeEb1bzF4T/X/xgFLF9+peX2Vora6eWhO+CPaDdMIVlPGibPEJzSWDMj7ipkdt6CLcmBNSV8JpmR/D9sST37je0b3bb9iQ5UZNROxrrLmo2j0T5FcqMMPE0KDa8LncNBGlFBnz2RFa71ainWIUoYCVmodiy1wrRQzVy/aEUNUS3gyLe+BwZS3Si/s0RVap+LOADMLnlsoOfkjXEQCZ3Us0U7jQAKuxsEgC9th0MzSIFFIH3saJbm95LC+CxGYJlzuNIy7Ra3jiUToDyq8QOy79nVlgJV5qVqgQ0KR4ZqA/26qp7IjW0pVL1pw6x0I98z3Gtys59Eu0Q2tB5j9jdE= X-Forefront-PRVS: 0913EA1D60 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0705; 23:yfZAwnFyzzFY9EFnIBPTRtBji+7n9nir4w2gJ3w?= =?us-ascii?Q?9+5DVZBxblCdIPwCWUq1itWVyWmICV4F3egOU/ZR+WUo6vl4LG2HsD2BPD2w?= =?us-ascii?Q?zjsnFOBWGMQ6IkOs2qN+JcOGiAwF1Fs+w2a5hU+43dAP0YFFW8AIgXwXJqSL?= =?us-ascii?Q?N8jqk3Dxc4LtYyUqQ7OUSUbwsgseXDet60mlIVxNb1mNpsD8p+I1SwYcqrWA?= =?us-ascii?Q?8LoSdizaqxMdKia0uylnjB+SMdSAz8a4m90GRG5pEF7iUflRGEgYQu12aX/e?= =?us-ascii?Q?uQj5SjYj6bmiQts0JDFFUfaMFrotBFczJ/H7uaw2sn76A5y/kGG4AesSAhSl?= =?us-ascii?Q?A41i0C17XXvSb7CTItr+lx64QbhTjO7kXoNcrPraLQLxKiB069tOevNK9bhI?= =?us-ascii?Q?ddYV8u62KCQK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cIe84pSgS64d7lAq4wVQnsqBuoxjSK9dP0F+4A9hDW71KU/A5E+26Bwc8wH7PIP2u8O2ZM= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2016 17:37:50.5221 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0705 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 delay cells of some SoCs may have less delay per one cell, for such SoCs, user could set the start delay cell point to bypass the first a few meaningless tuning commands. Signed-off-by: Dong Aisheng Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-esdhc-imx.c | 14 +++++++++++--- include/linux/platform_data/mmc-esdhc-imx.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index d02db66..9f9be3f 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -75,7 +75,8 @@ #define ESDHC_TUNING_CTRL 0xcc #define ESDHC_STD_TUNING_EN (1 << 24) /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */ -#define ESDHC_TUNING_START_TAP 0x1 +#define ESDHC_TUNING_START_TAP_DEFAULT 0x1 +#define ESDHC_TUNING_START_TAP_MASK 0xff #define ESDHC_TUNING_STEP_MASK 0x00070000 #define ESDHC_TUNING_STEP_SHIFT 16 @@ -489,7 +490,12 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) v |= ESDHC_MIX_CTRL_EXE_TUNE; m |= ESDHC_MIX_CTRL_FBCLK_SEL; tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL); - tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP; + tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP_DEFAULT; + if (imx_data->boarddata.tuning_start_tap) { + tuning_ctrl &= ~ESDHC_TUNING_START_TAP_MASK; + tuning_ctrl |= imx_data->boarddata.tuning_start_tap; + } + if (imx_data->boarddata.tuning_step) { tuning_ctrl &= ~ESDHC_TUNING_STEP_MASK; tuning_ctrl |= imx_data->boarddata.tuning_step << ESDHC_TUNING_STEP_SHIFT; @@ -975,6 +981,8 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, boarddata->wp_type = ESDHC_WP_GPIO; of_property_read_u32(np, "fsl,tuning-step", &boarddata->tuning_step); + of_property_read_u32(np, "fsl,tuning-start-tap", + &boarddata->tuning_start_tap); if (of_find_property(np, "no-1-8-v", NULL)) boarddata->support_vsel = false; @@ -1197,7 +1205,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) writel(readl(host->ioaddr + ESDHC_TUNING_CTRL) | - ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP, + ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP_DEFAULT, host->ioaddr + ESDHC_TUNING_CTRL); if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536) diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h index 95ccab3..7daa78a 100644 --- a/include/linux/platform_data/mmc-esdhc-imx.h +++ b/include/linux/platform_data/mmc-esdhc-imx.h @@ -46,5 +46,6 @@ struct esdhc_platform_data { bool support_vsel; unsigned int delay_line; unsigned int tuning_step; /* The delay cell steps in tuning procedure */ + unsigned int tuning_start_tap; /* The start delay cell point in tuning procedure */ }; #endif /* __ASM_ARCH_IMX_ESDHC_H */