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: 9548969 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 34BD0604A7 for ; Wed, 1 Feb 2017 06:50:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25C9F27E3E for ; Wed, 1 Feb 2017 06:50:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B4AB2841D; Wed, 1 Feb 2017 06:50:38 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,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 D56DA27F82 for ; Wed, 1 Feb 2017 06:50:37 +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 1cYokT-0004by-LX; Wed, 01 Feb 2017 06:50:33 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cYokD-00035t-O1 for linux-amlogic@lists.infradead.org; Wed, 01 Feb 2017 06:50:21 +0000 Received: by mail-wm0-x243.google.com with SMTP id r18so3592517wmd.3 for ; Tue, 31 Jan 2017 22:49:57 -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=YXCrhsOxJlNdqBgngIs9f8QXxtjoSisvuLOAOoEg0KgrQ+UZYWQzlmG2Cjs6JCMYEz hPfiTQ1XRZ/jnskdamiuKxIjJmh+oGoVGLgAONeHsBCc+LSbeARYte5bBToSu7mMOmBs Era98RSggqI3tVi5CFLE5JkDP8J3m+jWbJPRwtgjwNS4KpzS7Iy3mhNu3OxW2wrSy8It qURaER9RLhxjiKCEAgTH8Dhif/GFXUkSnIeSQB7E5ghOGecSKmmFRKvWrdDbYafJzBjn KSw9JHhI6G6HBbMg0GB7HuQsfQKYOzyWbEsvCRoGRd+Igk2iaH6jef4Wna5vkHjq3hTO R3GA== X-Gm-Message-State: AIkVDXKz3CJh2NCjJTEMHSGPUOgzjQdpA0wco4L1jtTSiVI2aL6HK8j8nRIjtEAktjyPkA== 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> 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170131_225018_570488_8B9B63DB X-CRM114-Status: UNSURE ( 7.75 ) 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-mmc@vger.kernel.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 --- 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)