All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: MMC: Add 8-bit bus width support
@ 2008-12-26 17:47 David Brownell
  2008-12-26 19:13 ` Philip Langdale
  0 siblings, 1 reply; 7+ messages in thread
From: David Brownell @ 2008-12-26 17:47 UTC (permalink / raw)
  To: Jarkko Lavinen; +Cc: Pierre Ossman, lkml, Ben Dooks

> I am not aware of mmc cards having 8 pins yet.

Transcend seems to have one that's reasonably available;
NewEgg has the 4GB card for $US 9.50, and Transcend sells
it direct too (at least in the US).  I'm a bit curious
what read rates they achieve ... likely not 50 MB/sec!

The relevant search keyword seems to be "MMCplus".

A third use for 8-bit bus widths is the CE-ATA.org stuff
(ATA over MMC) ... I'm not sure how real that is, but the
Seagate website has two "Lyrion" products of 30MB and 60MB
using 8-bit MMC for small disks.  I had thought bigger
drives had been announced (e.g. from Samsung, 200+ MB);
maybe they're visible only through OEM channels.

- Dave


^ permalink raw reply	[flat|nested] 7+ messages in thread
* MMC: Add 8-bit bus width support
@ 2008-11-17 12:35 Jarkko Lavinen
  2008-11-17 12:49 ` Ben Dooks
  2008-11-30 19:11 ` Pierre Ossman
  0 siblings, 2 replies; 7+ messages in thread
From: Jarkko Lavinen @ 2008-11-17 12:35 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: LKML

Hi Pierre

Here is a patch which adds 8-bit bus width suport to the mmc
driver common part.  

I've tested it with a test board with 8-bit eMMC device on Omap
3420 HSMMC controller. It speeds up DMA transfer from host to the
card and most of the time is spent in busy polling for the card
to become ready.

Regards
Jarkko Lavinen

>From d038f6ebe177f3f4ae2ae1f8a9dfc648e5625909 Mon Sep 17 00:00:00 2001
From: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Date: Mon, 17 Nov 2008 14:30:17 +0200
Subject: [PATCH] MMC: Add 8-bit bus width support

Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
---
 drivers/mmc/core/mmc.c   |   18 ++++++++++++++----
 include/linux/mmc/host.h |    2 ++
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index fdd7c76..c232d11 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -434,13 +434,24 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	 * Activate wide bus (if supported).
 	 */
 	if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
-		(host->caps & MMC_CAP_4_BIT_DATA)) {
+	    (host->caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA))) {
+		unsigned ext_csd_bit, bus_width;
+
+		if (host->caps & MMC_CAP_8_BIT_DATA) {
+			ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
+			bus_width = MMC_BUS_WIDTH_8;
+		} else {
+			ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
+			bus_width = MMC_BUS_WIDTH_4;
+		}
+
 		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-			EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_4);
+				 EXT_CSD_BUS_WIDTH, ext_csd_bit);
+
 		if (err)
 			goto free_card;
 
-		mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
+		mmc_set_bus_width(card->host, bus_width);
 	}
 
 	if (!oldcard)
@@ -624,4 +635,3 @@ err:
 
 	return err;
 }
-
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f842f23..4e45725 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -41,6 +41,7 @@ struct mmc_ios {
 
 #define MMC_BUS_WIDTH_1		0
 #define MMC_BUS_WIDTH_4		2
+#define MMC_BUS_WIDTH_8		3
 
 	unsigned char	timing;			/* timing specification used */
 
@@ -116,6 +117,7 @@ struct mmc_host {
 #define MMC_CAP_SDIO_IRQ	(1 << 3)	/* Can signal pending SDIO IRQs */
 #define MMC_CAP_SPI		(1 << 4)	/* Talks only SPI protocols */
 #define MMC_CAP_NEEDS_POLL	(1 << 5)	/* Needs polling for card-detection */
+#define MMC_CAP_8_BIT_DATA	(1 << 6)	/* Can the host do 8 bit transfers */
 
 	/* host specific block data */
 	unsigned int		max_seg_size;	/* see blk_queue_max_segment_size */
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-12-26 19:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-26 17:47 MMC: Add 8-bit bus width support David Brownell
2008-12-26 19:13 ` Philip Langdale
2008-12-26 19:48   ` David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2008-11-17 12:35 Jarkko Lavinen
2008-11-17 12:49 ` Ben Dooks
2008-11-17 19:31   ` Jarkko Lavinen
2008-11-30 19:11 ` Pierre Ossman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.