From patchwork Tue Jul 12 07:46:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9224761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 255B6604DB for ; Tue, 12 Jul 2016 08:10:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14EA627D29 for ; Tue, 12 Jul 2016 08:10:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0846D27DCD; Tue, 12 Jul 2016 08:10:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5420C27D29 for ; Tue, 12 Jul 2016 08:10:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750999AbcGLIK3 (ORCPT ); Tue, 12 Jul 2016 04:10:29 -0400 Received: from mail-sn1nam02on0083.outbound.protection.outlook.com ([104.47.36.83]:21984 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750974AbcGLIK0 (ORCPT ); Tue, 12 Jul 2016 04:10:26 -0400 X-Greylist: delayed 943 seconds by postgrey-1.27 at vger.kernel.org; Tue, 12 Jul 2016 04:10:25 EDT Received: from BN3PR0301CA0011.namprd03.prod.outlook.com (10.160.180.149) by BN1PR0301MB0771.namprd03.prod.outlook.com (10.160.78.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.539.14; Tue, 12 Jul 2016 07:54:22 +0000 Received: from BN1BFFO11FD005.protection.gbl (2a01:111:f400:7c10::1:166) by BN3PR0301CA0011.outlook.office365.com (2a01:111:e400:4000::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.539.14 via Frontend Transport; Tue, 12 Jul 2016 07:54:23 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD005.mail.protection.outlook.com (10.58.144.68) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Tue, 12 Jul 2016 07:54:22 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u6C7rxtd002725; Tue, 12 Jul 2016 00:54:19 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH V2 06/15] mmc: sdhci-esdhc-imx: support setting tuning start point Date: Tue, 12 Jul 2016 15:46:15 +0800 Message-ID: <1468309584-3591-7-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468309584-3591-1-git-send-email-aisheng.dong@nxp.com> References: <1468309584-3591-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131127836625804759; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(229853001)(33646002)(85426001)(68736007)(586003)(2950100001)(2906002)(50226002)(4326007)(2351001)(87936001)(230783001)(106466001)(110136002)(6806005)(97736004)(92566002)(356003)(8666005)(5003940100001)(8676002)(7846002)(50466002)(36756003)(48376002)(76176999)(50986999)(305945005)(86362001)(104016004)(105606002)(19580395003)(81166006)(81156014)(47776003)(19580405001)(8936002)(77096005)(189998001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0771; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD005; 1:FxGD5S0f+I7rRIK+EFqlAGKtR/8Ivq25OB4Y3cG4tSBo8aiBbwmQfywXeqHiHyK8tDQve4DruD/36ShqJtUtRJP7acZABUYzgfkUmV98bBZIbHLOE348FGawapsiA4HZcefXTNeIIB8XOpShdVF7Wl2w22d8JcccRXC+ZkyGhR1sBWrUxad/AV9Tbs59RVGtNN/34ElqzQ9yX+jF9Q9C1QI0CXaqspORh6rcl75vAQGqMCs6eOHpSr+Lb8qxkgx2HJLpj2nyFh1T9jR2lJWxcipjLRKN8r15PzWNT4DCZt0S1qnMJoCSKTUFcyX+5f0STKQ2b+yVLY+a6y+ZBsINCWyxVeFaQNsXQt/nFRnTB4tupFW13mSPErjIWpNAUHCsfAdxSe7rlCygkWGRZ7mx97vsmwwS55AwFnCao7Oh+4Y/u7MzKoI4BjOFEL4Lt0bcL/urDAoVgNIqze+J7iCzL/xewI+aUUgqLrkZtSqj3Ldl+4SSHmuTJ/qawtY8hAl9y67vZ1qswRv/dD499q+iPLXYPIOtJOoPi16iiU7AejGuC2fL3EtIWx9LcHH5b+Ko2O7RfxTdmP5vyLeizYhWmR3A2sC9GjWORVD0IrUgNrEYeXoUzFtydvJRUL+be1Pl/1lUqb4GE1htkxzM4k/5G1/NRlKdB3qQrn0NhwrmcfU= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 95ff8f61-0b5c-4a58-bc76-08d3aa29bcb3 X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0771; 2:ldoe0RMkX1a01BI8JLHicX0pKKG/ACMLowm6S2VQOmUAbEEw2/jyaopRIIzZR5MXOfsGeJy06IUs8SU3rUrzZ/0eb/FOjT4XrjKZOgerXu0VzhF6JG8inxI2kNP55HIaJPz77d/cx4gR0adEiHHgviqnr79v9dbG4PUsou54KNuEhhGwK6NJe7ZUqCgpHy0E; 3:bgeqkI9uycdAzYapNp9SuMkrKpQpC5vVhKrtQSab3vvsXefDRWNfoJuqw0nRhmNAr9kNBoRXvDoHfk6b/qmhEeCKcn5fgr9TmHn3o1osimzybpRTwwd67ID75xBJdZtkY7aPl3v5uI3yg81qlQ7Fg1L0cP9vZCZgBt47RUaNfNN/UTftykxWIFI0Mwt9Ob4b9Yv1Vvg9YRLbb2CVw4TE9JRgd/kT9PjLBk+Kor4hUmE= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0771; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0771; 25:nyvwizZJIELXACpGBdivWTScQOQgO0EAds+0Rz5d1BDheS4xwRbz1Kg8Zw7911jsCuTAURHAUBddZNv6Y+hK0M0YRNZPZZVS8dakPVUNlUX04mbEUW8tmqusG6jwJBtAbPRbz+Q2t56lLOuQ6Zp6GANRvbwf8Lp5lwyqBJnTloW3b1HBiYHvURtkh5Ay1srEkutUSva5Y9x0N6YvAUjThk6R9Gxhj/Iww+Mzmrs4bGTWpwroSfa0FjMwyr+UHpEs7dCqP26qFaFC0m/LtSTjbLG25pT3L2z1ntLnF8SqvkK2mG6xnyi2D1rF73T9c308aEMFZcbMWn78XCF1J00Pge/8Gj/ED0npFzrpjeTSbYe7hF99kzelDY1bArogHQSKShpJ2szenHMw8YCP9VZX8SEN/GysqySFcUz6IspbkanyNFdId5whmhSASHeUFQcRt9UHr4+9rxhdSiDT7lDHm0qdeKbyEZc3cJ4tm7EJlsR0Ih8bGbdY+3iXbZ3oBt8oGtQT42h51JKAeRgcV1iW+f9fejOX2Go5AKCzsEjK9TizFXGzqtB+FWuXRVnv/WWFmpnfeSmrm5yCNoB3SeDeqgbLCKa0J+Z+QLvWDVwmu5KkLMEtvwJJbaccbRF8l1hjkMii2GZcmrjqdqCVRA7472iHIZurCCCvVyRtIpjhJTp0yZoSFW4CT0AvUkLS20PgO95tcPZWG6byncXjE/M8I11pSoF8fkSK43X2r7VvBb4=; 31:aW24Cm5AMbmlISwQctQyV1MgdQQtZf9UCo+LxQdAWzhil5pfO4JZe+qyzHYatsSNJIg7+aPDhQdbyv12t45M5t3utmSGzuGQSIQ9pGKxJTmw/+uH9wd726Nqf2Xqj+s05BwOQ33hibMJDwUbYZc4b7PU4RM8rUZ8Y2uAnFpRjQ9lYCSJbcQIhkM dDyTMLvUlzB5eTGLd9y1396voVz1IRw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13017025)(13018025)(13024025)(13023025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BN1PR0301MB0771; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0771; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0771; 4:5YO/VewWUMB9UO9WmM+U3x4P5j368ROLbKwaepWfz1ErGw/FnGToz+3+Spb9Zi1vq2dfV8QiOI9FUR70W+8ZMfb+k1fdPXPY6WscoOXV9+l7liQC3K2qmOzJkVIJlcE3nQ6C6hzF2VMp8lyeTv6Y0ntCX0HcfQIwx7t0cq+455Vc2DDfcG8FQZpz6dNEPNXnPs7HoIMsoZh30Ps490u2l1DTA4cw4mNqmJBm5XkAaLuFwJNploGBUgA5Iri8nj8bEo5Qxzc88R8mye1uoplrriwQEvHs2tPR9OTexB3aFyxokb6uiR6LPzCKuiWlDtiOY16oSxqCbWW+zfe3lOSiKA1cOxL+P+6o10Pf2+7cVV6CVGhuZPznHoUWWcDBZaahbM+ZoXDG5+RYZwvlD9zQaGuv0E0zb3sFZPoNJL52ncW9xV97uRg6fTCHOKmb+EzO4gmVuRtua2ie2lNFafE+/VrBF3GRhNrTsW+2+V47uYocmy1tcQcZ7COM1kYY93pf9xLIitYxPiT6JyhPYCPA0xHJgrnnZbGIxyd/kyjGGJk= X-Forefront-PRVS: 0001227049 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0771; 23:uXA8sVUhUKBasR7Yj+013wALPnUzJDzLwFQyo2D?= =?us-ascii?Q?xp9wdxdokbjuTxHtOaPd9ADtB8bTL8y8M2Wfx2kK5a5cHUAt3dihj5LHj1/t?= =?us-ascii?Q?OMWtGemKWR0ZF5QTquaNgJG4CurGTkH15yTfBO5gR86FtxriWRkGio928eBd?= =?us-ascii?Q?PwiTh5loQuUuRwdQeREoL0/Bdj0xhe4FDhXMv4+2FLSnvdZGe7CzKSvNtYaE?= =?us-ascii?Q?4B8TZotxxvJbuHv+fd/l+3CkQbDOSN7ugcQHM5qPiryOn1YHmmGdfJ5FezhI?= =?us-ascii?Q?uskygQPrSKJkYjPYkimobRMVgDzCqGJt2SHHXUHROuQ37MhmE5H/I+P8nyPz?= =?us-ascii?Q?mgmub8t1RZdpqFxa6E9fjh4Dl5xjz2ri+yBoye04nBcoqTK58A2x39v+uAhQ?= =?us-ascii?Q?pWITNU5Cb4S+uKMFzhhcnKifdphBcfEWYZZxv2P8yAjN/Tdvjjfel/GgnLxg?= =?us-ascii?Q?8POjShyPbSeSzFVAIm0GJuvXePbDa7k32p2JG0ZnjQmj5XzlsZDSzloUmPbY?= =?us-ascii?Q?FzVZh1jWFIiiSHv0s9fdojjoGhWspu+b50L1UftSOs61ZD+LLWocZu3L3h8d?= =?us-ascii?Q?CVVnhZMGdyO1fDW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yAlTUgEGsOrP/AaDvL6S84VzpdmW9Jh4e9WvdNsHCliZz0A81VkLuH7khvnLNqy6hEr5Q7ejD+TVIC2icjGRIW9X7xTTusXy0ZzX5dr+Nr1Yrt7nDD8/CpGO7AwZM=; 24:Cz0Ypy4ucbE8VuTb30AB4Y1wnPQwnhSdvxJfL4S0uCyRq9r2zicILrKLy9KU9gxv9SqGCFzbTTMjxIy4zm21fuOYDsuaI4qtuxnCT4UWM2Q=; 7:n9smuBi2KLujjwj1Ty2VTl3rFyChiKARzhyWRjvA8LLbXQRxmxolJuuCW6mB/0vhdRpMhUHXHBQsVdGYNqZd/NWmmUJ3GDlUF4tgLqqaiK13+E/EkRs2w7ISbPtOWarBr+xeexl6nS3i5whP1rlLk3QqF63C564eftmRcadDTscTyQbhaWCPufm8egUE1+x7ivLMf2VKM3CEVCyhLdxOhFrzhWXzmuK8nFmTg/ZkndbsEI2timT8kpLUEGEZ+i47 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2016 07:54:22.3932 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0771 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.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. Acked-by: Adrian Hunter Signed-off-by: Dong Aisheng --- 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 874d5105f83c..b47dad15fa3e 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -76,7 +76,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 @@ -490,7 +491,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; @@ -976,6 +982,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; @@ -1198,7 +1206,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 95ccab3f454a..7daa78a2f342 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 */