From patchwork Tue Jul 12 07:46:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9224737 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 0925060572 for ; Tue, 12 Jul 2016 07:58:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEB0327CCB for ; Tue, 12 Jul 2016 07:58:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E33A827EED; Tue, 12 Jul 2016 07:58:08 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 721FF27CCB for ; Tue, 12 Jul 2016 07:58:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bMsYE-0008Rs-89; Tue, 12 Jul 2016 07:56:18 +0000 Received: from mail-dm3nam03on0064.outbound.protection.outlook.com ([104.47.41.64] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bMsWs-0005rS-CO for linux-arm-kernel@lists.infradead.org; Tue, 12 Jul 2016 07:54:56 +0000 Received: from BY2PR03CA049.namprd03.prod.outlook.com (10.141.249.22) by BY2PR0301MB0775.namprd03.prod.outlook.com (10.160.64.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.14; Tue, 12 Jul 2016 07:54:33 +0000 Received: from BL2FFO11OLC002.protection.gbl (2a01:111:f400:7c09::128) by BY2PR03CA049.outlook.office365.com (2a01:111:e400:2c5d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Tue, 12 Jul 2016 07:54:32 +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 BL2FFO11OLC002.mail.protection.outlook.com (10.173.161.186) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Tue, 12 Jul 2016 07:54:31 +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 u6C7rxtg002725; Tue, 12 Jul 2016 00:54:28 -0700 From: Dong Aisheng To: Subject: [PATCH V2 09/15] mmc: sdhci-esdhc-imx: enable hw auto retuning for STD_TUNING Date: Tue, 12 Jul 2016 15:46:18 +0800 Message-ID: <1468309584-3591-10-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: 131127836716291363; (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)(189002)(199003)(86362001)(7846002)(33646002)(8676002)(2906002)(92566002)(4326007)(305945005)(189998001)(2950100001)(47776003)(19580395003)(68736007)(48376002)(2351001)(19580405001)(85426001)(50986999)(6806005)(87936001)(110136002)(50466002)(76176999)(8936002)(5003940100001)(36756003)(81166006)(104016004)(81156014)(230783001)(50226002)(106466001)(586003)(229853001)(356003)(105606002)(97736004)(8666005)(77096005)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0775; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC002; 1:WN0zzruQjKjZYOsOsyHMmGQcyNyUXtCvN0YvfcUcb5Ko4bQoBE6oM40vkx4Ok1wdHLh8q76eU2toa3eXFjc9rXhF0t81o9uvYJWk9N0Ss/w6AFVDHVX47a9ewZBazM5Qbr+EsrSaJj1yZE2anF4E2GeO/9U0xyOat+PUcVlV2yrnneeTc7NIFDbqPKATSl5dVFzp1XF+zHpnXv1SeJpIn2HPVn4WdgPlBrwJTsYaYzmklDfbu2HB9fKX4bpq0k9Bo6gaNQD7aUJdEP52nFUJVYoVZhAOcdsBndmPGWuyK5logz5sbd6HR5Ukkpvl7y8Nw8UIVfdlgikSrBig9Y1sygH/cjlDCrYECihsirm4qFO5jUMPrPdYj2V1ocV1QpGnMuTLm7SeDPY1QUyHZ7znD2o4MLSpOQzpyc5dJli/kO/SqF/irrH5tu+kme3AuFAweesder4/uDJhBJUNfPU+0NCgH31q6ip5laybmlLYORxbL3OY2GbK4tQqw9HYkKQ4tml+DRyk7TDn06oorErIcTha4DZHvsALGrYns0/kLnTv3coZWCnoHgcIZFKp0kvwaAuQd3aClkDFmkg0vhDyPy67RN46h6RTlLzRtQImwpJj0iT8LH4+1dIi3wdcMbZas9phqedcroFYcbKHjJObcPb8lt1TxmuQjwVp2mThv4k= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8c1f5d71-e998-4a6b-73c5-08d3aa29c218 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0775; 2:qUm32gm5fLSKuoG6svmkzCTs7EgzaGj5FhMlaxh8P7/rpzAEI6r06o+b1E9zQjuEfylhB1WJwk/wbbe7FVyaH6+lPBzwux++sy/TsASTTCbKnzTqCQUBrKunpyinZRXY6ONixRo3enLlnd7NltFaEuu3qAwa4manY8jm2Z/jxUpQ4nPXfld1QNLEE1kk5ZRU; 3:wa4QMf9sK0hzUAwyA2mm+UyJH6NPCPN/8gCMG98pqyedSElnE986XOWQTD+qIPGOaiTnIY+f6ulWq9J/jpllcuAOe7i84OahcUyhIj1kZbQSVoJqIjIkA/zC5IS94lgZXyM+aBsQGRUGdqBhi3ProQXSTWu+QyMSuiGrIdXEoZNcJ/B5rn49O8UsPZ0bByPmTJMUzVVYHx+6M5IPiQi+slO+XtxKd7XHezghUQnXWTI=; 25:ToAUWpS7DGUddXBZqECDm4IObaDLNzhepGueS2z4kJTRt5a6l0I2A6UFeVAKHYeJEsdtteIjjun1vNUMfb2EwuJbOS3smuN3pPvxYDKp3LBf4ublSGsBCMXdN6nZeJ73lXtSiejpsGok1EKYhUHcA3Cn2qniu73MfbQnjaEneU0qxjPVepDuVtoldX6QjTd7SwFWO2D7TDAz0ZBjqla34LEk/pO0ZfDt6Tdo0TbkP45Apk7dYFHeRuriOADyxljA+9qJNGpARxKAH71FGmL4/hJ6omhjNUiQnzv+CSDgTKp4ZPzzUQW+Dwtd4PT5BwygJjIUcY5Zv6iQRyeLq7E9WERZ2X0jFabF7rD2RAxGayEMSRIYP8/Po6B6x8LStSD40jDqzKz5RJPKmrs1w6+4lOWnfjt4LSJSwCxfF0D/PKQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0775; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0775; 31:WfycLj0HqcKOg8WLr4oXfqboUmZF7UhVjo1ojuKjDDmXRFejpVk8b3sa16sI1WfVtrCFbf9xzbYKVcLuZKUBBmTZIhGwlovNDaTiyA+PFirZAiytJsLCHqTNjfy7v7zy3zPyEPiCTfPYojPGktvcXvCslipnm8dAKYutrTguE6478RvY0IlsgFQeqqjGS44cACYTuqGmln7jPZenW/YYlg==; 4:yTHq68ySiPxo1khrvkShjlH9bXP/9ZhKmjFJUkpK/L1dJwbdUBaIJXnh8XDANcwWnmP5wrqgXE3aM6H9Sk/5H38GX5jJWvYTtgUkgtByS7pe+2Hlmw8IxAqo6ywaGleRx/i+aoVtg3h+at/ExOspy7+9b6yFrlpmNMuACoQKqtkxO60J2yCvg/TpLkho04rjIn9RQLxwfA2N3XrzbwFAN/5aAxZGFlLYVDtSEfho6BTS2mpfZBpt/uMJLeN2zY+9K2peC3RCW4/Eekylc0p72/Dwa1gZonrfz6AG2V/txim6EYHYBEb/xSe+lGUfrj/HM8fkw7NHV/da36KZEXa4iFHX+9Hu8DQVnKMyVMxdAxn1WHirGlyYF0IRM2e2ezx3zsTkbwknuW0XL4hX1xTodLcitNhB8LtI1Om0B9J+GJ+kWrq3mImDvjLQf3zhK5WDTxH2aDRvg2Kh9ByXWosV7UlOkEkgHsiTfXn0v4uoRGIG//gZKGEg7obWUgz+ejKetaewemCuec/Z/PZi+hL16doI7bnPi9CgdMQt/HqRZDxuxHJ/6Zqsxo9SgTaxznvu 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)(13023025)(8121501046)(5005006)(13018025)(13015025)(13017025)(13024025)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB0775; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0775; X-Forefront-PRVS: 0001227049 X-Microsoft-Exchange-Diagnostics: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P1Ulnq7psebnwPyhkUcIFb4hZN4ajJwPhr8qB8GhnKjmbf1VVhgpjB7DfQdQGAcoS3kbVVWqYn+7LOo2MFQ29ezUI8Pi8Q/sIz8meJvhycqSnIcgTheElCMKvG6X651CRrsjYUGwcXm/2aCQHCY4ihafyEXzMEDZ5TNoyYpu7CgRhzaf2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2016 07:54:31.4575 (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: BY2PR0301MB0775 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160712_005454_714331_F6F8256C X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aisheng.dong@nxp.com, ulf.hansson@linaro.org, dongas86@gmail.com, chris@printf.net, haibo.chen@nxp.com, adrian.hunter@intel.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Enable HW auto retuning when set SDHCI_CTRL_EXEC_TUNING and clear it when clear SDHCI_CTRL_TUNED_CLK. Acked-by: Adrian Hunter Signed-off-by: Dong Aisheng --- drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index b47dad15fa3e..c90aa07b106f 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -45,6 +45,7 @@ #define ESDHC_MIX_CTRL_AC23EN (1 << 7) #define ESDHC_MIX_CTRL_EXE_TUNE (1 << 22) #define ESDHC_MIX_CTRL_SMPCLK_SEL (1 << 23) +#define ESDHC_MIX_CTRL_AUTO_TUNE_EN (1 << 24) #define ESDHC_MIX_CTRL_FBCLK_SEL (1 << 25) #define ESDHC_MIX_CTRL_HS400_EN (1 << 26) /* Bits 3 and 6 are not SDHCI standard definitions */ @@ -485,11 +486,13 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) } else { v &= ~ESDHC_MIX_CTRL_SMPCLK_SEL; m &= ~ESDHC_MIX_CTRL_FBCLK_SEL; + m &= ~ESDHC_MIX_CTRL_AUTO_TUNE_EN; } if (val & SDHCI_CTRL_EXEC_TUNING) { v |= ESDHC_MIX_CTRL_EXE_TUNE; m |= ESDHC_MIX_CTRL_FBCLK_SEL; + m |= ESDHC_MIX_CTRL_AUTO_TUNE_EN; tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL); tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP_DEFAULT; if (imx_data->boarddata.tuning_start_tap) {