From patchwork Tue Jul 12 07:46:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9224797 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 691F760868 for ; Tue, 12 Jul 2016 08:28:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A47727E63 for ; Tue, 12 Jul 2016 08:28:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ED4F27F17; Tue, 12 Jul 2016 08:28:52 +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=ham 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 AD01327E63 for ; Tue, 12 Jul 2016 08:28:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752604AbcGLI2u (ORCPT ); Tue, 12 Jul 2016 04:28:50 -0400 Received: from mail-by2nam01on0065.outbound.protection.outlook.com ([104.47.34.65]:35865 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752589AbcGLI2t (ORCPT ); Tue, 12 Jul 2016 04:28:49 -0400 Received: from DM2PR03CA0010.namprd03.prod.outlook.com (10.141.96.20) by BN1PR0301MB0769.namprd03.prod.outlook.com (10.160.78.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.8; Tue, 12 Jul 2016 07:54:50 +0000 Received: from BY2FFO11FD010.protection.gbl (2a01:111:f400:7c0c::182) by DM2PR03CA0010.outlook.office365.com (2a01:111:e400:2428::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.14 via Frontend Transport; Tue, 12 Jul 2016 07:54:50 +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 BY2FFO11FD010.mail.protection.outlook.com (10.1.14.74) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 12 Jul 2016 07:54:49 +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 u6C7rxtm002725; Tue, 12 Jul 2016 00:54:46 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH V2 15/15] mmc: sdhci-esdhc-imx: clear tuning bits during driver probe Date: Tue, 12 Jul 2016 15:46:24 +0800 Message-ID: <1468309584-3591-16-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: 131127836893813054; (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)(106466001)(189998001)(105606002)(8936002)(110136002)(97736004)(4326007)(76176999)(2950100001)(48376002)(50466002)(5003940100001)(19580395003)(50986999)(81166006)(2906002)(92566002)(19580405001)(77096005)(8676002)(87936001)(230783001)(50226002)(6806005)(68736007)(85426001)(356003)(36756003)(305945005)(33646002)(86362001)(586003)(11100500001)(7846002)(8666005)(229853001)(2351001)(104016004)(47776003)(81156014)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0769; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD010; 1:kZ/vG3EevOhGZksbhUZBwBvqfYNKJEIiEPDvTOiZYlndhlttfwwxGQ5538Hd1rUPV7tjsSECo3ioneaxy1bsIa5Vgtrb0Hicx2T7VbxS6TGGgWj2xU+C2isUBDjxe4ENmdZVRzNaQeHycWty9yr9gUYIsNF9uHIrWDQ1EMVV/tKoI4bb6wlWyH5iIDcEK732i7sUbCFv+awrhtleEZhWbJ4kkvkRLXbpbmGAUQbafvID66rJf0A9LXWpzJdCdZuBVZyOwg6aEHxwX3JU2RHux/9UHcJW5HDd/ig9oHGajiQ2dz3dlGuulqAO+VwQh802QTlKWeGXWPVtDq87SW1lwIIfQ1RJR+d7FWSgIorV9VHe0Gg8vaE3kw9Dz0UqnL4KUUk7R4x02C9YBh1vTbI2T6NbyslB4qBKYNATzX/+MlMjhbF4zsHxJ58FpRKwUALkZotGka0N4qKLJk3ysrwPmmXCEEXtrUEFUAWOQpuq8O2lu64GBI85h9ATzBHMh7RMmpEX3seLxCxdPMC56SqBRk9FWehF/+Ka9ZPgT709Mdu7hqqCJ8ucy5fdM7wAX5hSzD6zYKORdsdDlEDGrtHzuaR6OUcxRmmpf2fwEeng4UzkOUOVHxo+/dcQSL6jYv3iXO9ozjSaGdb/gZFBv/WBISVYpV3BXI5GZMfWubHiihQ= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: fd82cc8d-6d1e-4426-993e-08d3aa29ccaf X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0769; 2:qcEgafTvpvIpLoB7HOm4sbfxSq0DLGjJGimKwNVnXoZxCfwueacIik4ueVdvIkIG5O+Lbbr2bM5BFXK70e9GB7KlDmZzDt0K0PaKB6u0ffi6QcQIrO4AhUpqcNfQvXqkT0Pt62nVHBdJM4A5OVrWJr2I80wKoVMz5zVGIJWcu+niZ9LCtjaGSiD4YgOk/sM4; 3:HL4sWXxC0LfMUGagtN24eHbFB6q38667ELHD6G0Bj6vD+SG1IB7I9Ippl2/ODTVKAmL+iI6Pn/5oputjmejHIABokFmtzUmTojlW4kp9zO5rNo6YlF27OOzJc6S/ZW/RxQqUoEGQUGv7CGK0kzm8xa5duw4Jp0UWALFzeqKEDdmmpi8Uhh3aQ38URWULOCrbRlozMXr7tuoosbXevRNKW4mfQWlgNbzsl6pdZpnTA5I=; 25:cidO4qpm/97BYAcgLD/bCr5s/Bbv7hOLtAKghrLWrJMGGjL0ks33wal34gOZuIokC1864OBiCgraoLhJ+85j06PGln9H6qySaDAkX3qjfisD0Aac8E5pS5tBrEqR4PYs+50NmP5nhgM2uABZFauvoP4lSood8AmqsSB6sHAvm2FJGtu/LLyddu0ErInhm9p3egRvO6Ii9bdtwXTHkFRBytf1onhcAeNbRIBICAWsdu42fBIaHmi70Wlg0E1cflKr/Tyti8W23KJb209R2mctppKlh0ShPcB7zeg2d7mSRIiDyOC3ZvoudJOtdH7WjypeOiqbq5HxhiiJjym90mriJZrE0XIq2eT2PVchckudRDwfAi2Lsg2qXKhQLcCA0b8ECpa+vmzOC0IeKXZtEXLsC+Pxmf9WxlCeam4QNWScA7c= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0769; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0769; 31:7VzClzyQYeTtQ0POVW/ZKiQa72vtX63ggUCCzTiPfS32fPjt3QT6/PXVqdEDZCR5gvHhASUmbh/1OGx5/H+sjq3M/Q2kbYn9Qz0wO4LGuucj0sCwNYxvUuAzFiPdt4Tj3cxUP5Udv10PiEGgenWSWWB+27Hvqat/kuvTU2VTlBUZx3QdniLGTSTJ2nOV97nvyTpdIiMpgb0x6msuzmkmeg==; 4:Bhx5jEOS2vku0k+Ap8cfmhvw0DtWTG2ag0Fj4La+SPQYThvqn9MX2QDRmzl17OEkTzS1ci+lxcAPejTcOrNqDhyMhH0zI+YC/na8FasfRY2OyMPKkwveovZSt5E7HZJFVXwAcSl8pSb9a3g662O6eJdB42O9w21XHP23t49NCokx0rhQWxsXJwQzb+wBvSkOTP8NJXdDttoJ7n2fK013uSrKx/ZqDCktKEfn6R8Q/y2mFnvq6Ek+9WXQYIMq0N2qtUL0kzBbIL4byFNg3O+oro2YaE8Z0D9MDik75NGp/eYZGQV3raLRfMkgKFbiBX1uayT/sFGseTzBbR4N/XQTdoal5Ig5tXlJfJcv9f0g0mWAnaQXpPXXnwZOWk5+rGFZ59pPF9FvGm2me/hOfkzW7HSrqQGiViZCyZVqDCEwHqa7oYvlO0lln7E7E6Iq7K5V9xLDd4pcxARQPfosCxPJeK/EOkP9vNeChTTUwzu/WGyjNcXc0BwFDxPjn1hY1ipkCb2J1vjGRQ0k4/lxTJpCWw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(8121501046)(5005006)(13017025)(13015025)(13018025)(13024025)(10201501046)(3002001)(6055026); SRVR:BN1PR0301MB0769; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0769; X-Forefront-PRVS: 0001227049 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0769; 23:rS8R2rnOhHLiOaHTRfPZeiIyH2sgfnKntkWWeA8?= =?us-ascii?Q?CKCnnE0rn8R/vsFGzqQtwitcVeHPW2l2HaZ8lP4PH8Y33mll6R8F3VE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Mo+W3so4cMqpoS89+CC7ELTo5Bo4nC5udnMC+QF+uNTrMhcaQEmQfRp/FxD0ZucDmSV/v0oUCevw0tcp2rNCW8UZHXzbNzPJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2016 07:54:49.1785 (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: BN1PR0301MB0769 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 tuning bits like FBCLK_SEL, SMP_CLK_SEL and DLY_CELL which affects timing may have already been set by ROM if booting from SD3.0 mode like SDR104. Let's clear it first during driver probe before doing the new card enumeration to avoid working on the wrong timing. Note that tuning bits are dynamical settings which may need to be kept during MMC_PM_KEEP_POWER suspend, so we did not put them into hwinit function. Signed-off-by: Dong Aisheng Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-esdhc-imx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index e5b5d1c3eb01..2bb326bbc34a 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1224,6 +1224,11 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) host->mmc->caps |= MMC_CAP_1_8V_DDR; if (!(imx_data->socdata->flags & ESDHC_FLAG_HS200)) host->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200; + + /* clear tuning bits in case ROM has set it already */ + writel(0x0, host->ioaddr + ESDHC_MIX_CTRL); + writel(0x0, host->ioaddr + SDHCI_ACMD12_ERR); + writel(0x0, host->ioaddr + ESDHC_TUNE_CTRL_STATUS); } if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)