From patchwork Tue Feb 7 21:35:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9561231 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 C5BA76047A for ; Tue, 7 Feb 2017 21:38:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B88482848B for ; Tue, 7 Feb 2017 21:38:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD6C428495; Tue, 7 Feb 2017 21:38:24 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 37DDC2848B for ; Tue, 7 Feb 2017 21:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932329AbdBGViW (ORCPT ); Tue, 7 Feb 2017 16:38:22 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35923 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755478AbdBGViV (ORCPT ); Tue, 7 Feb 2017 16:38:21 -0500 Received: by mail-wr0-f193.google.com with SMTP id k90so6660973wrc.3 for ; Tue, 07 Feb 2017 13:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=5pFEX8Wa3lWTQoc+jBrGWAwy80Ng81/V+gP/+XOs1PI=; b=BB3rHt6TsWYxtpwZklA9rudtbnC+ljb/1FMLkwzkKIBDkhzSsRipv0YOVIwOKbZzyc ZRkw1+1NCvxotVzC8540GBwVknm4t9lFJB3f7gL1J654d3JBjgtJm6Ufxdy4gBo3xR6E p0EUv164DWulB+TEIrNYmV4SnRDBjRtrM4TeCE72Jdh4gp0TS/C/1zAYo6ZHoYI7m+gI hYxeyrUSrLvuDFR8xFnwGDU9P82ig7DA+chc+8vfmqcXRXNbYqXDB8kEjCOnENSP7uKS XxJ+A9FpFXq2oGhc0rEtXyd7VvAPRn/IIIofgR0EsKnvr/NXHNLWwg0AdfkFYbQe1abw 7hDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=5pFEX8Wa3lWTQoc+jBrGWAwy80Ng81/V+gP/+XOs1PI=; b=oE9/9mNd3SC0lzHWm2pHJcwuWpkYAWk5zQBjZjCvk1kcFq50RwUN2NHGgLpvNWokvT OUc8RR5grWWM1DlZF6bAGdVJ3TitGVC0GWgodBCIek/R82n/8j42w5FTXkmhkLUR7gd5 9wlI73LLUnmY7Lgbe/Psy6qAOnj3zrWf4J4cLNcDUGofCE3fnjOR/HG3AdZ021n0RCcD L0QFmHZm0gQQyaQqYvnUzzCxOh3zP1lDRmT78dBU97P+zcONcbZTYRyk+yoESi8Ipi9A 8czJz2MSDIwlTDbs2FuG7Slqt2hUq7YhA+B6r/JnHKQbbpxnicHhHgZscsmsSqzYLzNK IDdQ== X-Gm-Message-State: AIkVDXJc3HP2QvoX5WuvDYyPqNvHZrv3FvXeiwm9q6CpyPeD4UTublSX86l0DOhvHgz4DA== X-Received: by 10.223.138.9 with SMTP id w9mr15761844wrw.50.1486503383617; Tue, 07 Feb 2017 13:36:23 -0800 (PST) Received: from ?IPv6:2003:c6:ebce:1e00:cd3f:c3c7:98c5:4fec? (p200300C6EBCE1E00CD3FC3C798C54FEC.dip0.t-ipconnect.de. [2003:c6:ebce:1e00:cd3f:c3c7:98c5:4fec]) by smtp.googlemail.com with ESMTPSA id x135sm640665wme.23.2017.02.07.13.36.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 13:36:23 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v3 9/9] mmc: meson-gx: add support for HS400 mode To: Ulf Hansson , Kevin Hilman References: <0991d40b-e05b-2fcb-9ee4-7b529448de69@gmail.com> Cc: Carlo Caione , "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org Message-ID: <282ded48-616d-b0c3-b1e1-34f0987a9255@gmail.com> Date: Tue, 7 Feb 2017 22:35:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <0991d40b-e05b-2fcb-9ee4-7b529448de69@gmail.com> 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 Add support for HS400 mode. The driver still misses support for tuning, therefore highspeed modes like HS400 might not work under all circumstances yet. Successfully tested on a Odroid C2 (S905 GXBB). Signed-off-by: Heiner Kallweit Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman --- v3: - extended commit message --- drivers/mmc/host/meson-gx-mmc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 3cc6334a..5a959783 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -83,6 +83,7 @@ #define CFG_RC_CC_MASK 0xf #define CFG_STOP_CLOCK BIT(22) #define CFG_CLK_ALWAYS_ON BIT(18) +#define CFG_CHK_DS BIT(20) #define CFG_AUTO_CLK BIT(23) #define SD_EMMC_STATUS 0x48 @@ -408,6 +409,16 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) val &= ~(CFG_RC_CC_MASK << CFG_RC_CC_SHIFT); val |= ilog2(SD_EMMC_CFG_CMD_GAP) << CFG_RC_CC_SHIFT; + val &= ~CFG_DDR; + if (ios->timing == MMC_TIMING_UHS_DDR50 || + ios->timing == MMC_TIMING_MMC_DDR52 || + ios->timing == MMC_TIMING_MMC_HS400) + val |= CFG_DDR; + + val &= ~CFG_CHK_DS; + if (ios->timing == MMC_TIMING_MMC_HS400) + val |= CFG_CHK_DS; + writel(val, host->regs + SD_EMMC_CFG); if (val != orig)