From patchwork Thu Jan 26 22:12:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9540193 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 EF8E7601D3 for ; Thu, 26 Jan 2017 22:15:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCDB627D4D for ; Thu, 26 Jan 2017 22:15:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1A3B28306; Thu, 26 Jan 2017 22:15:28 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 684DF27D4D for ; Thu, 26 Jan 2017 22:15:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cWsKA-0008Mk-4u; Thu, 26 Jan 2017 22:15:22 +0000 Received: from mail-wm0-f66.google.com ([74.125.82.66]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cWsJ5-0006Nc-8l; Thu, 26 Jan 2017 22:14:17 +0000 Received: by mail-wm0-f66.google.com with SMTP id r126so53621378wmr.3; Thu, 26 Jan 2017 14:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=ep2slg0w04XvRF6fC7ObEoB/hx1P433dIZPegmV/m+8=; b=dl01wM8s3wIiLx/D/FdhOTbov7OayyGWKpQHoMKd8kLi/verrVbEggqNMDlgk+0OX/ ALGPVtqhdBvja7C2kceraYVe3vTWjAixt3R/tMwagRo/p008HwM3eO1wwml8rpytKu4c 7Y/tBanu2oeCKpo+26oAYmtarFjHznXofbjsd3eIT9IP1TsZnh4qA5+sFAXsqO4TfWEO Fht/CyK+edc/EpMt2P/3o8PaDoyanlLfEqMALUkowoy/n+9jsHWlxGiXBsSjbaNkbwXR uMcIxgS8wo+p/RK8ak+dyAsYr1WD3ZXL+iOz53FeZFyYWqOFcOy5gRXWAidBkI/3aqnm LLjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=ep2slg0w04XvRF6fC7ObEoB/hx1P433dIZPegmV/m+8=; b=OfB4jfhJ6uCHMO0ap2+QV2GwJdVBI9XzTOsCbA2CjE2wsQQk+fNmGnCxl9/EdgDz8n 5rVPI9gh3XxStfMn9xorYIt7JqBY4djCtKmRScGguwbPda3NG2P3GxRWJvcffkfDHPW/ eCjgGA9GMDJAB/kJzY0qvI8tUrooo19cbtTZ61BM+eSzeniyiwWpKm0mnEYpLKkipmWy mMGwlciSCZrGhstyDx5l2t60N380QSIo5je1ljgXkCWHfF5BtxwW3gE4XQ3oa1Y4H0VK DRu1uUTJHqpL7MITGkgFknVA67xjJJGLqf+AyEI7eMytk8oCp61ulTmP5mrYcEPJXTgI T5fA== X-Gm-Message-State: AIkVDXIOsdDPD2fahdkrwaAcCaApslQTrJ8+/RoWIIUOqvjMBG7OwdlNqsjm5oWZYLMDaQ== X-Received: by 10.28.91.19 with SMTP id p19mr435631wmb.49.1485468773498; Thu, 26 Jan 2017 14:12:53 -0800 (PST) Received: from ?IPv6:2003:c6:ebc5:6c00:4534:522a:e499:2bef? (p200300C6EBC56C004534522AE4992BEF.dip0.t-ipconnect.de. [2003:c6:ebc5:6c00:4534:522a:e499:2bef]) by smtp.googlemail.com with ESMTPSA id w70sm4605530wrc.47.2017.01.26.14.12.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jan 2017 14:12:53 -0800 (PST) To: Ulf Hansson , Kevin Hilman , Carlo Caione From: Heiner Kallweit Subject: [PATCH] mmc: meson-gx: add support for HS400 mode Message-ID: Date: Thu, 26 Jan 2017 23:12:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170126_141415_470013_E5548C66 X-CRM114-Status: UNSURE ( 7.74 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, "linux-arm-kernel@lists.infradead.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.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 Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman --- 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 030425be..be45d57d 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)