mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Glauber <jglauber@cavium.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: David Daney <david.daney@cavium.com>,
	"Steven J . Hill" <steven.hill@cavium.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jan Glauber <jglauber@cavium.com>
Subject: [PATCH v13 5/6] mmc: cavium: Support DDR mode for eMMC devices
Date: Thu, 30 Mar 2017 17:31:27 +0200	[thread overview]
Message-ID: <20170330153128.22842-6-jglauber@cavium.com> (raw)
In-Reply-To: <20170330153128.22842-1-jglauber@cavium.com>

Add support for switching to DDR mode for eMMC devices.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
---
 drivers/mmc/host/cavium.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/cavium.c b/drivers/mmc/host/cavium.c
index eebb387..d842b69 100644
--- a/drivers/mmc/host/cavium.c
+++ b/drivers/mmc/host/cavium.c
@@ -864,6 +864,10 @@ static void cvm_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		break;
 	}
 
+	/* DDR is available for 4/8 bit bus width */
+	if (ios->bus_width && ios->timing == MMC_TIMING_MMC_DDR52)
+		bus_width |= 4;
+
 	/* Change the clock frequency. */
 	clock = ios->clock;
 	if (clock > 52000000)
@@ -1032,8 +1036,14 @@ int cvm_mmc_of_slot_probe(struct device *dev, struct cvm_mmc_host *host)
 	/* Set up host parameters */
 	mmc->ops = &cvm_mmc_ops;
 
+	/*
+	 * We only have a 3.3v supply, we cannot support any
+	 * of the UHS modes. We do support the high speed DDR
+	 * modes up to 52MHz.
+	 */
 	mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-		     MMC_CAP_ERASE | MMC_CAP_CMD23 | MMC_CAP_POWER_OFF_CARD;
+		     MMC_CAP_ERASE | MMC_CAP_CMD23 | MMC_CAP_POWER_OFF_CARD |
+		     MMC_CAP_3_3V_DDR;
 
 	if (host->use_sg)
 		mmc->max_segs = 16;
-- 
2.9.0.rc0.21.g7777322

  parent reply	other threads:[~2017-03-30 15:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 15:31 [PATCH v13 0/6] Cavium MMC driver Jan Glauber
2017-03-30 15:31 ` [PATCH v13 1/6] dt-bindings: mmc: Add Cavium SOCs MMC bindings Jan Glauber
2017-03-30 15:31 ` [PATCH v13 2/6] mmc: cavium: Add core MMC driver for Cavium SOCs Jan Glauber
2017-03-30 15:31 ` [PATCH v13 3/6] mmc: cavium: Add MMC PCI driver for ThunderX SOCs Jan Glauber
2017-04-01  3:59   ` kbuild test robot
2017-04-01  4:46   ` kbuild test robot
2017-04-01 12:47     ` Jan Glauber
2017-03-30 15:31 ` [PATCH v13 4/6] mmc: cavium: Add scatter-gather DMA support Jan Glauber
2017-03-30 15:31 ` Jan Glauber [this message]
2017-03-30 15:31 ` [PATCH v13 6/6] MAINTAINERS: Add entry for Cavium MMC driver Jan Glauber
2017-04-10 14:50 ` [PATCH v13 0/6] " Ulf Hansson
2017-04-12 22:37 ` Aaro Koskinen
2017-04-12 23:21   ` Steven J. Hill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170330153128.22842-6-jglauber@cavium.com \
    --to=jglauber@cavium.com \
    --cc=david.daney@cavium.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=steven.hill@cavium.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®