From patchwork Thu Dec 20 11:38:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 10738765 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 5B8876C5 for ; Thu, 20 Dec 2018 11:38:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 497522856A for ; Thu, 20 Dec 2018 11:38:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B87E287A4; Thu, 20 Dec 2018 11:38: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=-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 B44A42856A for ; Thu, 20 Dec 2018 11:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731118AbeLTLia (ORCPT ); Thu, 20 Dec 2018 06:38:30 -0500 Received: from mail-eopbgr30083.outbound.protection.outlook.com ([40.107.3.83]:4091 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730537AbeLTLi3 (ORCPT ); Thu, 20 Dec 2018 06:38:29 -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=i/bB1xjeY4TQhuyy7hgcbQ9wb6FUpVcD2JKxLXmtFWM=; b=HGT55QNr1VjKGsVnccKzUYoyf3g4ogHB+OXK93HLvXMnBv2NQNXc1F7EXZtq8i56mklyThY7jyLuZGqfJpDvjI9R/RHgA7sThAMTZHhU96xeUVBu1mW8KEe93Ptl8THBhvGZiDA5XYsmqetRBHzWDpwjaemB3YE9ogDDefBVYw0= Received: from VI1PR04MB5040.eurprd04.prod.outlook.com (20.177.50.97) by VI1PR04MB6237.eurprd04.prod.outlook.com (20.179.24.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.19; Thu, 20 Dec 2018 11:38:25 +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.020; Thu, 20 Dec 2018 11:38:25 +0000 From: BOUGH CHEN To: "adrian.hunter@intel.com" , "ulf.hansson@linaro.org" CC: "linux-mmc@vger.kernel.org" , dl-linux-imx Subject: [PATCH] mmc: sdhci: make DDR50 tuning optionally Thread-Topic: [PATCH] mmc: sdhci: make DDR50 tuning optionally Thread-Index: AQHUmFiE3HTkj6jMzEWTkd2IAI0dVQ== Date: Thu, 20 Dec 2018 11:38:25 +0000 Message-ID: <1545306356-15126-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: HK0PR03CA0093.apcprd03.prod.outlook.com (2603:1096:203:72::33) To VI1PR04MB5040.eurprd04.prod.outlook.com (2603:10a6:803:59::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=haibo.chen@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.121.68.129] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB6237;6:b+NPCW9mQgnZY87Ag2m7JCUW48a0zwVf95ag8AOvJ49UU3MCQzm3TidsiYK7hsqqtCki1WJS4Xr85rhiNyb6uASepBbAyMIVYz16G+YfoMzHaLTRwIaj9CF07M0580insMFdX1IbrVfYm3K3a5HnnUetA7ycfu6wpHPuuibl88Wmor1WZbuZPXIZ3Orb3lFHF/TCsAkj2Uffqbcj4jyqO1QfRUvvKJJBZTd7p4Hd9xGGPfIl8RyTsZ9r3aFPhID3nr+w+4mElrGx8l0D5pdVc3WEjjmieNCQcirYQeIHYyVJPcPF4Jo/eS67/3fY9SskGjWWZBUqGCiiatAFf95dEdPcvfdh0yF9jaGSqV79ObPy7r4y0xvYRlLf3ceTYv74WGcMhKLXzUVZAOTjYO/F0EtEQ2IlgPhBmqy4kPfB7915I8I0mgI67oJufwUz93Lt4RWUprZBninRKiv8dooh8g==;5:HAjRzWYq0dhmqJGXt9SXNF3SBc7OQKaQvNcDp+CE1BHF8apAUalrkcQWIezuYDp2vPvVY7i7Qxp3dlLM+b8ZTOcKMeVNWSKLSv7iuW+32D5cMzXPJaA8aaaCefmAwVm+c3/4YSd+72AfHp6ELfBb/6SqJSUHp+h4V03p/7wOKEc=;7:U2KxfyZtTIcr4HdygLE2lViqwV+7JdQbi6qNH6PJUWzs3YX+cXN1BLHbZJWCB5XxAOXrk5dvo0+t9I8rC+XzFFW79Ppq8NGW/vbS7SsR+zZXdJYsxJJei8jAtVSVdeQy50djjBfgD1Y5W4p71eePQA== x-ms-office365-filtering-correlation-id: 2fdbc311-6d3e-4f0e-de71-08d6666fa6df 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:VI1PR04MB6237; x-ms-traffictypediagnostic: VI1PR04MB6237: 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)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB6237;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB6237; x-forefront-prvs: 0892FA9A88 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(136003)(366004)(376002)(396003)(39860400002)(199004)(189003)(66066001)(478600001)(25786009)(86362001)(186003)(7736002)(81156014)(256004)(81166006)(26005)(476003)(14454004)(8676002)(2616005)(106356001)(6506007)(386003)(14444005)(2501003)(102836004)(105586002)(2906002)(3846002)(6116002)(50226002)(8936002)(53936002)(6436002)(54906003)(6486002)(97736004)(486006)(110136005)(305945005)(6512007)(316002)(68736007)(71190400001)(99286004)(53346004)(52116002)(36756003)(71200400001)(4326008)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB6237;H:VI1PR04MB5040.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: GTdwWXAEdypU6j3uF+t644f5eXuhQ6o7gEYeGXrtrQh1QN9RLXAvv3enjJFK8p86PuI6UtZcbbS3Wp8CZ+zX1Kc1DAaRD3o3mDX5GS9OUPp7u53lOjP/fqRB34mb7KE14cX2S5mWgPUorUphTfvkRVJVqUM5fe66b+rH3ivxRfb81Pu7v47maGWrQrSSdVbJMyZdctmYt5DdIgrElQBdcOCN5uDmYqvgqxxYSiZQotFQopkuJDDuW5tQu1BDw4SURj1xi7hzwx9FKKaJ+Qyr5KTwP7rE5t92tdMXuJphvu6Dl/qYeuIv0+siXGgy07XE spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fdbc311-6d3e-4f0e-de71-08d6666fa6df X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2018 11:38:25.3361 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6237 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. For example, i.MX uSDHC internally already uses a fixed optimized timing for DDR50, normally does not require tuning for DDR50 mode. So this patch make DDR50 tuning optionally and platform can claim SDHCI_DDR50_NEEDS_TUNING to support if it wants tuning. Signed-off-by: Haibo Chen --- drivers/mmc/host/sdhci.c | 6 +++++- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 67e43ec..144418e 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2429,9 +2429,13 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) break; case MMC_TIMING_UHS_SDR104: - case MMC_TIMING_UHS_DDR50: break; + case MMC_TIMING_UHS_DDR50: + if (host->flags & SDHCI_DDR50_NEEDS_TUNING) + break; + /* FALLTHROUGH */ + case MMC_TIMING_UHS_SDR50: if (host->flags & SDHCI_SDR50_NEEDS_TUNING) break; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 6cc9a3c..58b363b 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -506,6 +506,7 @@ struct sdhci_host { #define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */ #define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */ #define SDHCI_SDR50_NEEDS_TUNING (1<<4) /* SDR50 needs tuning */ +#define SDHCI_DDR50_NEEDS_TUNING (1<<5) /* DDR50 needs tuning */ #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */