From patchwork Fri Dec 21 09:20:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 10740191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 635316C5 for ; Fri, 21 Dec 2018 09:20:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5292A285CB for ; Fri, 21 Dec 2018 09:20:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 464A2285D2; Fri, 21 Dec 2018 09:20:59 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 C348B285CC for ; Fri, 21 Dec 2018 09:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726343AbeLUJU6 (ORCPT ); Fri, 21 Dec 2018 04:20:58 -0500 Received: from mail-eopbgr140077.outbound.protection.outlook.com ([40.107.14.77]:46663 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726221AbeLUJU5 (ORCPT ); Fri, 21 Dec 2018 04:20:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zvZXPqZdPdrqiiSK0h1J4wnPG7xfC1gHjft55lrLE1s=; b=R9qGtvZnwogBgrZdg9KKxEPNf0PF605SPe+c3TkMVFpsfc6xj9bcwSUSnKMcW7l2oeea5C5mF2WNoRLu1Ceq6cs2zE9Rn/E+F4j7/FJD5aGMoKu0luaWpQsq0gFHKIJuBMp038YM+pok+LGALY+2nlA0WNF6kLMK+ue1Iiv79lY= Received: from VI1PR04MB5040.eurprd04.prod.outlook.com (20.177.50.97) by VI1PR04MB3038.eurprd04.prod.outlook.com (10.170.228.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.23; Fri, 21 Dec 2018 09:20:53 +0000 Received: from VI1PR04MB5040.eurprd04.prod.outlook.com ([fe80::cd3d:ce97:132b:7148]) by VI1PR04MB5040.eurprd04.prod.outlook.com ([fe80::cd3d:ce97:132b:7148%3]) with mapi id 15.20.1446.022; Fri, 21 Dec 2018 09:20:53 +0000 From: BOUGH CHEN To: "adrian.hunter@intel.com" , "ulf.hansson@linaro.org" CC: "linux-mmc@vger.kernel.org" , dl-linux-imx Subject: [PATCH v2] mmc: sdhci: usdhc: do not do tuning for DDR50 mode. Thread-Topic: [PATCH v2] mmc: sdhci: usdhc: do not do tuning for DDR50 mode. Thread-Index: AQHUmQ546XMirE4n2EqXfahkFBv3gQ== Date: Fri, 21 Dec 2018 09:20:53 +0000 Message-ID: <1545384496-18917-1-git-send-email-haibo.chen@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 1.9.1 x-clientproxiedby: HK0P153CA0009.APCP153.PROD.OUTLOOK.COM (2603:1096:203:18::21) To VI1PR04MB5040.eurprd04.prod.outlook.com (2603:10a6:803:59::33) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.121.68.129] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB3038;6:C4atNGEguras0iJqdECqFr8UKWretNrcgiB1VaK+8cnkYf08hBpwjUXNP5Rehk2p/D6Id9l+NN+nXLxN6+UwgFfm8oZ4McFcGy7iQBZ1ThAucV6YnuCUpYv/PL39Y8l3DuV4RDOB+W35bn6bywoKfkch1xRL72lK+DN1L2H3MieKC604yGzjDLwfxJdL/hIPmzrPgSz1XnSMd025KCGGZd0dGA/P60sKnTFVZ/qyXMZLQlrHlm2YqVD2ZsNKQyJKPf9yOL3AhVuNRIiHhluaiOsFuhVvmo8GcWFfO45cHaDVVt1iF2F7QiH9HbelFR0/d0F1jhyt1h73M/UxC2AuvYm3AbV9VX6OEiAT1dGEENlDI1suvYUc3giUAvpWjhtNHqom+qYO9j/nQJBNjwlwZF69OouCBOXp5pYKtJVCBhYB8lnfXIkZPFtrqdFSetDOP1e/ndPsLn73rWHknJ4F7Q==;5:BbZU4PyoWsgE5TP/PDIB0eFdQKbOAdglv+yXC9Msndv+MmJX/Gzk4AwnRXAvwvjBVJjr3WI5gGXQ8F09gWbd6yIl11pQPrIeml1b+Iaw/tjAO6CpEm98jULEXN9mw2tpLCuC1cwq1wkyq+1PKI+e3Fqm16FzBDcY/7F8k/Yr48w=;7:FNqL0uH3x9Nuf/UL4I6yg6myQA254g9waTcEppp7PkIysBRFjuZg3UTHA3ydpnHqTG+CeyhFcm6JczIEjSGK72yQZoz9EGO47rfa8Zh6321JBngX5p8FfqCXTtMPg3VniFWmacSsyALzGNmIvc5Hrw== x-ms-office365-filtering-correlation-id: 7474b222-71d7-4818-711a-08d667259abf x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB3038; x-ms-traffictypediagnostic: VI1PR04MB3038: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(999002)(5005026)(6040522)(8220043)(2401047)(8121501046)(10201501046)(3231475)(944501520)(52105112)(3002001)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB3038;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB3038; x-forefront-prvs: 0893636978 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(136003)(396003)(376002)(39860400002)(366004)(189003)(199004)(2616005)(53346004)(53936002)(4326008)(2501003)(6512007)(36756003)(5660300001)(186003)(52116002)(66066001)(3846002)(26005)(6116002)(6346003)(68736007)(71190400001)(71200400001)(6486002)(50226002)(6506007)(386003)(14454004)(106356001)(105586002)(478600001)(8936002)(102836004)(8676002)(486006)(476003)(6436002)(99286004)(97736004)(54906003)(110136005)(81166006)(81156014)(25786009)(7736002)(305945005)(86362001)(316002)(2906002)(256004);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3038;H:VI1PR04MB5040.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=haibo.chen@nxp.com; x-microsoft-antispam-message-info: P0TfjrvG5hzwLjBndipxy+DPx9tJe9soA2IeERh7z7+c+62AUQqP+gAeO6pUDrLdK3iPsAZ6PxopSX7+CtXiZmnUwW8hW1n0kTqu3jBu2rsdduWqSJKPipoM9T7MbwWPsPAbar1t58IL8vPkbytsUDuveg1ZdMd1V7mr0XJz0Nz8JmhMBZ6LHPuzK8NeLsyf0c/rnuI9VfimrBw6l8r/NodFEIrEQ1FC2cG+VP8Wtn0PI1zZMY1l0j5grGIyuLjllGYWDBMRt7OScVR6uJAAJ4Mg7T16jOxtD09dvQ0LBQTOVpfyIgDKGdEVM3xQNDu5 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7474b222-71d7-4818-711a-08d667259abf X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2018 09:20:53.4437 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3038 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 DDR50 tuning is optinally defined in sd 3.0 spec. And i.MX uSDHC internally already uses a fixed optimized timing for DDR50, normally does not require tuning for DDR50 mode. This patch specify a new execute_tuning function for i.MX uSDHC, do not impact i.MX eSDHC. Signed-off-by: Haibo Chen Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-esdhc-imx.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 75a2484..748ac4e 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -818,6 +818,20 @@ static void esdhc_pltfm_set_bus_width(struct sdhci_host *host, int width) SDHCI_HOST_CONTROL); } +static int usdhc_execute_tuning(struct mmc_host *mmc, u32 opcode) +{ + struct sdhci_host *host = mmc_priv(mmc); + + /* + * i.MX uSDHC internally already uses a fixed optimized timing for + * DDR50, normally does not require tuning for DDR50 mode. + */ + if (host->timing == MMC_TIMING_UHS_DDR50) + return 0; + + return sdhci_execute_tuning(mmc, opcode); +} + static void esdhc_prepare_tuning(struct sdhci_host *host, u32 val) { u32 reg; @@ -1338,6 +1352,12 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) writel(0x0, host->ioaddr + ESDHC_MIX_CTRL); writel(0x0, host->ioaddr + SDHCI_AUTO_CMD_STATUS); writel(0x0, host->ioaddr + ESDHC_TUNE_CTRL_STATUS); + + /* + * Link usdhc specific mmc_host_ops execute_tuning function, + * to replace the standard one in sdhci_ops. + */ + host->mmc_host_ops.execute_tuning = usdhc_execute_tuning; } if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)