From patchwork Wed Feb 1 06:49:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9548951 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 01E6760415 for ; Wed, 1 Feb 2017 06:50:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E626E27E3E for ; Wed, 1 Feb 2017 06:50:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9CF32811C; Wed, 1 Feb 2017 06:50:03 +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 6026127E3E for ; Wed, 1 Feb 2017 06:50:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751381AbdBAGuC (ORCPT ); Wed, 1 Feb 2017 01:50:02 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33381 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbdBAGuC (ORCPT ); Wed, 1 Feb 2017 01:50:02 -0500 Received: by mail-wm0-f65.google.com with SMTP id v77so3585719wmv.0 for ; Tue, 31 Jan 2017 22:49:56 -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=8A91nzy6z3F76Wkv84iIy9Fl86635S9QL7nGkPgwDFI=; b=oGfyEag24/pRhqacMVuSvSkdYq6OZoEaBkxM9zdtuR051o4/DEtn82m2tPdm8767eb adjcndS2zO4OHD1EieUcIIMTI7EygFY6pfD/xRM1HTgpKkiacjAGJKKMuxcGPZzI8/oU VjO8I7uDFqDLXY0mcx8/Mkw7EDBjxJChBCz9c+rgNMJO03fAg+wyhEO6eGTE359PIxpn JGabe2pxJZVC8WKDH7kKx8lnqvhx5eW0mMgiDEZ+x7NqjHsAaURpy/4SGjP+eFYrg+Wz 1LdTo2vOHyUHk1ercLQ4l+UlkriZ9h3Pphud2hsWH7iBkbT/ndTn5UaKiy2RjBhmyJTn SrKw== 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=8A91nzy6z3F76Wkv84iIy9Fl86635S9QL7nGkPgwDFI=; b=RRLnlx+AL5eHJcIxRSmm1OpPqwby+8+li4iosAkx9cJApPSOgWSY2Y/L3dfxBHssJ2 jwUQDxuI6dGbnjOy0qxIbIrovdBn0ALuRbiaNvmUT92IVc7bKfN8u530Qbtag4XDor8q adFmN8GtIuQof1xMg8whRHe2cS44QaYhjEBdypCI8NNSh6S0Q+AKupISppcK6QInU2W6 q8AZIM6PsKoOb/yPR9ihNWEknjsTfgdId9is1i9SWjMJSZBN8X0HUKB+Cb7WYNxM3DSH bclqa79qYHl6X0jgBKtFqkDM8qXUq0e/4elC8MYUACESqMtz0LmpNjPxfxstXAqMq/AT zRYg== X-Gm-Message-State: AIkVDXKd1vX3kP73skE4GXshXjgjfrvhKJMrwRaCcUvLyJ4CX8Fswo/fTJiUnv3tY4QjZQ== X-Received: by 10.28.129.5 with SMTP id c5mr1294622wmd.23.1485931795710; Tue, 31 Jan 2017 22:49:55 -0800 (PST) Received: from ?IPv6:2003:c6:ebc5:6c00:c4cb:dab7:ab36:4977? (p200300C6EBC56C00C4CBDAB7AB364977.dip0.t-ipconnect.de. [2003:c6:ebc5:6c00:c4cb:dab7:ab36:4977]) by smtp.googlemail.com with ESMTPSA id a35sm32424214wra.21.2017.01.31.22.49.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 22:49:55 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v2 9/9] mmc: meson-gx: add support for HS400 mode To: Ulf Hansson , Carlo Caione , Kevin Hilman References: <584e5061-d359-1436-05ee-3767a5a4b10f@gmail.com> Cc: linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org Message-ID: Date: Wed, 1 Feb 2017 07:49:36 +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: <584e5061-d359-1436-05ee-3767a5a4b10f@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 Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman --- v2: - added reviewed-by, tested-by --- 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)