From patchwork Tue Jan 31 20:59:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9548523 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 9717D60415 for ; Tue, 31 Jan 2017 21:08:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8768E281A7 for ; Tue, 31 Jan 2017 21:08:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7927428384; Tue, 31 Jan 2017 21:08:35 +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 1C92C281A7 for ; Tue, 31 Jan 2017 21:08:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751101AbdAaVId (ORCPT ); Tue, 31 Jan 2017 16:08:33 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36639 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbdAaVIb (ORCPT ); Tue, 31 Jan 2017 16:08:31 -0500 Received: by mail-wm0-f68.google.com with SMTP id r18so942742wmd.3 for ; Tue, 31 Jan 2017 13:08:31 -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=77tD3Vm24JWydENc0LnpbXPr+t0nv0cFQawQZmdH5NQ=; b=b/rSL7PGzSvjeXN3nOjUykGMABekhtOr0u5B8nAVxOUYKypUX8mEWXqxRwOQaqmyPZ yK3cmDbPNgSZdIKvgC1k4+aUoOC6uBegf53wIiNPEkW0lFdDejscnVf5zRGf6LnEimoD Gw2pP1VJWBa1r8atop+gFHTI/NNXzMILFXUBLeiYhaA0AuDJzxT4qyNH5R6LD108BdDF obz/RGzeo/kovDxLiL9gfsoXJfmj+s8q5JYk4xzT+aoRNCP14vDMFRMtuotxzBOamww/ BPc4WMXB3XwJLT/unq84IbeKEfhRZpKUFILQjZsvo9CjtQosrcmSiFJ2Kx7q05cDZtBb zGng== 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=77tD3Vm24JWydENc0LnpbXPr+t0nv0cFQawQZmdH5NQ=; b=qI48CQqyOsRIp/HJvyAPkCbXkbVZp68BiHcdBPv1pxNuCPUykWzX9DnirumtJtuQMF JaaEPy7YB9LsD/OI8t9DxsoYXcuOf2yEQUWDd21kYViT2/ziR54uF6Rk6llQ0FIGOEq4 SSYmDlo+VgWNSMbd3niiXERJU1Q2OxUab/duu9lVSHd9rhx4YzpufEr8MRTlTONM+2LN klQzHBPLtiG334lvsA2hIlx0qT5wN2wwCBmn8/zm5n2S5xyx06cC5ffELjTAWaKFU3LM n88QOj1FsvvHHIGvbsA2YhdakmXSchJcWAHpd1Ork3Kcb9wugad0D02HFRpko3NLOHZ8 ebgA== X-Gm-Message-State: AIkVDXJDzRPSmHvfX496wn+Btjyf31kT2BROTzsvUFZSiTFHL0YrqfEaMxUMCf2CMqOb5A== X-Received: by 10.28.69.28 with SMTP id s28mr18902650wma.40.1485896365170; Tue, 31 Jan 2017 12:59:25 -0800 (PST) Received: from ?IPv6:2003:c6:ebc5:6c00:bc31:e1d5:58cd:f318? (p200300C6EBC56C00BC31E1D558CDF318.dip0.t-ipconnect.de. [2003:c6:ebc5:6c00:bc31:e1d5:58cd:f318]) by smtp.googlemail.com with ESMTPSA id c9sm25886994wmi.16.2017.01.31.12.59.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 12:59:24 -0800 (PST) From: Heiner Kallweit Subject: [PATCH 9/9] mmc: meson-gx: add support for HS400 mode To: Ulf Hansson References: <24e8bf35-50ce-270d-c0aa-12bb90d2e3d8@gmail.com> Cc: Carlo Caione , Kevin Hilman , linux-mmc@vger.kernel.org Message-ID: Date: Tue, 31 Jan 2017 21:59:03 +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: <24e8bf35-50ce-270d-c0aa-12bb90d2e3d8@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. Successfully tested on a Odroid C2 (S905 GXBB). Signed-off-by: Heiner Kallweit --- 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 bc787444..83a94cf5 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 @@ -412,6 +413,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)