From patchwork Wed Jan 14 20:46:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Riazantsev X-Patchwork-Id: 429241 X-Patchwork-Delegate: panto@antoniou-consulting.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4FC3B1401DA for ; Thu, 15 Jan 2015 16:21:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F27134B616; Thu, 15 Jan 2015 06:21:19 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b0qlqYy8vJKA; Thu, 15 Jan 2015 06:21:19 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3C2F84B60F; Thu, 15 Jan 2015 06:21:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D0B5F4B60F for ; Wed, 14 Jan 2015 21:42:16 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YDvxBTvSyhb1 for ; Wed, 14 Jan 2015 21:42:16 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from exprod5og111.obsmtp.com (exprod5og111.obsmtp.com [64.18.0.22]) by theia.denx.de (Postfix) with ESMTPS id 21CBC4B60B for ; Wed, 14 Jan 2015 21:42:13 +0100 (CET) Received: from mail-ie0-f176.google.com ([209.85.223.176]) (using TLSv1) by exprod5ob111.postini.com ([64.18.4.12]) with SMTP ID DSNKVLbUo9VYmwoXC1QCK48hFRENzu6MiuoZ@postini.com; Wed, 14 Jan 2015 12:42:16 PST Received: by mail-ie0-f176.google.com with SMTP id tr6so11159880ieb.7 for ; Wed, 14 Jan 2015 12:42:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=globallogic.com; s=google; h=from:to:cc:subject:date:message-id; bh=y2ro8Bs1Yx81DbZD2srX3NoqqWBJtRhd/8ThqX0Wj/g=; b=ZqGhUPAWazmGYcSYo3LtiB4ND3Gpyx7T2mF+cRT04QeIAm5gv+DGmoakOEhOTUtZ71 Nzu6/QM1LOXmVExf658kTy4tLX4imjfixf913pzoFIpDCosvI0vY6bLB+Nb8Pr8G9wZ0 uw1bzU30H3u+xSKeiGK58lwiZS/lQlEyaY2+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=y2ro8Bs1Yx81DbZD2srX3NoqqWBJtRhd/8ThqX0Wj/g=; b=LziPr78Q6FifYPi6AXEP+yYgu8HSs/0hvao5vlhCbiwiOpv+cW/MDgmhKJptMs84gy QKwAdHkNViu1CiTcXQRjIiGb/gPqYTA+gHrgn0DEoidvtsMB7sV3RQdjWSTfbFLgI3G9 i5iJLyTKj4gwmW0m6+gjhrzabyKY1EA/y9uj/ktbiYgajez5MNEA48zANWqpeuLbt5QY qJHcWOJICEiBL+sjm7Hi6msFoUpHGoRnwpkgS9JmJoU3pqgUn1/JTENrFxqtlKs9CZfl iUAp3OyGwZ7caWNFauKbzc81+TsMRQH+Qvw5FMNtD3BhHxxmD4UFhYzPP464qnD/4cyT rAQQ== X-Gm-Message-State: ALoCoQnB5zPC+Fg+zcDMhJ/65yC6ovibjvhuzIupPLRAHk8s3yZ6cb8UeqkUii9r1px4KWn1tdIAXto5eJMQ+iG+JQOjcJ92pwsYDPFkxDPbyd04Z00MCAVy3PtgCZXa05yxSpSvaI8I1BVFR6570/h8AHHq2gFxiw== X-Received: by 10.107.153.147 with SMTP id b141mr6437592ioe.49.1421268131592; Wed, 14 Jan 2015 12:42:11 -0800 (PST) X-Received: by 10.107.153.147 with SMTP id b141mr6437585ioe.49.1421268131467; Wed, 14 Jan 2015 12:42:11 -0800 (PST) Received: from rat.panasonicautomotive.com ([209.49.153.130]) by mx.google.com with ESMTPSA id vk4sm1936348igc.11.2015.01.14.12.42.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 14 Jan 2015 12:42:10 -0800 (PST) From: Volodymyr Riazantsev To: u-boot@lists.denx.de Date: Wed, 14 Jan 2015 15:46:06 -0500 Message-Id: <1421268366-13552-1-git-send-email-volodymyr.riazantsev@globallogic.com> X-Mailer: git-send-email 2.2.0 X-Mailman-Approved-At: Thu, 15 Jan 2015 06:21:18 +0100 Cc: yorksun@freescale.com Subject: [U-Boot] [PATCH] mmc: fsl_esdhc: Add support for DDR mode X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add support of the DDR mode for eSDHC driver. Enable it for i.MX6 SoC family only. Change-Id: Ie27a945c9fe79d044cc886e269b60747f1744116 Signed-off-by: Volodymyr Riazantsev --- drivers/mmc/fsl_esdhc.c | 8 ++++++-- include/fsl_esdhc.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index c55eb28..abec45f 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -319,7 +319,8 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) esdhc_write32(®s->cmdarg, cmd->cmdarg); #if defined(CONFIG_FSL_USDHC) esdhc_write32(®s->mixctrl, - (esdhc_read32(®s->mixctrl) & 0xFFFFFF80) | (xfertyp & 0x7F)); + (esdhc_read32(®s->mixctrl) & 0xFFFFFF80) | (xfertyp & 0x7F) + | (mmc->ddr_mode ? XFERTYP_DDREN : 0)); esdhc_write32(®s->xfertyp, xfertyp & 0xFFFF0000); #else esdhc_write32(®s->xfertyp, xfertyp); @@ -442,7 +443,7 @@ static void set_sysctl(struct mmc *mmc, uint clock) if ((sdhc_clk / (div * pre_div)) <= clock) break; - pre_div >>= 1; + pre_div >>= mmc->ddr_mode ? 2 : 1; div -= 1; clk = (pre_div << 8) | (div << 4); @@ -601,6 +602,9 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) } cfg->cfg.host_caps = MMC_MODE_4BIT | MMC_MODE_8BIT | MMC_MODE_HC; +#ifdef CONFIG_MX6 + cfg->cfg.host_caps |= MMC_MODE_DDR_52MHz; +#endif if (cfg->max_bus_width > 0) { if (cfg->max_bus_width < 8) diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h index c1b6648..313fa1e 100644 --- a/include/fsl_esdhc.h +++ b/include/fsl_esdhc.h @@ -108,6 +108,7 @@ #define XFERTYP_RSPTYP_48_BUSY 0x00030000 #define XFERTYP_MSBSEL 0x00000020 #define XFERTYP_DTDSEL 0x00000010 +#define XFERTYP_DDREN 0x00000008 #define XFERTYP_AC12EN 0x00000004 #define XFERTYP_BCEN 0x00000002 #define XFERTYP_DMAEN 0x00000001