All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: MMC 4.4 DDR support
@ 2010-07-09  6:59 ` Hanumath Prasad
  0 siblings, 0 replies; 32+ messages in thread
From: Hanumath Prasad @ 2010-07-09  6:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: STEricsson_nomadik_linux, linus.walleij, Hanumath Prasad, linux-mmc

Add support for Dual Data Rate MMC cards as defined in the 4.4
specification.

Cc: linux-mmc@vger.kernel.org
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
---
 drivers/mmc/card/block.c |   10 +++++++---
 drivers/mmc/core/mmc.c   |   37 +++++++++++++++++++++++++++++++++++--
 include/linux/mmc/card.h |    5 +++++
 include/linux/mmc/core.h |    1 +
 include/linux/mmc/host.h |    4 ++++
 include/linux/mmc/mmc.h  |   11 +++++++++--
 6 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index cb9fbc8..4eb84eb 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -299,7 +299,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
 			readcmd = MMC_READ_SINGLE_BLOCK;
 			writecmd = MMC_WRITE_BLOCK;
 		}
-
+		if (mmc_card_ddr_mode(card))
+			brq.data.flags |= MMC_DDR_MODE;
 		if (rq_data_dir(req) == READ) {
 			brq.cmd.opcode = readcmd;
 			brq.data.flags |= MMC_DATA_READ;
@@ -569,8 +570,11 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
 	struct mmc_command cmd;
 	int err;
 
-	/* Block-addressed cards ignore MMC_SET_BLOCKLEN. */
-	if (mmc_card_blockaddr(card))
+	/*
+	 * Block-addressed and ddr mode supported cards
+	 * ignore MMC_SET_BLOCKLEN.
+	 */
+	if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
 		return 0;
 
 	mmc_claim_host(card->host);
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 89f7a25..1d33503 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -227,6 +227,21 @@ static int mmc_read_ext_csd(struct mmc_card *card)
 	}
 
 	switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
+	case EXT_CSD_CARD_TYPE_DDR_52 | EXT_CSD_CARD_TYPE_52 |
+	     EXT_CSD_CARD_TYPE_26:
+		card->ext_csd.hs_max_dtr = 52000000;
+		card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_52;
+		break;
+	case EXT_CSD_CARD_TYPE_DDR_1_2V | EXT_CSD_CARD_TYPE_52 |
+	     EXT_CSD_CARD_TYPE_26:
+		card->ext_csd.hs_max_dtr = 52000000;
+		card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_2V;
+		break;
+	case EXT_CSD_CARD_TYPE_DDR_1_8V | EXT_CSD_CARD_TYPE_52 |
+	     EXT_CSD_CARD_TYPE_26:
+		card->ext_csd.hs_max_dtr = 52000000;
+		card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_8V;
+		break;
 	case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
 		card->ext_csd.hs_max_dtr = 52000000;
 		break;
@@ -444,6 +459,18 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	mmc_set_clock(host, max_dtr);
 
 	/*
+	 * Activate DDR50 mode (if supported).
+	 */
+	if (mmc_card_highspeed(card)) {
+		if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
+			&& (host->caps & (MMC_CAP_1_8V_DDR)))
+				mmc_card_set_ddr_mode(card);
+		else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
+			&& (host->caps & (MMC_CAP_1_2V_DDR)))
+				mmc_card_set_ddr_mode(card);
+	}
+
+	/*
 	 * Activate wide bus (if supported).
 	 */
 	if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
@@ -451,10 +478,16 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		unsigned ext_csd_bit, bus_width;
 
 		if (host->caps & MMC_CAP_8_BIT_DATA) {
-			ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
+			if (mmc_card_ddr_mode(card))
+				ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8;
+			else
+				ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
 			bus_width = MMC_BUS_WIDTH_8;
 		} else {
-			ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
+			if (mmc_card_ddr_mode(card))
+				ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_4;
+			else
+				ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
 			bus_width = MMC_BUS_WIDTH_4;
 		}
 
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index d02d2c6..7d0aca8 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -44,6 +44,7 @@ struct mmc_ext_csd {
 	unsigned int		sa_timeout;		/* Units: 100ns */
 	unsigned int		hs_max_dtr;
 	unsigned int		sectors;
+	unsigned int            card_type;
 };
 
 struct sd_scr {
@@ -97,6 +98,8 @@ struct mmc_card {
 #define MMC_STATE_READONLY	(1<<1)		/* card is read-only */
 #define MMC_STATE_HIGHSPEED	(1<<2)		/* card is in high speed mode */
 #define MMC_STATE_BLOCKADDR	(1<<3)		/* card uses block-addressing */
+#define MMC_STATE_HIGHSPEED_DDR (1<<4)          /* card is in high speed */
+						/* dual data rate mode */
 	unsigned int		quirks; 	/* card quirks */
 #define MMC_QUIRK_LENIENT_FN0	(1<<0)		/* allow SDIO FN0 writes outside of the VS CCCR range */
 #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)	/* use func->cur_blksize */
@@ -129,11 +132,13 @@ struct mmc_card {
 #define mmc_card_present(c)	((c)->state & MMC_STATE_PRESENT)
 #define mmc_card_readonly(c)	((c)->state & MMC_STATE_READONLY)
 #define mmc_card_highspeed(c)	((c)->state & MMC_STATE_HIGHSPEED)
+#define mmc_card_ddr_mode(c)   ((c)->state & MMC_STATE_HIGHSPEED_DDR)
 #define mmc_card_blockaddr(c)	((c)->state & MMC_STATE_BLOCKADDR)
 
 #define mmc_card_set_present(c)	((c)->state |= MMC_STATE_PRESENT)
 #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
 #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
+#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR)
 #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
 
 static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index e4898e9..b31e47a 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -107,6 +107,7 @@ struct mmc_data {
 #define MMC_DATA_WRITE	(1 << 8)
 #define MMC_DATA_READ	(1 << 9)
 #define MMC_DATA_STREAM	(1 << 10)
+#define MMC_DDR_MODE    (1 << 11)
 
 	unsigned int		bytes_xfered;
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f65913c..c775290 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -155,6 +155,10 @@ struct mmc_host {
 #define MMC_CAP_DISABLE		(1 << 7)	/* Can the host be disabled */
 #define MMC_CAP_NONREMOVABLE	(1 << 8)	/* Nonremovable e.g. eMMC */
 #define MMC_CAP_WAIT_WHILE_BUSY	(1 << 9)	/* Waits while card is busy */
+#define MMC_CAP_1_8V_DDR        (1 << 10)       /* can support */
+						/* DDR mode at 1.8V */
+#define MMC_CAP_1_2V_DDR        (1 << 11)       /* can support */
+						/* DDR mode at 1.2V */
 
 	mmc_pm_flag_t		pm_caps;	/* supported pm features */
 
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 8a49cbf..fc446de 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -268,11 +268,18 @@ struct _mmc_csd {
 
 #define EXT_CSD_CARD_TYPE_26	(1<<0)	/* Card can run at 26MHz */
 #define EXT_CSD_CARD_TYPE_52	(1<<1)	/* Card can run at 52MHz */
-#define EXT_CSD_CARD_TYPE_MASK	0x3	/* Mask out reserved and DDR bits */
+#define EXT_CSD_CARD_TYPE_MASK	0xF     /* Mask out reserved bits */
+#define EXT_CSD_CARD_TYPE_DDR_1_8V  (1<<2)   /* Card can run at 52MHz */
+					     /* DDR mode @1.8V or 3V I/O */
+#define EXT_CSD_CARD_TYPE_DDR_1_2V  (1<<3)   /* Card can run at 52MHz */
+					     /* DDR mode @1.2V I/O */
+#define EXT_CSD_CARD_TYPE_DDR_52       (EXT_CSD_CARD_TYPE_DDR_1_8V  \
+					| EXT_CSD_CARD_TYPE_DDR_1_2V)
 
-#define EXT_CSD_BUS_WIDTH_1	0	/* Card is in 1 bit mode */
 #define EXT_CSD_BUS_WIDTH_4	1	/* Card is in 4 bit mode */
 #define EXT_CSD_BUS_WIDTH_8	2	/* Card is in 8 bit mode */
+#define EXT_CSD_DDR_BUS_WIDTH_4    5    /* Card is in 4 bit DDR mode */
+#define EXT_CSD_DDR_BUS_WIDTH_8    6    /* Card is in 8 bit DDR mode */
 
 /*
  * MMC_SWITCH access modes
-- 
1.6.3.3


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

* [PATCH] mmc: MMC 4.4 DDR support
@ 2010-07-09  6:59 ` Hanumath Prasad
  0 siblings, 0 replies; 32+ messages in thread
From: Hanumath Prasad @ 2010-07-09  6:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: STEricsson_nomadik_linux, linus.walleij, Hanumath Prasad, linux-mmc

Add support for Dual Data Rate MMC cards as defined in the 4.4
specification.

Cc: linux-mmc@vger.kernel.org
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
---
 drivers/mmc/card/block.c |   10 +++++++---
 drivers/mmc/core/mmc.c   |   37 +++++++++++++++++++++++++++++++++++--
 include/linux/mmc/card.h |    5 +++++
 include/linux/mmc/core.h |    1 +
 include/linux/mmc/host.h |    4 ++++
 include/linux/mmc/mmc.h  |   11 +++++++++--
 6 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index cb9fbc8..4eb84eb 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -299,7 +299,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
 			readcmd = MMC_READ_SINGLE_BLOCK;
 			writecmd = MMC_WRITE_BLOCK;
 		}
-
+		if (mmc_card_ddr_mode(card))
+			brq.data.flags |= MMC_DDR_MODE;
 		if (rq_data_dir(req) == READ) {
 			brq.cmd.opcode = readcmd;
 			brq.data.flags |= MMC_DATA_READ;
@@ -569,8 +570,11 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
 	struct mmc_command cmd;
 	int err;
 
-	/* Block-addressed cards ignore MMC_SET_BLOCKLEN. */
-	if (mmc_card_blockaddr(card))
+	/*
+	 * Block-addressed and ddr mode supported cards
+	 * ignore MMC_SET_BLOCKLEN.
+	 */
+	if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
 		return 0;
 
 	mmc_claim_host(card->host);
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 89f7a25..1d33503 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -227,6 +227,21 @@ static int mmc_read_ext_csd(struct mmc_card *card)
 	}
 
 	switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
+	case EXT_CSD_CARD_TYPE_DDR_52 | EXT_CSD_CARD_TYPE_52 |
+	     EXT_CSD_CARD_TYPE_26:
+		card->ext_csd.hs_max_dtr = 52000000;
+		card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_52;
+		break;
+	case EXT_CSD_CARD_TYPE_DDR_1_2V | EXT_CSD_CARD_TYPE_52 |
+	     EXT_CSD_CARD_TYPE_26:
+		card->ext_csd.hs_max_dtr = 52000000;
+		card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_2V;
+		break;
+	case EXT_CSD_CARD_TYPE_DDR_1_8V | EXT_CSD_CARD_TYPE_52 |
+	     EXT_CSD_CARD_TYPE_26:
+		card->ext_csd.hs_max_dtr = 52000000;
+		card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_8V;
+		break;
 	case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
 		card->ext_csd.hs_max_dtr = 52000000;
 		break;
@@ -444,6 +459,18 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	mmc_set_clock(host, max_dtr);
 
 	/*
+	 * Activate DDR50 mode (if supported).
+	 */
+	if (mmc_card_highspeed(card)) {
+		if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
+			&& (host->caps & (MMC_CAP_1_8V_DDR)))
+				mmc_card_set_ddr_mode(card);
+		else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
+			&& (host->caps & (MMC_CAP_1_2V_DDR)))
+				mmc_card_set_ddr_mode(card);
+	}
+
+	/*
 	 * Activate wide bus (if supported).
 	 */
 	if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
@@ -451,10 +478,16 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		unsigned ext_csd_bit, bus_width;
 
 		if (host->caps & MMC_CAP_8_BIT_DATA) {
-			ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
+			if (mmc_card_ddr_mode(card))
+				ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8;
+			else
+				ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
 			bus_width = MMC_BUS_WIDTH_8;
 		} else {
-			ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
+			if (mmc_card_ddr_mode(card))
+				ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_4;
+			else
+				ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
 			bus_width = MMC_BUS_WIDTH_4;
 		}
 
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index d02d2c6..7d0aca8 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -44,6 +44,7 @@ struct mmc_ext_csd {
 	unsigned int		sa_timeout;		/* Units: 100ns */
 	unsigned int		hs_max_dtr;
 	unsigned int		sectors;
+	unsigned int            card_type;
 };
 
 struct sd_scr {
@@ -97,6 +98,8 @@ struct mmc_card {
 #define MMC_STATE_READONLY	(1<<1)		/* card is read-only */
 #define MMC_STATE_HIGHSPEED	(1<<2)		/* card is in high speed mode */
 #define MMC_STATE_BLOCKADDR	(1<<3)		/* card uses block-addressing */
+#define MMC_STATE_HIGHSPEED_DDR (1<<4)          /* card is in high speed */
+						/* dual data rate mode */
 	unsigned int		quirks; 	/* card quirks */
 #define MMC_QUIRK_LENIENT_FN0	(1<<0)		/* allow SDIO FN0 writes outside of the VS CCCR range */
 #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)	/* use func->cur_blksize */
@@ -129,11 +132,13 @@ struct mmc_card {
 #define mmc_card_present(c)	((c)->state & MMC_STATE_PRESENT)
 #define mmc_card_readonly(c)	((c)->state & MMC_STATE_READONLY)
 #define mmc_card_highspeed(c)	((c)->state & MMC_STATE_HIGHSPEED)
+#define mmc_card_ddr_mode(c)   ((c)->state & MMC_STATE_HIGHSPEED_DDR)
 #define mmc_card_blockaddr(c)	((c)->state & MMC_STATE_BLOCKADDR)
 
 #define mmc_card_set_present(c)	((c)->state |= MMC_STATE_PRESENT)
 #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
 #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
+#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR)
 #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
 
 static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index e4898e9..b31e47a 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -107,6 +107,7 @@ struct mmc_data {
 #define MMC_DATA_WRITE	(1 << 8)
 #define MMC_DATA_READ	(1 << 9)
 #define MMC_DATA_STREAM	(1 << 10)
+#define MMC_DDR_MODE    (1 << 11)
 
 	unsigned int		bytes_xfered;
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f65913c..c775290 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -155,6 +155,10 @@ struct mmc_host {
 #define MMC_CAP_DISABLE		(1 << 7)	/* Can the host be disabled */
 #define MMC_CAP_NONREMOVABLE	(1 << 8)	/* Nonremovable e.g. eMMC */
 #define MMC_CAP_WAIT_WHILE_BUSY	(1 << 9)	/* Waits while card is busy */
+#define MMC_CAP_1_8V_DDR        (1 << 10)       /* can support */
+						/* DDR mode at 1.8V */
+#define MMC_CAP_1_2V_DDR        (1 << 11)       /* can support */
+						/* DDR mode at 1.2V */
 
 	mmc_pm_flag_t		pm_caps;	/* supported pm features */
 
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 8a49cbf..fc446de 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -268,11 +268,18 @@ struct _mmc_csd {
 
 #define EXT_CSD_CARD_TYPE_26	(1<<0)	/* Card can run at 26MHz */
 #define EXT_CSD_CARD_TYPE_52	(1<<1)	/* Card can run at 52MHz */
-#define EXT_CSD_CARD_TYPE_MASK	0x3	/* Mask out reserved and DDR bits */
+#define EXT_CSD_CARD_TYPE_MASK	0xF     /* Mask out reserved bits */
+#define EXT_CSD_CARD_TYPE_DDR_1_8V  (1<<2)   /* Card can run at 52MHz */
+					     /* DDR mode @1.8V or 3V I/O */
+#define EXT_CSD_CARD_TYPE_DDR_1_2V  (1<<3)   /* Card can run at 52MHz */
+					     /* DDR mode @1.2V I/O */
+#define EXT_CSD_CARD_TYPE_DDR_52       (EXT_CSD_CARD_TYPE_DDR_1_8V  \
+					| EXT_CSD_CARD_TYPE_DDR_1_2V)
 
-#define EXT_CSD_BUS_WIDTH_1	0	/* Card is in 1 bit mode */
 #define EXT_CSD_BUS_WIDTH_4	1	/* Card is in 4 bit mode */
 #define EXT_CSD_BUS_WIDTH_8	2	/* Card is in 8 bit mode */
+#define EXT_CSD_DDR_BUS_WIDTH_4    5    /* Card is in 4 bit DDR mode */
+#define EXT_CSD_DDR_BUS_WIDTH_8    6    /* Card is in 8 bit DDR mode */
 
 /*
  * MMC_SWITCH access modes
-- 
1.6.3.3


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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-07-09  6:59 ` Hanumath Prasad
  (?)
@ 2010-07-10  5:28 ` Kyungmin Park
  2010-07-10  5:29   ` Kyungmin Park
       [not found]   ` <81C3A93C17462B4BBD7E272753C10579169F9BD429@EXDCVYMBSTM005.EQ1STM.local>
  -1 siblings, 2 replies; 32+ messages in thread
From: Kyungmin Park @ 2010-07-10  5:28 UTC (permalink / raw)
  To: Hanumath Prasad
  Cc: linux-kernel, STEricsson_nomadik_linux, linus.walleij, linux-mmc

Hi,

Looks good to me except where's use the MMC_DDR_MODE. why do you set
brq.data.flags |= MMC_DDR_MODE?

Now my SDHCI host don't support eMMC 4.4 but the end of july I can test it.

Thank you,
Kyungmin Park

On Fri, Jul 9, 2010 at 3:59 PM, Hanumath Prasad
<hanumath.prasad@stericsson.com> wrote:
> Add support for Dual Data Rate MMC cards as defined in the 4.4
> specification.
>
> Cc: linux-mmc@vger.kernel.org
> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
> Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
> ---
>  drivers/mmc/card/block.c |   10 +++++++---
>  drivers/mmc/core/mmc.c   |   37 +++++++++++++++++++++++++++++++++++--
>  include/linux/mmc/card.h |    5 +++++
>  include/linux/mmc/core.h |    1 +
>  include/linux/mmc/host.h |    4 ++++
>  include/linux/mmc/mmc.h  |   11 +++++++++--
>  6 files changed, 61 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index cb9fbc8..4eb84eb 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -299,7 +299,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
>                        readcmd = MMC_READ_SINGLE_BLOCK;
>                        writecmd = MMC_WRITE_BLOCK;
>                }
> -
> +               if (mmc_card_ddr_mode(card))
> +                       brq.data.flags |= MMC_DDR_MODE;
>                if (rq_data_dir(req) == READ) {
>                        brq.cmd.opcode = readcmd;
>                        brq.data.flags |= MMC_DATA_READ;
> @@ -569,8 +570,11 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
>        struct mmc_command cmd;
>        int err;
>
> -       /* Block-addressed cards ignore MMC_SET_BLOCKLEN. */
> -       if (mmc_card_blockaddr(card))
> +       /*
> +        * Block-addressed and ddr mode supported cards
> +        * ignore MMC_SET_BLOCKLEN.
> +        */
> +       if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
>                return 0;
>
>        mmc_claim_host(card->host);
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 89f7a25..1d33503 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -227,6 +227,21 @@ static int mmc_read_ext_csd(struct mmc_card *card)
>        }
>
>        switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
> +       case EXT_CSD_CARD_TYPE_DDR_52 | EXT_CSD_CARD_TYPE_52 |
> +            EXT_CSD_CARD_TYPE_26:
> +               card->ext_csd.hs_max_dtr = 52000000;
> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_52;
> +               break;
> +       case EXT_CSD_CARD_TYPE_DDR_1_2V | EXT_CSD_CARD_TYPE_52 |
> +            EXT_CSD_CARD_TYPE_26:
> +               card->ext_csd.hs_max_dtr = 52000000;
> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_2V;
> +               break;
> +       case EXT_CSD_CARD_TYPE_DDR_1_8V | EXT_CSD_CARD_TYPE_52 |
> +            EXT_CSD_CARD_TYPE_26:
> +               card->ext_csd.hs_max_dtr = 52000000;
> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_8V;
> +               break;
>        case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>                card->ext_csd.hs_max_dtr = 52000000;
>                break;
> @@ -444,6 +459,18 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>        mmc_set_clock(host, max_dtr);
>
>        /*
> +        * Activate DDR50 mode (if supported).
> +        */
> +       if (mmc_card_highspeed(card)) {
> +               if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
> +                       && (host->caps & (MMC_CAP_1_8V_DDR)))
> +                               mmc_card_set_ddr_mode(card);
> +               else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
> +                       && (host->caps & (MMC_CAP_1_2V_DDR)))
> +                               mmc_card_set_ddr_mode(card);
> +       }
> +
> +       /*
>         * Activate wide bus (if supported).
>         */
>        if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
> @@ -451,10 +478,16 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>                unsigned ext_csd_bit, bus_width;
>
>                if (host->caps & MMC_CAP_8_BIT_DATA) {
> -                       ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
> +                       if (mmc_card_ddr_mode(card))
> +                               ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8;
> +                       else
> +                               ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
>                        bus_width = MMC_BUS_WIDTH_8;
>                } else {
> -                       ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
> +                       if (mmc_card_ddr_mode(card))
> +                               ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_4;
> +                       else
> +                               ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
>                        bus_width = MMC_BUS_WIDTH_4;
>                }
>
> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index d02d2c6..7d0aca8 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -44,6 +44,7 @@ struct mmc_ext_csd {
>        unsigned int            sa_timeout;             /* Units: 100ns */
>        unsigned int            hs_max_dtr;
>        unsigned int            sectors;
> +       unsigned int            card_type;
>  };
>
>  struct sd_scr {
> @@ -97,6 +98,8 @@ struct mmc_card {
>  #define MMC_STATE_READONLY     (1<<1)          /* card is read-only */
>  #define MMC_STATE_HIGHSPEED    (1<<2)          /* card is in high speed mode */
>  #define MMC_STATE_BLOCKADDR    (1<<3)          /* card uses block-addressing */
> +#define MMC_STATE_HIGHSPEED_DDR (1<<4)          /* card is in high speed */
> +                                               /* dual data rate mode */
>        unsigned int            quirks;         /* card quirks */
>  #define MMC_QUIRK_LENIENT_FN0  (1<<0)          /* allow SDIO FN0 writes outside of the VS CCCR range */
>  #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)   /* use func->cur_blksize */
> @@ -129,11 +132,13 @@ struct mmc_card {
>  #define mmc_card_present(c)    ((c)->state & MMC_STATE_PRESENT)
>  #define mmc_card_readonly(c)   ((c)->state & MMC_STATE_READONLY)
>  #define mmc_card_highspeed(c)  ((c)->state & MMC_STATE_HIGHSPEED)
> +#define mmc_card_ddr_mode(c)   ((c)->state & MMC_STATE_HIGHSPEED_DDR)
>  #define mmc_card_blockaddr(c)  ((c)->state & MMC_STATE_BLOCKADDR)
>
>  #define mmc_card_set_present(c)        ((c)->state |= MMC_STATE_PRESENT)
>  #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
>  #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
> +#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR)
>  #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
>
>  static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index e4898e9..b31e47a 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -107,6 +107,7 @@ struct mmc_data {
>  #define MMC_DATA_WRITE (1 << 8)
>  #define MMC_DATA_READ  (1 << 9)
>  #define MMC_DATA_STREAM        (1 << 10)
> +#define MMC_DDR_MODE    (1 << 11)
>
>        unsigned int            bytes_xfered;
>
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index f65913c..c775290 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -155,6 +155,10 @@ struct mmc_host {
>  #define MMC_CAP_DISABLE                (1 << 7)        /* Can the host be disabled */
>  #define MMC_CAP_NONREMOVABLE   (1 << 8)        /* Nonremovable e.g. eMMC */
>  #define MMC_CAP_WAIT_WHILE_BUSY        (1 << 9)        /* Waits while card is busy */
> +#define MMC_CAP_1_8V_DDR        (1 << 10)       /* can support */
> +                                               /* DDR mode at 1.8V */
> +#define MMC_CAP_1_2V_DDR        (1 << 11)       /* can support */
> +                                               /* DDR mode at 1.2V */
>
>        mmc_pm_flag_t           pm_caps;        /* supported pm features */
>
> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
> index 8a49cbf..fc446de 100644
> --- a/include/linux/mmc/mmc.h
> +++ b/include/linux/mmc/mmc.h
> @@ -268,11 +268,18 @@ struct _mmc_csd {
>
>  #define EXT_CSD_CARD_TYPE_26   (1<<0)  /* Card can run at 26MHz */
>  #define EXT_CSD_CARD_TYPE_52   (1<<1)  /* Card can run at 52MHz */
> -#define EXT_CSD_CARD_TYPE_MASK 0x3     /* Mask out reserved and DDR bits */
> +#define EXT_CSD_CARD_TYPE_MASK 0xF     /* Mask out reserved bits */
> +#define EXT_CSD_CARD_TYPE_DDR_1_8V  (1<<2)   /* Card can run at 52MHz */
> +                                            /* DDR mode @1.8V or 3V I/O */
> +#define EXT_CSD_CARD_TYPE_DDR_1_2V  (1<<3)   /* Card can run at 52MHz */
> +                                            /* DDR mode @1.2V I/O */
> +#define EXT_CSD_CARD_TYPE_DDR_52       (EXT_CSD_CARD_TYPE_DDR_1_8V  \
> +                                       | EXT_CSD_CARD_TYPE_DDR_1_2V)
>
> -#define EXT_CSD_BUS_WIDTH_1    0       /* Card is in 1 bit mode */
>  #define EXT_CSD_BUS_WIDTH_4    1       /* Card is in 4 bit mode */
>  #define EXT_CSD_BUS_WIDTH_8    2       /* Card is in 8 bit mode */
> +#define EXT_CSD_DDR_BUS_WIDTH_4    5    /* Card is in 4 bit DDR mode */
> +#define EXT_CSD_DDR_BUS_WIDTH_8    6    /* Card is in 8 bit DDR mode */
>
>  /*
>  * MMC_SWITCH access modes
> --
> 1.6.3.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-07-10  5:28 ` Kyungmin Park
@ 2010-07-10  5:29   ` Kyungmin Park
       [not found]   ` <81C3A93C17462B4BBD7E272753C10579169F9BD429@EXDCVYMBSTM005.EQ1STM.local>
  1 sibling, 0 replies; 32+ messages in thread
From: Kyungmin Park @ 2010-07-10  5:29 UTC (permalink / raw)
  To: Hanumath Prasad
  Cc: linux-kernel, STEricsson_nomadik_linux, linus.walleij, linux-mmc

On Sat, Jul 10, 2010 at 2:28 PM, Kyungmin Park <kmpark@infradead.org> wrote:
> Hi,
>
> Looks good to me except where's use the MMC_DDR_MODE. why do you set
> brq.data.flags |= MMC_DDR_MODE?
>
> Now my SDHCI host don't support eMMC 4.4 but the end of july I can test it.
Fixing eMMC 4.4 means DDR features at host.
>
> Thank you,
> Kyungmin Park
>
> On Fri, Jul 9, 2010 at 3:59 PM, Hanumath Prasad
> <hanumath.prasad@stericsson.com> wrote:
>> Add support for Dual Data Rate MMC cards as defined in the 4.4
>> specification.
>>
>> Cc: linux-mmc@vger.kernel.org
>> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
>> Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
>> ---
>>  drivers/mmc/card/block.c |   10 +++++++---
>>  drivers/mmc/core/mmc.c   |   37 +++++++++++++++++++++++++++++++++++--
>>  include/linux/mmc/card.h |    5 +++++
>>  include/linux/mmc/core.h |    1 +
>>  include/linux/mmc/host.h |    4 ++++
>>  include/linux/mmc/mmc.h  |   11 +++++++++--
>>  6 files changed, 61 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index cb9fbc8..4eb84eb 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -299,7 +299,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
>>                        readcmd = MMC_READ_SINGLE_BLOCK;
>>                        writecmd = MMC_WRITE_BLOCK;
>>                }
>> -
>> +               if (mmc_card_ddr_mode(card))
>> +                       brq.data.flags |= MMC_DDR_MODE;
>>                if (rq_data_dir(req) == READ) {
>>                        brq.cmd.opcode = readcmd;
>>                        brq.data.flags |= MMC_DATA_READ;
>> @@ -569,8 +570,11 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
>>        struct mmc_command cmd;
>>        int err;
>>
>> -       /* Block-addressed cards ignore MMC_SET_BLOCKLEN. */
>> -       if (mmc_card_blockaddr(card))
>> +       /*
>> +        * Block-addressed and ddr mode supported cards
>> +        * ignore MMC_SET_BLOCKLEN.
>> +        */
>> +       if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
>>                return 0;
>>
>>        mmc_claim_host(card->host);
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 89f7a25..1d33503 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -227,6 +227,21 @@ static int mmc_read_ext_csd(struct mmc_card *card)
>>        }
>>
>>        switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
>> +       case EXT_CSD_CARD_TYPE_DDR_52 | EXT_CSD_CARD_TYPE_52 |
>> +            EXT_CSD_CARD_TYPE_26:
>> +               card->ext_csd.hs_max_dtr = 52000000;
>> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_52;
>> +               break;
>> +       case EXT_CSD_CARD_TYPE_DDR_1_2V | EXT_CSD_CARD_TYPE_52 |
>> +            EXT_CSD_CARD_TYPE_26:
>> +               card->ext_csd.hs_max_dtr = 52000000;
>> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_2V;
>> +               break;
>> +       case EXT_CSD_CARD_TYPE_DDR_1_8V | EXT_CSD_CARD_TYPE_52 |
>> +            EXT_CSD_CARD_TYPE_26:
>> +               card->ext_csd.hs_max_dtr = 52000000;
>> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_8V;
>> +               break;
>>        case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>>                card->ext_csd.hs_max_dtr = 52000000;
>>                break;
>> @@ -444,6 +459,18 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>>        mmc_set_clock(host, max_dtr);
>>
>>        /*
>> +        * Activate DDR50 mode (if supported).
>> +        */
>> +       if (mmc_card_highspeed(card)) {
>> +               if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
>> +                       && (host->caps & (MMC_CAP_1_8V_DDR)))
>> +                               mmc_card_set_ddr_mode(card);
>> +               else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
>> +                       && (host->caps & (MMC_CAP_1_2V_DDR)))
>> +                               mmc_card_set_ddr_mode(card);
>> +       }
>> +
>> +       /*
>>         * Activate wide bus (if supported).
>>         */
>>        if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
>> @@ -451,10 +478,16 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>>                unsigned ext_csd_bit, bus_width;
>>
>>                if (host->caps & MMC_CAP_8_BIT_DATA) {
>> -                       ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
>> +                       if (mmc_card_ddr_mode(card))
>> +                               ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8;
>> +                       else
>> +                               ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
>>                        bus_width = MMC_BUS_WIDTH_8;
>>                } else {
>> -                       ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
>> +                       if (mmc_card_ddr_mode(card))
>> +                               ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_4;
>> +                       else
>> +                               ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
>>                        bus_width = MMC_BUS_WIDTH_4;
>>                }
>>
>> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
>> index d02d2c6..7d0aca8 100644
>> --- a/include/linux/mmc/card.h
>> +++ b/include/linux/mmc/card.h
>> @@ -44,6 +44,7 @@ struct mmc_ext_csd {
>>        unsigned int            sa_timeout;             /* Units: 100ns */
>>        unsigned int            hs_max_dtr;
>>        unsigned int            sectors;
>> +       unsigned int            card_type;
>>  };
>>
>>  struct sd_scr {
>> @@ -97,6 +98,8 @@ struct mmc_card {
>>  #define MMC_STATE_READONLY     (1<<1)          /* card is read-only */
>>  #define MMC_STATE_HIGHSPEED    (1<<2)          /* card is in high speed mode */
>>  #define MMC_STATE_BLOCKADDR    (1<<3)          /* card uses block-addressing */
>> +#define MMC_STATE_HIGHSPEED_DDR (1<<4)          /* card is in high speed */
>> +                                               /* dual data rate mode */
>>        unsigned int            quirks;         /* card quirks */
>>  #define MMC_QUIRK_LENIENT_FN0  (1<<0)          /* allow SDIO FN0 writes outside of the VS CCCR range */
>>  #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)   /* use func->cur_blksize */
>> @@ -129,11 +132,13 @@ struct mmc_card {
>>  #define mmc_card_present(c)    ((c)->state & MMC_STATE_PRESENT)
>>  #define mmc_card_readonly(c)   ((c)->state & MMC_STATE_READONLY)
>>  #define mmc_card_highspeed(c)  ((c)->state & MMC_STATE_HIGHSPEED)
>> +#define mmc_card_ddr_mode(c)   ((c)->state & MMC_STATE_HIGHSPEED_DDR)
>>  #define mmc_card_blockaddr(c)  ((c)->state & MMC_STATE_BLOCKADDR)
>>
>>  #define mmc_card_set_present(c)        ((c)->state |= MMC_STATE_PRESENT)
>>  #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
>>  #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
>> +#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR)
>>  #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
>>
>>  static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
>> index e4898e9..b31e47a 100644
>> --- a/include/linux/mmc/core.h
>> +++ b/include/linux/mmc/core.h
>> @@ -107,6 +107,7 @@ struct mmc_data {
>>  #define MMC_DATA_WRITE (1 << 8)
>>  #define MMC_DATA_READ  (1 << 9)
>>  #define MMC_DATA_STREAM        (1 << 10)
>> +#define MMC_DDR_MODE    (1 << 11)
>>
>>        unsigned int            bytes_xfered;
>>
>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
>> index f65913c..c775290 100644
>> --- a/include/linux/mmc/host.h
>> +++ b/include/linux/mmc/host.h
>> @@ -155,6 +155,10 @@ struct mmc_host {
>>  #define MMC_CAP_DISABLE                (1 << 7)        /* Can the host be disabled */
>>  #define MMC_CAP_NONREMOVABLE   (1 << 8)        /* Nonremovable e.g. eMMC */
>>  #define MMC_CAP_WAIT_WHILE_BUSY        (1 << 9)        /* Waits while card is busy */
>> +#define MMC_CAP_1_8V_DDR        (1 << 10)       /* can support */
>> +                                               /* DDR mode at 1.8V */
>> +#define MMC_CAP_1_2V_DDR        (1 << 11)       /* can support */
>> +                                               /* DDR mode at 1.2V */
>>
>>        mmc_pm_flag_t           pm_caps;        /* supported pm features */
>>
>> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
>> index 8a49cbf..fc446de 100644
>> --- a/include/linux/mmc/mmc.h
>> +++ b/include/linux/mmc/mmc.h
>> @@ -268,11 +268,18 @@ struct _mmc_csd {
>>
>>  #define EXT_CSD_CARD_TYPE_26   (1<<0)  /* Card can run at 26MHz */
>>  #define EXT_CSD_CARD_TYPE_52   (1<<1)  /* Card can run at 52MHz */
>> -#define EXT_CSD_CARD_TYPE_MASK 0x3     /* Mask out reserved and DDR bits */
>> +#define EXT_CSD_CARD_TYPE_MASK 0xF     /* Mask out reserved bits */
>> +#define EXT_CSD_CARD_TYPE_DDR_1_8V  (1<<2)   /* Card can run at 52MHz */
>> +                                            /* DDR mode @1.8V or 3V I/O */
>> +#define EXT_CSD_CARD_TYPE_DDR_1_2V  (1<<3)   /* Card can run at 52MHz */
>> +                                            /* DDR mode @1.2V I/O */
>> +#define EXT_CSD_CARD_TYPE_DDR_52       (EXT_CSD_CARD_TYPE_DDR_1_8V  \
>> +                                       | EXT_CSD_CARD_TYPE_DDR_1_2V)
>>
>> -#define EXT_CSD_BUS_WIDTH_1    0       /* Card is in 1 bit mode */
>>  #define EXT_CSD_BUS_WIDTH_4    1       /* Card is in 4 bit mode */
>>  #define EXT_CSD_BUS_WIDTH_8    2       /* Card is in 8 bit mode */
>> +#define EXT_CSD_DDR_BUS_WIDTH_4    5    /* Card is in 4 bit DDR mode */
>> +#define EXT_CSD_DDR_BUS_WIDTH_8    6    /* Card is in 8 bit DDR mode */
>>
>>  /*
>>  * MMC_SWITCH access modes
>> --
>> 1.6.3.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
       [not found]   ` <81C3A93C17462B4BBD7E272753C10579169F9BD429@EXDCVYMBSTM005.EQ1STM.local>
@ 2010-07-13  1:14     ` Kyungmin Park
  0 siblings, 0 replies; 32+ messages in thread
From: Kyungmin Park @ 2010-07-13  1:14 UTC (permalink / raw)
  To: P.Hanumath PRASAD
  Cc: linux-kernel, STEricsson_nomadik_linux, Linus WALLEIJ, linux-mmc

On Sat, Jul 10, 2010 at 2:40 PM, P.Hanumath PRASAD
<hanumath.prasad@stericsson.com> wrote:
> Hi,
>
> The MMC_DDR_MODE is the flag set in case if the device is set to DDR mode. And this flag is for the host to enable the DDR

Then where can I see your host drivers? I hope to see also.

I wonder if we use the DDR mode, then I first set the DDR mode at both
MMC and host. then no need to send DDR_MODE support for each request.
doesn't it?

Thank you,
Kyungmin Park

>
> Mode for the controller before doing any data transfers in DDR mode.
>
> Thanks & Regards,
> Hanumath
>
> -----Original Message-----
> From: kyungmin78@gmail.com [mailto:kyungmin78@gmail.com] On Behalf Of Kyungmin Park
> Sent: Saturday, July 10, 2010 10:58 AM
> To: P.Hanumath PRASAD
> Cc: linux-kernel@vger.kernel.org; STEricsson_nomadik_linux; Linus WALLEIJ; linux-mmc@vger.kernel.org
> Subject: Re: [PATCH] mmc: MMC 4.4 DDR support
>
> Hi,
>
> Looks good to me except where's use the MMC_DDR_MODE. why do you set
> brq.data.flags |= MMC_DDR_MODE?
>
> Now my SDHCI host don't support eMMC 4.4 but the end of july I can test it.
>
> Thank you,
> Kyungmin Park
>
> On Fri, Jul 9, 2010 at 3:59 PM, Hanumath Prasad
> <hanumath.prasad@stericsson.com> wrote:
>> Add support for Dual Data Rate MMC cards as defined in the 4.4
>> specification.
>>
>> Cc: linux-mmc@vger.kernel.org
>> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
>> Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
>> ---
>>  drivers/mmc/card/block.c |   10 +++++++---
>>  drivers/mmc/core/mmc.c   |   37 +++++++++++++++++++++++++++++++++++--
>>  include/linux/mmc/card.h |    5 +++++
>>  include/linux/mmc/core.h |    1 +
>>  include/linux/mmc/host.h |    4 ++++
>>  include/linux/mmc/mmc.h  |   11 +++++++++--
>>  6 files changed, 61 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index cb9fbc8..4eb84eb 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -299,7 +299,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
>>                        readcmd = MMC_READ_SINGLE_BLOCK;
>>                        writecmd = MMC_WRITE_BLOCK;
>>                }
>> -
>> +               if (mmc_card_ddr_mode(card))
>> +                       brq.data.flags |= MMC_DDR_MODE;
>>                if (rq_data_dir(req) == READ) {
>>                        brq.cmd.opcode = readcmd;
>>                        brq.data.flags |= MMC_DATA_READ;
>> @@ -569,8 +570,11 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
>>        struct mmc_command cmd;
>>        int err;
>>
>> -       /* Block-addressed cards ignore MMC_SET_BLOCKLEN. */
>> -       if (mmc_card_blockaddr(card))
>> +       /*
>> +        * Block-addressed and ddr mode supported cards
>> +        * ignore MMC_SET_BLOCKLEN.
>> +        */
>> +       if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
>>                return 0;
>>
>>        mmc_claim_host(card->host);
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 89f7a25..1d33503 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -227,6 +227,21 @@ static int mmc_read_ext_csd(struct mmc_card *card)
>>        }
>>
>>        switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
>> +       case EXT_CSD_CARD_TYPE_DDR_52 | EXT_CSD_CARD_TYPE_52 |
>> +            EXT_CSD_CARD_TYPE_26:
>> +               card->ext_csd.hs_max_dtr = 52000000;
>> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_52;
>> +               break;
>> +       case EXT_CSD_CARD_TYPE_DDR_1_2V | EXT_CSD_CARD_TYPE_52 |
>> +            EXT_CSD_CARD_TYPE_26:
>> +               card->ext_csd.hs_max_dtr = 52000000;
>> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_2V;
>> +               break;
>> +       case EXT_CSD_CARD_TYPE_DDR_1_8V | EXT_CSD_CARD_TYPE_52 |
>> +            EXT_CSD_CARD_TYPE_26:
>> +               card->ext_csd.hs_max_dtr = 52000000;
>> +               card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_8V;
>> +               break;
>>        case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
>>                card->ext_csd.hs_max_dtr = 52000000;
>>                break;
>> @@ -444,6 +459,18 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>>        mmc_set_clock(host, max_dtr);
>>
>>        /*
>> +        * Activate DDR50 mode (if supported).
>> +        */
>> +       if (mmc_card_highspeed(card)) {
>> +               if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
>> +                       && (host->caps & (MMC_CAP_1_8V_DDR)))
>> +                               mmc_card_set_ddr_mode(card);
>> +               else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
>> +                       && (host->caps & (MMC_CAP_1_2V_DDR)))
>> +                               mmc_card_set_ddr_mode(card);
>> +       }
>> +
>> +       /*
>>         * Activate wide bus (if supported).
>>         */
>>        if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
>> @@ -451,10 +478,16 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>>                unsigned ext_csd_bit, bus_width;
>>
>>                if (host->caps & MMC_CAP_8_BIT_DATA) {
>> -                       ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
>> +                       if (mmc_card_ddr_mode(card))
>> +                               ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8;
>> +                       else
>> +                               ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
>>                        bus_width = MMC_BUS_WIDTH_8;
>>                } else {
>> -                       ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
>> +                       if (mmc_card_ddr_mode(card))
>> +                               ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_4;
>> +                       else
>> +                               ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
>>                        bus_width = MMC_BUS_WIDTH_4;
>>                }
>>
>> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
>> index d02d2c6..7d0aca8 100644
>> --- a/include/linux/mmc/card.h
>> +++ b/include/linux/mmc/card.h
>> @@ -44,6 +44,7 @@ struct mmc_ext_csd {
>>        unsigned int            sa_timeout;             /* Units: 100ns */
>>        unsigned int            hs_max_dtr;
>>        unsigned int            sectors;
>> +       unsigned int            card_type;
>>  };
>>
>>  struct sd_scr {
>> @@ -97,6 +98,8 @@ struct mmc_card {
>>  #define MMC_STATE_READONLY     (1<<1)          /* card is read-only */
>>  #define MMC_STATE_HIGHSPEED    (1<<2)          /* card is in high speed mode */
>>  #define MMC_STATE_BLOCKADDR    (1<<3)          /* card uses block-addressing */
>> +#define MMC_STATE_HIGHSPEED_DDR (1<<4)          /* card is in high speed */
>> +                                               /* dual data rate mode */
>>        unsigned int            quirks;         /* card quirks */
>>  #define MMC_QUIRK_LENIENT_FN0  (1<<0)          /* allow SDIO FN0 writes outside of the VS CCCR range */
>>  #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)   /* use func->cur_blksize */
>> @@ -129,11 +132,13 @@ struct mmc_card {
>>  #define mmc_card_present(c)    ((c)->state & MMC_STATE_PRESENT)
>>  #define mmc_card_readonly(c)   ((c)->state & MMC_STATE_READONLY)
>>  #define mmc_card_highspeed(c)  ((c)->state & MMC_STATE_HIGHSPEED)
>> +#define mmc_card_ddr_mode(c)   ((c)->state & MMC_STATE_HIGHSPEED_DDR)
>>  #define mmc_card_blockaddr(c)  ((c)->state & MMC_STATE_BLOCKADDR)
>>
>>  #define mmc_card_set_present(c)        ((c)->state |= MMC_STATE_PRESENT)
>>  #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
>>  #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
>> +#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR)
>>  #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
>>
>>  static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
>> index e4898e9..b31e47a 100644
>> --- a/include/linux/mmc/core.h
>> +++ b/include/linux/mmc/core.h
>> @@ -107,6 +107,7 @@ struct mmc_data {
>>  #define MMC_DATA_WRITE (1 << 8)
>>  #define MMC_DATA_READ  (1 << 9)
>>  #define MMC_DATA_STREAM        (1 << 10)
>> +#define MMC_DDR_MODE    (1 << 11)
>>
>>        unsigned int            bytes_xfered;
>>
>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
>> index f65913c..c775290 100644
>> --- a/include/linux/mmc/host.h
>> +++ b/include/linux/mmc/host.h
>> @@ -155,6 +155,10 @@ struct mmc_host {
>>  #define MMC_CAP_DISABLE                (1 << 7)        /* Can the host be disabled */
>>  #define MMC_CAP_NONREMOVABLE   (1 << 8)        /* Nonremovable e.g. eMMC */
>>  #define MMC_CAP_WAIT_WHILE_BUSY        (1 << 9)        /* Waits while card is busy */
>> +#define MMC_CAP_1_8V_DDR        (1 << 10)       /* can support */
>> +                                               /* DDR mode at 1.8V */
>> +#define MMC_CAP_1_2V_DDR        (1 << 11)       /* can support */
>> +                                               /* DDR mode at 1.2V */
>>
>>        mmc_pm_flag_t           pm_caps;        /* supported pm features */
>>
>> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
>> index 8a49cbf..fc446de 100644
>> --- a/include/linux/mmc/mmc.h
>> +++ b/include/linux/mmc/mmc.h
>> @@ -268,11 +268,18 @@ struct _mmc_csd {
>>
>>  #define EXT_CSD_CARD_TYPE_26   (1<<0)  /* Card can run at 26MHz */
>>  #define EXT_CSD_CARD_TYPE_52   (1<<1)  /* Card can run at 52MHz */
>> -#define EXT_CSD_CARD_TYPE_MASK 0x3     /* Mask out reserved and DDR bits */
>> +#define EXT_CSD_CARD_TYPE_MASK 0xF     /* Mask out reserved bits */
>> +#define EXT_CSD_CARD_TYPE_DDR_1_8V  (1<<2)   /* Card can run at 52MHz */
>> +                                            /* DDR mode @1.8V or 3V I/O */
>> +#define EXT_CSD_CARD_TYPE_DDR_1_2V  (1<<3)   /* Card can run at 52MHz */
>> +                                            /* DDR mode @1.2V I/O */
>> +#define EXT_CSD_CARD_TYPE_DDR_52       (EXT_CSD_CARD_TYPE_DDR_1_8V  \
>> +                                       | EXT_CSD_CARD_TYPE_DDR_1_2V)
>>
>> -#define EXT_CSD_BUS_WIDTH_1    0       /* Card is in 1 bit mode */
>>  #define EXT_CSD_BUS_WIDTH_4    1       /* Card is in 4 bit mode */
>>  #define EXT_CSD_BUS_WIDTH_8    2       /* Card is in 8 bit mode */
>> +#define EXT_CSD_DDR_BUS_WIDTH_4    5    /* Card is in 4 bit DDR mode */
>> +#define EXT_CSD_DDR_BUS_WIDTH_8    6    /* Card is in 8 bit DDR mode */
>>
>>  /*
>>  * MMC_SWITCH access modes
>> --
>> 1.6.3.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-07-09  6:59 ` Hanumath Prasad
  (?)
  (?)
@ 2010-08-21 22:30 ` Linus Walleij
  2010-08-21 22:37   ` Chris Ball
  -1 siblings, 1 reply; 32+ messages in thread
From: Linus Walleij @ 2010-08-21 22:30 UTC (permalink / raw)
  To: linux-mmc, Andrew Morton
  Cc: linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad

2010/7/9 Hanumath Prasad <hanumath.prasad@stericsson.com>:

> Add support for Dual Data Rate MMC cards as defined in the 4.4
> specification.

Hm is there some problem with this patch or has the processing
of it simply stalled? When I read the thread I cannot see Hanumaths
answers on the list but it looks mainly like the patch is OK and
there is some chit-chat.

Can it be picked up? Everyone is going to need DDR MMC
for their eMMCs soon-ish.

Hanumath can you resend your comments to the list since they
seem to be lost.

Yours,
Linus Walleij

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-08-21 22:30 ` Linus Walleij
@ 2010-08-21 22:37   ` Chris Ball
  2010-08-23  7:21     ` Linus Walleij
  2010-08-23 20:48     ` Matt Fleming
  0 siblings, 2 replies; 32+ messages in thread
From: Chris Ball @ 2010-08-21 22:37 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-mmc, Andrew Morton, linux-kernel, STEricsson_nomadik_linux,
	Hanumath Prasad

Hi,

   > Hm is there some problem with this patch or has the processing of
   > it simply stalled? When I read the thread I cannot see Hanumaths
   > answers on the list but it looks mainly like the patch is OK and
   > there is some chit-chat.
   > 
   > Can it be picked up? Everyone is going to need DDR MMC for their
   > eMMCs soon-ish.

I'd like to dedicate more time to mmc/.  Do you think it'd be useful
for me to catch all the patches sent to linux-mmc@ into a public Git
tree, and periodically report on what went upstream via akpm and
what's still waiting?

Of course, the tree could also be used for testing.  Maybe even
automated testing, which I'm also interested in.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>
One Laptop Per Child

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-08-21 22:37   ` Chris Ball
@ 2010-08-23  7:21     ` Linus Walleij
  2010-08-23 20:48     ` Matt Fleming
  1 sibling, 0 replies; 32+ messages in thread
From: Linus Walleij @ 2010-08-23  7:21 UTC (permalink / raw)
  To: Chris Ball
  Cc: linux-mmc, Andrew Morton, linux-kernel, STEricsson_nomadik_linux,
	Hanumath Prasad

2010/8/22 Chris Ball <cjb@laptop.org>:

> I'd like to dedicate more time to mmc/.  Do you think it'd be useful
> for me to catch all the patches sent to linux-mmc@ into a public Git
> tree, and periodically report on what went upstream via akpm and
> what's still waiting?

That sounds very close to getting it participate in linux-next.

Which in turn would make it convenient for you to issue pull
requests to Linus (Torvalds) directly.

Which would make you the MMC subsystem maintainer...

So why not :-)

Yours,
Linus Walleij

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-08-21 22:37   ` Chris Ball
  2010-08-23  7:21     ` Linus Walleij
@ 2010-08-23 20:48     ` Matt Fleming
  2010-08-23 21:28       ` Andrew Morton
  2010-08-23 21:45       ` MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support) Chris Ball
  1 sibling, 2 replies; 32+ messages in thread
From: Matt Fleming @ 2010-08-23 20:48 UTC (permalink / raw)
  To: Chris Ball
  Cc: Linus Walleij, linux-mmc, Andrew Morton, linux-kernel,
	STEricsson_nomadik_linux, Hanumath Prasad

On Sat, Aug 21, 2010 at 06:37:45PM -0400, Chris Ball wrote:
> Hi,
> 
>    > Hm is there some problem with this patch or has the processing of
>    > it simply stalled? When I read the thread I cannot see Hanumaths
>    > answers on the list but it looks mainly like the patch is OK and
>    > there is some chit-chat.
>    > 
>    > Can it be picked up? Everyone is going to need DDR MMC for their
>    > eMMCs soon-ish.
> 
> I'd like to dedicate more time to mmc/.  Do you think it'd be useful
> for me to catch all the patches sent to linux-mmc@ into a public Git
> tree, and periodically report on what went upstream via akpm and
> what's still waiting?

It's possible Andrew has a reason that hasn't been picked up yet.

Maybe what we really need is to get patchwork setup for the linux-mmc
list? Other subsystem maintainers swear by it. That way, it'd be much
harder for patches to go unnoticed.

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-08-23 20:48     ` Matt Fleming
@ 2010-08-23 21:28       ` Andrew Morton
  2010-08-24 10:30           ` Adrian Hunter
  2010-08-23 21:45       ` MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support) Chris Ball
  1 sibling, 1 reply; 32+ messages in thread
From: Andrew Morton @ 2010-08-23 21:28 UTC (permalink / raw)
  To: Matt Fleming
  Cc: Chris Ball, Linus Walleij, linux-mmc, linux-kernel,
	STEricsson_nomadik_linux, Hanumath Prasad, Kyungmin Park

On Mon, 23 Aug 2010 21:48:29 +0100
Matt Fleming <matt@console-pimps.org> wrote:

> On Sat, Aug 21, 2010 at 06:37:45PM -0400, Chris Ball wrote:
> > Hi,
> > 
> >    > Hm is there some problem with this patch or has the processing of
> >    > it simply stalled? When I read the thread I cannot see Hanumaths
> >    > answers on the list but it looks mainly like the patch is OK and
> >    > there is some chit-chat.
> >    > 
> >    > Can it be picked up? Everyone is going to need DDR MMC for their
> >    > eMMCs soon-ish.
> > 
> > I'd like to dedicate more time to mmc/.  Do you think it'd be useful
> > for me to catch all the patches sent to linux-mmc@ into a public Git
> > tree, and periodically report on what went upstream via akpm and
> > what's still waiting?
> 
> It's possible Andrew has a reason that hasn't been picked up yet.
> 

Kyungmin Park's questions didn't seem adequately answered and the
discussion kind of died.

I updated the patch and merged it, but I'd like the outstanding
question(s) resolved.  ie: why do we add MMC_DDR_MODE, set it in
brq.data.flags and then never use it?



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

* MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support)
  2010-08-23 20:48     ` Matt Fleming
  2010-08-23 21:28       ` Andrew Morton
@ 2010-08-23 21:45       ` Chris Ball
  2010-08-23 22:05         ` Andrew Morton
  2010-09-14  0:33         ` Chris Ball
  1 sibling, 2 replies; 32+ messages in thread
From: Chris Ball @ 2010-08-23 21:45 UTC (permalink / raw)
  To: Matt Fleming; +Cc: Andrew Morton, Linus Walleij, linux-mmc

Hi,

   > It's possible Andrew has a reason that hasn't been picked up yet.
   > 
   > Maybe what we really need is to get patchwork setup for the
   > linux-mmc list? Other subsystem maintainers swear by it. That
   > way, it'd be much harder for patches to go unnoticed.

Sounds good -- if no-one objects, I'll send e-mail to ftpadmin@k.o
tomorrow asking for linux-mmc@ to be added to patchwork.k.o.

Andrew, how do you feel about MMC at the moment?  It seems like we
could mostly use more people reviewing patches, but do you think it'd
also help to have submitted patches go into a -next tree for testing?
Would you like to have someone else track down which patches got held
up along the way and should be revisited, or is that something you're
already doing?

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>
One Laptop Per Child

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

* Re: MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support)
  2010-08-23 21:45       ` MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support) Chris Ball
@ 2010-08-23 22:05         ` Andrew Morton
  2010-09-14  0:33         ` Chris Ball
  1 sibling, 0 replies; 32+ messages in thread
From: Andrew Morton @ 2010-08-23 22:05 UTC (permalink / raw)
  To: Chris Ball; +Cc: Matt Fleming, Linus Walleij, linux-mmc

On Mon, 23 Aug 2010 17:45:28 -0400
Chris Ball <cjb@laptop.org> wrote:

> Hi,
> 
>    > It's possible Andrew has a reason that hasn't been picked up yet.
>    > 
>    > Maybe what we really need is to get patchwork setup for the
>    > linux-mmc list? Other subsystem maintainers swear by it. That
>    > way, it'd be much harder for patches to go unnoticed.
> 
> Sounds good -- if no-one objects, I'll send e-mail to ftpadmin@k.o
> tomorrow asking for linux-mmc@ to be added to patchwork.k.o.
> 
> Andrew, how do you feel about MMC at the moment?  It seems like we
> could mostly use more people reviewing patches, but do you think it'd
> also help to have submitted patches go into a -next tree for testing?
> Would you like to have someone else track down which patches got held
> up along the way and should be revisited, or is that something you're
> already doing?
> 

I'm basically acting as a stopgap patch monkey until a real maintainer
comes along.

I'll happily read the patches myself but do very much like to see that
someone with mmc-specific experience has taken a look at them as well.

So for me, review really really helps.  The only other issue I have is
that I don't read the list often enough, so please do add me to cc on
replies if I was missed out on.

I actually "maintain" well over 100 "subsystems" in this manner[*]. 
Really I should be in MAINTAINERS for a lot of these so I get cc'ed
more reliably on those oddball once-off fixes.  But usually they're cc'ed
to lkml so I do see them.


[*]:

	grep '^# ' series

is below.  I have headings for "other maintainers trees" and headings
for "trees I maintain" and headings for random junk which probably
shouldn't be there any more.  That series file has been checked in 19194
times since Dec 2002.  I should get out more.


# 2.6.36
# me:
# 2.6.33, early
# acpi
# platform drivers
# x86
# alsa
# kgdb
# kmemcheck
# agp
# arm
# audit
# avr32
# btrfs
# ceph
# cifs
# cpufreq
# dm
# dmar (dwmw2)
# dma (Dan)
# dma-debug (Joerg Roedel <joerg.roedel@amd.com>)
# jfs
# pcmcia
# powerpc
# driver core
# dnotify
# drm
# dvb
# ecryptfs
# fscache
# fsnotify
# hpet
# i2c
# iommu
# irqs
# gfs
# hid
# hwpoison
# time
# ntp
# ia64
# ieee1394
# infiniband
# input
# kbuild
# kvm
# kvm/ia64
# lblnet
# leds
# libata
# pata
# ide
# m32r
# mfd
# microblaze
# async-tx
# mips
# mqueue
# mtd
# nfsd
# ntfs
# score
# spi
# squashfs
# ubi
# ubifs
# udf
# uwb
# connector (davem)
# atm
# wan
# irda
# i4l
# net
# netdev
# netfilter
# backlight
# battery
# blackfin
# bluetooth
# debugobjects
# ext4
# nfs
# ocfs2
# parisc
# security
# serial
# udf
# pci
# md
# perf
# regulator
# s390
# sched
# tejun stuff
# genirq
# lockdep
# fastboot
# rcu
# ftrace
# sh
# scsi
# block
# sparc
# staging
# uio
# usb
# v9fs
# vfs
# watchdog
# wireless
# xfs
# crypto
# xtensa
# rusty
# slab
# tty
# mm
# mmend
# security
# frv
# pagemap
# gigaset
# nommu
# sh
# h8/300
# alpha
# CPU hotplug
# power management
# m32r
# m68k
# mn10300
# cpuidle
# cris
# floppy
# uml
# v850
# Misc
# miscend
# drivers/misc
# *bmp085*: fold
# core kernel
# miscdev
# printk
# get_maintainer
# MAINTAINERS
# lib
# bkl removal
# sgi-xpc
# compat
# firmware
# mmc
# sdhci-*: perf regression (Albert Herranz <albert_herranz@yahoo.es>)
# checkpatch
# crc
# poll select
# epoll
# hwmon
# smm665: fold
# oss
# binfmt
# warn
# list
# topology:
# swiotlb
# kallsyms
# ramfs
# rwsem
# initramfs
# ncpfs
# dmi
# oprofile
# vt
# kprobes
# i2o
# xen
# autofs
# smbfs
# rtc
# gpio
# fbdev
# auxdisplay
# devmem
# pnp
# pnpbios
# pipe
# telephony
# minix
# ext2
# ext3
# befs
# isofs
# codafs
# nilfs
# hfs
# hfsplus
# ufs
# reiserfs
# hpfs
# hppfs
# fat
# quota
# documentation
# cgroups
# devcgroup
# memcgroup
# devscgroup
# cpusets
# ptrace
# utrace
# signals
# pgrp
# kmod
# coredump
# exit
# proc
# fork
# exec
# wait
# workqueues
# kthread
# cpu hotplug
# kdump
# idr
# ipc
# ipmi
# pty
# elf
# flat
# char
# hw_random
# drivers/misc
# partitions
# rapidio
# rbu
# keys
# sysctl
# pid management
# pidns
# userns
# edd
# nbd
# ioctl
# atmel
# aoe
# markers
# namespaces
# accounting
# taskstats
# random
# fuse
# futex
# edac
# gcov
# loop
# dma-mapping
# propagate these:
# adfs
# afs
# affs
# bfs
# panic
# parport
# pps
# memstick
# w1
# c2
# ramdisk
# kexec
# mmtimer
# ramzswap
# sysvfs
# cachefiles fs-cache
# markup_oops
# relayfs:
# aio
# dio
# omfs
# uv
# gru
# kfifo
# radix-tree
# resource
# ssb
# genclk
# cpualloc
# devpts
# byteorder
# unaligned
# cramfs
# ramoops
# ramzswap
# romfs
# freeze feature
# async
# vlynq
# qnx4
# static
# decompress
# ibft
# inflate deflate
# slow-work
# lkdtm
# lzo
# end
# debug stuff


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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-08-23 21:28       ` Andrew Morton
@ 2010-08-24 10:30           ` Adrian Hunter
  0 siblings, 0 replies; 32+ messages in thread
From: Adrian Hunter @ 2010-08-24 10:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matt Fleming, Chris Ball, Linus Walleij, linux-mmc, linux-kernel,
	STEricsson_nomadik_linux, Hanumath Prasad, Kyungmin Park

Andrew Morton wrote:
> On Mon, 23 Aug 2010 21:48:29 +0100
> Matt Fleming <matt@console-pimps.org> wrote:
> 
>> On Sat, Aug 21, 2010 at 06:37:45PM -0400, Chris Ball wrote:
>>> Hi,
>>>
>>>    > Hm is there some problem with this patch or has the processing of
>>>    > it simply stalled? When I read the thread I cannot see Hanumaths
>>>    > answers on the list but it looks mainly like the patch is OK and
>>>    > there is some chit-chat.
>>>    > 
>>>    > Can it be picked up? Everyone is going to need DDR MMC for their
>>>    > eMMCs soon-ish.
>>>
>>> I'd like to dedicate more time to mmc/.  Do you think it'd be useful
>>> for me to catch all the patches sent to linux-mmc@ into a public Git
>>> tree, and periodically report on what went upstream via akpm and
>>> what's still waiting?
>> It's possible Andrew has a reason that hasn't been picked up yet.
>>
> 
> Kyungmin Park's questions didn't seem adequately answered and the
> discussion kind of died.
> 
> I updated the patch and merged it, but I'd like the outstanding
> question(s) resolved.  ie: why do we add MMC_DDR_MODE, set it in
> brq.data.flags and then never use it?

I am not able to test DDR mode but it look to me that the patch
should be changed.  Here is a fix:

>From 8253aa16b1ab15974a3ba8f33566fe8e2cca29e6 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Tue, 24 Aug 2010 13:20:26 +0300
Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support

The DDR support patch needs the following fixes:

- The block driver does not need to know about DDR, any more
than it needs to know about bus width.
- Not only the card must be switched to DDR mode.  The host
controller must also be configured, which is done through
the 'set_ios()' function.
- Do not set the DDR mode state until after the switch command
is successful.
- Setting block length is not supported in DDR mode.  Make that
a core function and change the other place it is used (mmc_test)
also.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
 drivers/mmc/card/block.c    |   19 +++----------------
 drivers/mmc/card/mmc_test.c |   12 +-----------
 drivers/mmc/core/bus.c      |    6 ++++--
 drivers/mmc/core/core.c     |   28 ++++++++++++++++++++++++++--
 drivers/mmc/core/core.h     |    1 +
 drivers/mmc/core/mmc.c      |   21 +++++++++++----------
 include/linux/mmc/core.h    |    3 ++-
 include/linux/mmc/host.h    |    5 +++++
 8 files changed, 53 insertions(+), 42 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 24f39d7..1ec93bb 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -373,8 +373,6 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
 			readcmd = MMC_READ_SINGLE_BLOCK;
 			writecmd = MMC_WRITE_BLOCK;
 		}
-		if (mmc_card_ddr_mode(card))
-			brq.data.flags |= MMC_DDR_MODE;
 		if (rq_data_dir(req) == READ) {
 			brq.cmd.opcode = readcmd;
 			brq.data.flags |= MMC_DATA_READ;
@@ -652,26 +650,15 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
 static int
 mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
 {
-	struct mmc_command cmd;
 	int err;
 
-	/*
-	 * Block-addressed and ddr mode supported cards
-	 * ignore MMC_SET_BLOCKLEN.
-	 */
-	if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
-		return 0;
-
 	mmc_claim_host(card->host);
-	cmd.opcode = MMC_SET_BLOCKLEN;
-	cmd.arg = 512;
-	cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
-	err = mmc_wait_for_cmd(card->host, &cmd, 5);
+	err = mmc_set_blocklen(card, 512);
 	mmc_release_host(card->host);
 
 	if (err) {
-		printk(KERN_ERR "%s: unable to set block size to %d: %d\n",
-			md->disk->disk_name, cmd.arg, err);
+		printk(KERN_ERR "%s: unable to set block size to 512: %d\n",
+			md->disk->disk_name, err);
 		return -EINVAL;
 	}
 
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index 5dd8576..f80b759 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -100,17 +100,7 @@ struct mmc_test_card {
  */
 static int mmc_test_set_blksize(struct mmc_test_card *test, unsigned size)
 {
-	struct mmc_command cmd;
-	int ret;
-
-	cmd.opcode = MMC_SET_BLOCKLEN;
-	cmd.arg = size;
-	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
-	ret = mmc_wait_for_cmd(test->card->host, &cmd, 0);
-	if (ret)
-		return ret;
-
-	return 0;
+	return mmc_set_blocklen(test->card, size);
 }
 
 /*
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 7cd9749..dc36f39 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -254,14 +254,16 @@ int mmc_add_card(struct mmc_card *card)
 	}
 
 	if (mmc_host_is_spi(card->host)) {
-		printk(KERN_INFO "%s: new %s%s card on SPI\n",
+		printk(KERN_INFO "%s: new %s%s%s card on SPI\n",
 			mmc_hostname(card->host),
 			mmc_card_highspeed(card) ? "high speed " : "",
+			mmc_card_ddr_mode(card) ? "DDR " : "",
 			type);
 	} else {
-		printk(KERN_INFO "%s: new %s%s card at address %04x\n",
+		printk(KERN_INFO "%s: new %s%s%s card at address %04x\n",
 			mmc_hostname(card->host),
 			mmc_card_highspeed(card) ? "high speed " : "",
+			mmc_card_ddr_mode(card) ? "DDR " : "",
 			type, card->rca);
 	}
 
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5db49b1..8519480 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -650,14 +650,23 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode)
 }
 
 /*
- * Change data bus width of a host.
+ * Change data bus width and DDR mode of a host.
  */
-void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
+void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr)
 {
 	host->ios.bus_width = width;
+	host->ios.ddr = ddr ? MMC_DDR_MODE : MMC_SDR_MODE;
 	mmc_set_ios(host);
 }
 
+/*
+ * Change data bus width of a host.
+ */
+void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
+{
+	mmc_set_bus_width_ddr(host, width, 0);
+}
+
 /**
  * mmc_vdd_to_ocrbitnum - Convert a voltage to the OCR bit number
  * @vdd:	voltage (mV)
@@ -1397,6 +1406,21 @@ int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
 }
 EXPORT_SYMBOL(mmc_erase_group_aligned);
 
+int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen)
+{
+	struct mmc_command cmd;
+
+	if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
+		return 0;
+
+	memset(&cmd, 0, sizeof(struct mmc_command));
+	cmd.opcode = MMC_SET_BLOCKLEN;
+	cmd.arg = blocklen;
+	cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
+	return mmc_wait_for_cmd(card->host, &cmd, 5);
+}
+EXPORT_SYMBOL(mmc_set_blocklen);
+
 void mmc_rescan(struct work_struct *work)
 {
 	struct mmc_host *host =
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 9d9eef5..68150c9 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -35,6 +35,7 @@ void mmc_set_chip_select(struct mmc_host *host, int mode);
 void mmc_set_clock(struct mmc_host *host, unsigned int hz);
 void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode);
 void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
+void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr);
 u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
 void mmc_set_timing(struct mmc_host *host, unsigned int timing);
 
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index dcfc921..998c0d3 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -375,7 +375,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	struct mmc_card *oldcard)
 {
 	struct mmc_card *card;
-	int err;
+	int err, ddr = 0;
 	u32 cid[4];
 	unsigned int max_dtr;
 
@@ -518,32 +518,32 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	mmc_set_clock(host, max_dtr);
 
 	/*
-	 * Activate DDR50 mode (if supported).
+	 * Indicate DDR mode (if supported).
 	 */
 	if (mmc_card_highspeed(card)) {
 		if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
 			&& (host->caps & (MMC_CAP_1_8V_DDR)))
-				mmc_card_set_ddr_mode(card);
+				ddr = 1;
 		else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
 			&& (host->caps & (MMC_CAP_1_2V_DDR)))
-				mmc_card_set_ddr_mode(card);
+				ddr = 1;
 	}
 
 	/*
-	 * Activate wide bus (if supported).
+	 * Activate wide bus and DDR (if supported).
 	 */
 	if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
 	    (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) {
-			if (mmc_card_ddr_mode(card))
+			if (ddr)
 				ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8;
 			else
 				ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
 			bus_width = MMC_BUS_WIDTH_8;
 		} else {
-			if (mmc_card_ddr_mode(card))
+			if (ddr)
 				ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_4;
 			else
 				ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
@@ -557,12 +557,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 			goto free_card;
 
 		if (err) {
-			printk(KERN_WARNING "%s: switch to bus width %d "
+			printk(KERN_WARNING "%s: switch to bus width %d ddr %d "
 			       "failed\n", mmc_hostname(card->host),
-			       1 << bus_width);
+			       1 << bus_width, ddr);
 			err = 0;
 		} else {
-			mmc_set_bus_width(card->host, bus_width);
+			mmc_card_set_ddr_mode(card);
+			mmc_set_bus_width_ddr(card->host, bus_width, ddr);
 		}
 	}
 
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 17bb4c2..64e013f 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -109,7 +109,6 @@ struct mmc_data {
 #define MMC_DATA_WRITE	(1 << 8)
 #define MMC_DATA_READ	(1 << 9)
 #define MMC_DATA_STREAM	(1 << 10)
-#define MMC_DDR_MODE    (1 << 11)
 
 	unsigned int		bytes_xfered;
 
@@ -154,6 +153,8 @@ extern int mmc_can_secure_erase_trim(struct mmc_card *card);
 extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
 				   unsigned int nr);
 
+extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
+
 extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
 extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 09dbb90..aa1a747 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -50,6 +50,11 @@ struct mmc_ios {
 #define MMC_TIMING_LEGACY	0
 #define MMC_TIMING_MMC_HS	1
 #define MMC_TIMING_SD_HS	2
+
+	unsigned char	ddr;			/* dual data rate used */
+
+#define MMC_SDR_MODE		0
+#define MMC_DDR_MODE		1
 };
 
 struct mmc_host_ops {
-- 
1.6.3.3

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
@ 2010-08-24 10:30           ` Adrian Hunter
  0 siblings, 0 replies; 32+ messages in thread
From: Adrian Hunter @ 2010-08-24 10:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matt Fleming, Chris Ball, Linus Walleij, linux-mmc, linux-kernel,
	STEricsson_nomadik_linux, Hanumath Prasad, Kyungmin Park

Andrew Morton wrote:
> On Mon, 23 Aug 2010 21:48:29 +0100
> Matt Fleming <matt@console-pimps.org> wrote:
> 
>> On Sat, Aug 21, 2010 at 06:37:45PM -0400, Chris Ball wrote:
>>> Hi,
>>>
>>>    > Hm is there some problem with this patch or has the processing of
>>>    > it simply stalled? When I read the thread I cannot see Hanumaths
>>>    > answers on the list but it looks mainly like the patch is OK and
>>>    > there is some chit-chat.
>>>    > 
>>>    > Can it be picked up? Everyone is going to need DDR MMC for their
>>>    > eMMCs soon-ish.
>>>
>>> I'd like to dedicate more time to mmc/.  Do you think it'd be useful
>>> for me to catch all the patches sent to linux-mmc@ into a public Git
>>> tree, and periodically report on what went upstream via akpm and
>>> what's still waiting?
>> It's possible Andrew has a reason that hasn't been picked up yet.
>>
> 
> Kyungmin Park's questions didn't seem adequately answered and the
> discussion kind of died.
> 
> I updated the patch and merged it, but I'd like the outstanding
> question(s) resolved.  ie: why do we add MMC_DDR_MODE, set it in
> brq.data.flags and then never use it?

I am not able to test DDR mode but it look to me that the patch
should be changed.  Here is a fix:

>From 8253aa16b1ab15974a3ba8f33566fe8e2cca29e6 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Tue, 24 Aug 2010 13:20:26 +0300
Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support

The DDR support patch needs the following fixes:

- The block driver does not need to know about DDR, any more
than it needs to know about bus width.
- Not only the card must be switched to DDR mode.  The host
controller must also be configured, which is done through
the 'set_ios()' function.
- Do not set the DDR mode state until after the switch command
is successful.
- Setting block length is not supported in DDR mode.  Make that
a core function and change the other place it is used (mmc_test)
also.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
 drivers/mmc/card/block.c    |   19 +++----------------
 drivers/mmc/card/mmc_test.c |   12 +-----------
 drivers/mmc/core/bus.c      |    6 ++++--
 drivers/mmc/core/core.c     |   28 ++++++++++++++++++++++++++--
 drivers/mmc/core/core.h     |    1 +
 drivers/mmc/core/mmc.c      |   21 +++++++++++----------
 include/linux/mmc/core.h    |    3 ++-
 include/linux/mmc/host.h    |    5 +++++
 8 files changed, 53 insertions(+), 42 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 24f39d7..1ec93bb 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -373,8 +373,6 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
 			readcmd = MMC_READ_SINGLE_BLOCK;
 			writecmd = MMC_WRITE_BLOCK;
 		}
-		if (mmc_card_ddr_mode(card))
-			brq.data.flags |= MMC_DDR_MODE;
 		if (rq_data_dir(req) == READ) {
 			brq.cmd.opcode = readcmd;
 			brq.data.flags |= MMC_DATA_READ;
@@ -652,26 +650,15 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
 static int
 mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
 {
-	struct mmc_command cmd;
 	int err;
 
-	/*
-	 * Block-addressed and ddr mode supported cards
-	 * ignore MMC_SET_BLOCKLEN.
-	 */
-	if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
-		return 0;
-
 	mmc_claim_host(card->host);
-	cmd.opcode = MMC_SET_BLOCKLEN;
-	cmd.arg = 512;
-	cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
-	err = mmc_wait_for_cmd(card->host, &cmd, 5);
+	err = mmc_set_blocklen(card, 512);
 	mmc_release_host(card->host);
 
 	if (err) {
-		printk(KERN_ERR "%s: unable to set block size to %d: %d\n",
-			md->disk->disk_name, cmd.arg, err);
+		printk(KERN_ERR "%s: unable to set block size to 512: %d\n",
+			md->disk->disk_name, err);
 		return -EINVAL;
 	}
 
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index 5dd8576..f80b759 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -100,17 +100,7 @@ struct mmc_test_card {
  */
 static int mmc_test_set_blksize(struct mmc_test_card *test, unsigned size)
 {
-	struct mmc_command cmd;
-	int ret;
-
-	cmd.opcode = MMC_SET_BLOCKLEN;
-	cmd.arg = size;
-	cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
-	ret = mmc_wait_for_cmd(test->card->host, &cmd, 0);
-	if (ret)
-		return ret;
-
-	return 0;
+	return mmc_set_blocklen(test->card, size);
 }
 
 /*
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 7cd9749..dc36f39 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -254,14 +254,16 @@ int mmc_add_card(struct mmc_card *card)
 	}
 
 	if (mmc_host_is_spi(card->host)) {
-		printk(KERN_INFO "%s: new %s%s card on SPI\n",
+		printk(KERN_INFO "%s: new %s%s%s card on SPI\n",
 			mmc_hostname(card->host),
 			mmc_card_highspeed(card) ? "high speed " : "",
+			mmc_card_ddr_mode(card) ? "DDR " : "",
 			type);
 	} else {
-		printk(KERN_INFO "%s: new %s%s card at address %04x\n",
+		printk(KERN_INFO "%s: new %s%s%s card at address %04x\n",
 			mmc_hostname(card->host),
 			mmc_card_highspeed(card) ? "high speed " : "",
+			mmc_card_ddr_mode(card) ? "DDR " : "",
 			type, card->rca);
 	}
 
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5db49b1..8519480 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -650,14 +650,23 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode)
 }
 
 /*
- * Change data bus width of a host.
+ * Change data bus width and DDR mode of a host.
  */
-void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
+void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr)
 {
 	host->ios.bus_width = width;
+	host->ios.ddr = ddr ? MMC_DDR_MODE : MMC_SDR_MODE;
 	mmc_set_ios(host);
 }
 
+/*
+ * Change data bus width of a host.
+ */
+void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
+{
+	mmc_set_bus_width_ddr(host, width, 0);
+}
+
 /**
  * mmc_vdd_to_ocrbitnum - Convert a voltage to the OCR bit number
  * @vdd:	voltage (mV)
@@ -1397,6 +1406,21 @@ int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
 }
 EXPORT_SYMBOL(mmc_erase_group_aligned);
 
+int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen)
+{
+	struct mmc_command cmd;
+
+	if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
+		return 0;
+
+	memset(&cmd, 0, sizeof(struct mmc_command));
+	cmd.opcode = MMC_SET_BLOCKLEN;
+	cmd.arg = blocklen;
+	cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
+	return mmc_wait_for_cmd(card->host, &cmd, 5);
+}
+EXPORT_SYMBOL(mmc_set_blocklen);
+
 void mmc_rescan(struct work_struct *work)
 {
 	struct mmc_host *host =
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 9d9eef5..68150c9 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -35,6 +35,7 @@ void mmc_set_chip_select(struct mmc_host *host, int mode);
 void mmc_set_clock(struct mmc_host *host, unsigned int hz);
 void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode);
 void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
+void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr);
 u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
 void mmc_set_timing(struct mmc_host *host, unsigned int timing);
 
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index dcfc921..998c0d3 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -375,7 +375,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	struct mmc_card *oldcard)
 {
 	struct mmc_card *card;
-	int err;
+	int err, ddr = 0;
 	u32 cid[4];
 	unsigned int max_dtr;
 
@@ -518,32 +518,32 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	mmc_set_clock(host, max_dtr);
 
 	/*
-	 * Activate DDR50 mode (if supported).
+	 * Indicate DDR mode (if supported).
 	 */
 	if (mmc_card_highspeed(card)) {
 		if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
 			&& (host->caps & (MMC_CAP_1_8V_DDR)))
-				mmc_card_set_ddr_mode(card);
+				ddr = 1;
 		else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
 			&& (host->caps & (MMC_CAP_1_2V_DDR)))
-				mmc_card_set_ddr_mode(card);
+				ddr = 1;
 	}
 
 	/*
-	 * Activate wide bus (if supported).
+	 * Activate wide bus and DDR (if supported).
 	 */
 	if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
 	    (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) {
-			if (mmc_card_ddr_mode(card))
+			if (ddr)
 				ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8;
 			else
 				ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
 			bus_width = MMC_BUS_WIDTH_8;
 		} else {
-			if (mmc_card_ddr_mode(card))
+			if (ddr)
 				ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_4;
 			else
 				ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
@@ -557,12 +557,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 			goto free_card;
 
 		if (err) {
-			printk(KERN_WARNING "%s: switch to bus width %d "
+			printk(KERN_WARNING "%s: switch to bus width %d ddr %d "
 			       "failed\n", mmc_hostname(card->host),
-			       1 << bus_width);
+			       1 << bus_width, ddr);
 			err = 0;
 		} else {
-			mmc_set_bus_width(card->host, bus_width);
+			mmc_card_set_ddr_mode(card);
+			mmc_set_bus_width_ddr(card->host, bus_width, ddr);
 		}
 	}
 
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 17bb4c2..64e013f 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -109,7 +109,6 @@ struct mmc_data {
 #define MMC_DATA_WRITE	(1 << 8)
 #define MMC_DATA_READ	(1 << 9)
 #define MMC_DATA_STREAM	(1 << 10)
-#define MMC_DDR_MODE    (1 << 11)
 
 	unsigned int		bytes_xfered;
 
@@ -154,6 +153,8 @@ extern int mmc_can_secure_erase_trim(struct mmc_card *card);
 extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
 				   unsigned int nr);
 
+extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
+
 extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
 extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 09dbb90..aa1a747 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -50,6 +50,11 @@ struct mmc_ios {
 #define MMC_TIMING_LEGACY	0
 #define MMC_TIMING_MMC_HS	1
 #define MMC_TIMING_SD_HS	2
+
+	unsigned char	ddr;			/* dual data rate used */
+
+#define MMC_SDR_MODE		0
+#define MMC_DDR_MODE		1
 };
 
 struct mmc_host_ops {
-- 
1.6.3.3

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

* Re: MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support)
  2010-08-23 21:45       ` MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support) Chris Ball
  2010-08-23 22:05         ` Andrew Morton
@ 2010-09-14  0:33         ` Chris Ball
  2010-09-14  6:26           ` Wolfram Sang
  1 sibling, 1 reply; 32+ messages in thread
From: Chris Ball @ 2010-09-14  0:33 UTC (permalink / raw)
  To: Matt Fleming; +Cc: Andrew Morton, Linus Walleij, linux-mmc

Hi,

On Mon, Aug 23, 2010 at 05:45:28PM -0400, Chris Ball wrote:
> Sounds good -- if no-one objects, I'll send e-mail to ftpadmin@k.o
> tomorrow asking for linux-mmc@ to be added to patchwork.k.o.

This is up now:  https://patchwork.kernel.org/project/linux-mmc/list/

J.H. kindly piped in the last 60 days of list traffic to seed the list
with.  I'll start going through them; if anyone would like permissions
to help with triage, feel free to ask.

Thanks,

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support)
  2010-09-14  0:33         ` Chris Ball
@ 2010-09-14  6:26           ` Wolfram Sang
  0 siblings, 0 replies; 32+ messages in thread
From: Wolfram Sang @ 2010-09-14  6:26 UTC (permalink / raw)
  To: Chris Ball; +Cc: Matt Fleming, Andrew Morton, Linus Walleij, linux-mmc

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

On Tue, Sep 14, 2010 at 01:33:22AM +0100, Chris Ball wrote:
> Hi,
> 
> On Mon, Aug 23, 2010 at 05:45:28PM -0400, Chris Ball wrote:
> > Sounds good -- if no-one objects, I'll send e-mail to ftpadmin@k.o
> > tomorrow asking for linux-mmc@ to be added to patchwork.k.o.
> 
> This is up now:  https://patchwork.kernel.org/project/linux-mmc/list/

Very good! Was just missing it yesterday \o/

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-08-24 10:30           ` Adrian Hunter
@ 2010-09-14 11:21             ` Chris Ball
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Ball @ 2010-09-14 11:21 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Andrew Morton, Matt Fleming, Linus Walleij, linux-mmc,
	linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad,
	Kyungmin Park

Hi Hanumath, Linus,

On Tue, Aug 24, 2010 at 01:30:45PM +0300, Adrian Hunter wrote:
> I am not able to test DDR mode but it look to me that the patch
> should be changed.  Here is a fix:
>
> From: Adrian Hunter <adrian.hunter@nokia.com>
> Date: Tue, 24 Aug 2010 13:20:26 +0300
> Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support

Could someone please test Adrian's patch and report back?  I'd like
to merge this, but not without testing.

https://patchwork.kernel.org/patch/177332/

Thanks,

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
@ 2010-09-14 11:21             ` Chris Ball
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Ball @ 2010-09-14 11:21 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Andrew Morton, Matt Fleming, Linus Walleij, linux-mmc,
	linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad,
	Kyungmin Park

Hi Hanumath, Linus,

On Tue, Aug 24, 2010 at 01:30:45PM +0300, Adrian Hunter wrote:
> I am not able to test DDR mode but it look to me that the patch
> should be changed.  Here is a fix:
>
> From: Adrian Hunter <adrian.hunter@nokia.com>
> Date: Tue, 24 Aug 2010 13:20:26 +0300
> Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support

Could someone please test Adrian's patch and report back?  I'd like
to merge this, but not without testing.

https://patchwork.kernel.org/patch/177332/

Thanks,

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* RE: [PATCH] mmc: MMC 4.4 DDR support
  2010-09-14 11:21             ` Chris Ball
@ 2010-09-15  9:32               ` Ghorai, Sukumar
  -1 siblings, 0 replies; 32+ messages in thread
From: Ghorai, Sukumar @ 2010-09-15  9:32 UTC (permalink / raw)
  To: Chris Ball, Adrian Hunter
  Cc: Andrew Morton, Matt Fleming, Linus Walleij, linux-mmc,
	linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad,
	Kyungmin Park


> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Chris Ball
> Sent: Tuesday, September 14, 2010 4:52 PM
> To: Adrian Hunter
> Cc: Andrew Morton; Matt Fleming; Linus Walleij; linux-mmc@vger.kernel.org;
> linux-kernel@vger.kernel.org; STEricsson_nomadik_linux@list.st.com;
> Hanumath Prasad; Kyungmin Park
> Subject: Re: [PATCH] mmc: MMC 4.4 DDR support
> 
> Hi Hanumath, Linus,
> 
> On Tue, Aug 24, 2010 at 01:30:45PM +0300, Adrian Hunter wrote:
> > I am not able to test DDR mode but it look to me that the patch
> > should be changed.  Here is a fix:
> >
> > From: Adrian Hunter <adrian.hunter@nokia.com>
> > Date: Tue, 24 Aug 2010 13:20:26 +0300
> > Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support
> 
> Could someone please test Adrian's patch and report back?  I'd like
> to merge this, but not without testing.
> 
> https://patchwork.kernel.org/patch/177332/

[Ghorai] I was testing this patch (Adrian's) and top of patch[1] from Hanumath; Looks working fine as functionality. Checking throughput in my omap platform.
[1] http://lkml.org/lkml/2010/7/9/35
But there are few comments on this patch from others, I think. And is not applying cleanly in latest codebase. Also following #define is conflicting with Hanumath's patch.
File: include/linux/mmc/host.h
#define MMC_CAP_ERASE           (1 << 10)

> 
> Thanks,
> 
> --
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH] mmc: MMC 4.4 DDR support
@ 2010-09-15  9:32               ` Ghorai, Sukumar
  0 siblings, 0 replies; 32+ messages in thread
From: Ghorai, Sukumar @ 2010-09-15  9:32 UTC (permalink / raw)
  To: Chris Ball, Adrian Hunter
  Cc: Andrew Morton, Matt Fleming, Linus Walleij, linux-mmc,
	linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad,
	Kyungmin Park


> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Chris Ball
> Sent: Tuesday, September 14, 2010 4:52 PM
> To: Adrian Hunter
> Cc: Andrew Morton; Matt Fleming; Linus Walleij; linux-mmc@vger.kernel.org;
> linux-kernel@vger.kernel.org; STEricsson_nomadik_linux@list.st.com;
> Hanumath Prasad; Kyungmin Park
> Subject: Re: [PATCH] mmc: MMC 4.4 DDR support
> 
> Hi Hanumath, Linus,
> 
> On Tue, Aug 24, 2010 at 01:30:45PM +0300, Adrian Hunter wrote:
> > I am not able to test DDR mode but it look to me that the patch
> > should be changed.  Here is a fix:
> >
> > From: Adrian Hunter <adrian.hunter@nokia.com>
> > Date: Tue, 24 Aug 2010 13:20:26 +0300
> > Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support
> 
> Could someone please test Adrian's patch and report back?  I'd like
> to merge this, but not without testing.
> 
> https://patchwork.kernel.org/patch/177332/

[Ghorai] I was testing this patch (Adrian's) and top of patch[1] from Hanumath; Looks working fine as functionality. Checking throughput in my omap platform.
[1] http://lkml.org/lkml/2010/7/9/35
But there are few comments on this patch from others, I think. And is not applying cleanly in latest codebase. Also following #define is conflicting with Hanumath's patch.
File: include/linux/mmc/host.h
#define MMC_CAP_ERASE           (1 << 10)

> 
> Thanks,
> 
> --
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH] mmc: MMC 4.4 DDR support
  2010-09-14 11:21             ` Chris Ball
@ 2010-09-20  4:34               ` Ghorai, Sukumar
  -1 siblings, 0 replies; 32+ messages in thread
From: Ghorai, Sukumar @ 2010-09-20  4:34 UTC (permalink / raw)
  To: Chris Ball, Adrian Hunter
  Cc: Andrew Morton, Matt Fleming, Linus Walleij, linux-mmc,
	linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad,
	Kyungmin Park


> -----Original Message-----
> From: Ghorai, Sukumar
> Sent: Wednesday, September 15, 2010 3:02 PM
> To: 'Chris Ball'; Adrian Hunter
> Cc: Andrew Morton; Matt Fleming; Linus Walleij; linux-mmc@vger.kernel.org;
> linux-kernel@vger.kernel.org; STEricsson_nomadik_linux@list.st.com;
> Hanumath Prasad; Kyungmin Park
> Subject: RE: [PATCH] mmc: MMC 4.4 DDR support
> 
> 
> > -----Original Message-----
> > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> > owner@vger.kernel.org] On Behalf Of Chris Ball
> > Sent: Tuesday, September 14, 2010 4:52 PM
> > To: Adrian Hunter
> > Cc: Andrew Morton; Matt Fleming; Linus Walleij; linux-
> mmc@vger.kernel.org;
> > linux-kernel@vger.kernel.org; STEricsson_nomadik_linux@list.st.com;
> > Hanumath Prasad; Kyungmin Park
> > Subject: Re: [PATCH] mmc: MMC 4.4 DDR support
> >
> > Hi Hanumath, Linus,
> >
> > On Tue, Aug 24, 2010 at 01:30:45PM +0300, Adrian Hunter wrote:
> > > I am not able to test DDR mode but it look to me that the patch
> > > should be changed.  Here is a fix:
> > >
> > > From: Adrian Hunter <adrian.hunter@nokia.com>
> > > Date: Tue, 24 Aug 2010 13:20:26 +0300
> > > Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support
> >
> > Could someone please test Adrian's patch and report back?  I'd like
> > to merge this, but not without testing.
> >
> > https://patchwork.kernel.org/patch/177332/
> 
> [Ghorai] I was testing this patch (Adrian's) and top of patch[1] from
> Hanumath; Looks working fine as functionality. Checking throughput in my
> omap platform.
> [1] http://lkml.org/lkml/2010/7/9/35
> But there are few comments on this patch from others, I think. And is not
> applying cleanly in latest codebase. Also following #define is conflicting
> with Hanumath's patch.
> File: include/linux/mmc/host.h
> #define MMC_CAP_ERASE           (1 << 10)

[Ghorai] 
Chris and all,
Can we plan these patches for 2.6.37 release? 
Also let me know if I can do anything!

Thanks,
Ghorai
> 
> >
> > Thanks,
> >
> > --
> > Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> > One Laptop Per Child
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH] mmc: MMC 4.4 DDR support
@ 2010-09-20  4:34               ` Ghorai, Sukumar
  0 siblings, 0 replies; 32+ messages in thread
From: Ghorai, Sukumar @ 2010-09-20  4:34 UTC (permalink / raw)
  To: Chris Ball, Adrian Hunter
  Cc: Andrew Morton, Matt Fleming, Linus Walleij, linux-mmc,
	linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad,
	Kyungmin Park


> -----Original Message-----
> From: Ghorai, Sukumar
> Sent: Wednesday, September 15, 2010 3:02 PM
> To: 'Chris Ball'; Adrian Hunter
> Cc: Andrew Morton; Matt Fleming; Linus Walleij; linux-mmc@vger.kernel.org;
> linux-kernel@vger.kernel.org; STEricsson_nomadik_linux@list.st.com;
> Hanumath Prasad; Kyungmin Park
> Subject: RE: [PATCH] mmc: MMC 4.4 DDR support
> 
> 
> > -----Original Message-----
> > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> > owner@vger.kernel.org] On Behalf Of Chris Ball
> > Sent: Tuesday, September 14, 2010 4:52 PM
> > To: Adrian Hunter
> > Cc: Andrew Morton; Matt Fleming; Linus Walleij; linux-
> mmc@vger.kernel.org;
> > linux-kernel@vger.kernel.org; STEricsson_nomadik_linux@list.st.com;
> > Hanumath Prasad; Kyungmin Park
> > Subject: Re: [PATCH] mmc: MMC 4.4 DDR support
> >
> > Hi Hanumath, Linus,
> >
> > On Tue, Aug 24, 2010 at 01:30:45PM +0300, Adrian Hunter wrote:
> > > I am not able to test DDR mode but it look to me that the patch
> > > should be changed.  Here is a fix:
> > >
> > > From: Adrian Hunter <adrian.hunter@nokia.com>
> > > Date: Tue, 24 Aug 2010 13:20:26 +0300
> > > Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support
> >
> > Could someone please test Adrian's patch and report back?  I'd like
> > to merge this, but not without testing.
> >
> > https://patchwork.kernel.org/patch/177332/
> 
> [Ghorai] I was testing this patch (Adrian's) and top of patch[1] from
> Hanumath; Looks working fine as functionality. Checking throughput in my
> omap platform.
> [1] http://lkml.org/lkml/2010/7/9/35
> But there are few comments on this patch from others, I think. And is not
> applying cleanly in latest codebase. Also following #define is conflicting
> with Hanumath's patch.
> File: include/linux/mmc/host.h
> #define MMC_CAP_ERASE           (1 << 10)

[Ghorai] 
Chris and all,
Can we plan these patches for 2.6.37 release? 
Also let me know if I can do anything!

Thanks,
Ghorai
> 
> >
> > Thanks,
> >
> > --
> > Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> > One Laptop Per Child
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-09-20  4:34               ` Ghorai, Sukumar
@ 2010-09-22  2:20                 ` Chris Ball
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Ball @ 2010-09-22  2:20 UTC (permalink / raw)
  To: Ghorai, Sukumar
  Cc: Adrian Hunter, Andrew Morton, Matt Fleming, Linus Walleij,
	linux-mmc, linux-kernel, STEricsson_nomadik_linux,
	Hanumath Prasad, Kyungmin Park

Hi,

On Mon, Sep 20, 2010 at 10:04:39AM +0530, Ghorai, Sukumar wrote:
> Chris and all,
> Can we plan these patches for 2.6.37 release? 
> Also let me know if I can do anything!

I would like to merge this for .37, and the quirk and merge conflicts
are not a big deal.  First, though, I'd like to see at least some of:

* a reply from Hanumath to Kyungmin on the use of MMC_DDR_MODE,
  and which host controller the submitted patch was tested on.
* an acknowledgement/comment on Adrian's fixup patch
* an ACK on the original+fixup patch as mergeable from Adrian
* some explicit Tested-by: lines for the commit.

Thanks!

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
@ 2010-09-22  2:20                 ` Chris Ball
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Ball @ 2010-09-22  2:20 UTC (permalink / raw)
  To: Ghorai, Sukumar
  Cc: Adrian Hunter, Andrew Morton, Matt Fleming, Linus Walleij,
	linux-mmc, linux-kernel, STEricsson_nomadik_linux,
	Hanumath Prasad, Kyungmin Park

Hi,

On Mon, Sep 20, 2010 at 10:04:39AM +0530, Ghorai, Sukumar wrote:
> Chris and all,
> Can we plan these patches for 2.6.37 release? 
> Also let me know if I can do anything!

I would like to merge this for .37, and the quirk and merge conflicts
are not a big deal.  First, though, I'd like to see at least some of:

* a reply from Hanumath to Kyungmin on the use of MMC_DDR_MODE,
  and which host controller the submitted patch was tested on.
* an acknowledgement/comment on Adrian's fixup patch
* an ACK on the original+fixup patch as mergeable from Adrian
* some explicit Tested-by: lines for the commit.

Thanks!

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-09-22  2:20                 ` Chris Ball
@ 2010-09-30  8:06                   ` zhangfei gao
  -1 siblings, 0 replies; 32+ messages in thread
From: zhangfei gao @ 2010-09-30  8:06 UTC (permalink / raw)
  To: Chris Ball
  Cc: Ghorai, Sukumar, Adrian Hunter, Andrew Morton, Matt Fleming,
	Linus Walleij, linux-mmc, linux-kernel, STEricsson_nomadik_linux,
	Hanumath Prasad, Kyungmin Park

On Wed, Sep 22, 2010 at 10:20 AM, Chris Ball <cjb@laptop.org> wrote:
> Hi,
>
> On Mon, Sep 20, 2010 at 10:04:39AM +0530, Ghorai, Sukumar wrote:
>> Chris and all,
>> Can we plan these patches for 2.6.37 release?
>> Also let me know if I can do anything!
>
> I would like to merge this for .37, and the quirk and merge conflicts
> are not a big deal.  First, though, I'd like to see at least some of:
>
> * a reply from Hanumath to Kyungmin on the use of MMC_DDR_MODE,
>  and which host controller the submitted patch was tested on.
> * an acknowledgement/comment on Adrian's fixup patch
> * an ACK on the original+fixup patch as mergeable from Adrian
> * some explicit Tested-by: lines for the commit.

Thanks Hanumath for your patch to enable ddr mode for emmc 4.4, thanks
a lot for sharing the patch.
We have verifeid on sdhci-pxa with toshiba emmc.

Tested-by Zhangfei Gao <zhangfei.gao@marvell.com>
>
> Thanks!
>
> - Chris.
> --
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
@ 2010-09-30  8:06                   ` zhangfei gao
  0 siblings, 0 replies; 32+ messages in thread
From: zhangfei gao @ 2010-09-30  8:06 UTC (permalink / raw)
  To: Chris Ball
  Cc: Ghorai, Sukumar, Adrian Hunter, Andrew Morton, Matt Fleming,
	Linus Walleij, linux-mmc, linux-kernel, STEricsson_nomadik_linux,
	Hanumath Prasad, Kyungmin Park

On Wed, Sep 22, 2010 at 10:20 AM, Chris Ball <cjb@laptop.org> wrote:
> Hi,
>
> On Mon, Sep 20, 2010 at 10:04:39AM +0530, Ghorai, Sukumar wrote:
>> Chris and all,
>> Can we plan these patches for 2.6.37 release?
>> Also let me know if I can do anything!
>
> I would like to merge this for .37, and the quirk and merge conflicts
> are not a big deal.  First, though, I'd like to see at least some of:
>
> * a reply from Hanumath to Kyungmin on the use of MMC_DDR_MODE,
>  and which host controller the submitted patch was tested on.
> * an acknowledgement/comment on Adrian's fixup patch
> * an ACK on the original+fixup patch as mergeable from Adrian
> * some explicit Tested-by: lines for the commit.

Thanks Hanumath for your patch to enable ddr mode for emmc 4.4, thanks
a lot for sharing the patch.
We have verifeid on sdhci-pxa with toshiba emmc.

Tested-by Zhangfei Gao <zhangfei.gao@marvell.com>
>
> Thanks!
>
> - Chris.
> --
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-07-09  6:59 ` Hanumath Prasad
                   ` (2 preceding siblings ...)
  (?)
@ 2010-09-30 22:29 ` Chris Ball
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Ball @ 2010-09-30 22:29 UTC (permalink / raw)
  To: Hanumath Prasad
  Cc: linux-kernel, STEricsson_nomadik_linux, linus.walleij, linux-mmc

On Fri, Jul 09, 2010 at 12:29:40PM +0530, Hanumath Prasad wrote:
> Add support for Dual Data Rate MMC cards as defined in the 4.4
> specification.
> 
> Cc: linux-mmc@vger.kernel.org
> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
> Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com>

Thanks very much, pushed to mmc-next along with Zhangfei's Tested-By:
and Adrian's fixup patch.

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-08-24 10:30           ` Adrian Hunter
@ 2010-09-30 22:30             ` Chris Ball
  -1 siblings, 0 replies; 32+ messages in thread
From: Chris Ball @ 2010-09-30 22:30 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Andrew Morton, Matt Fleming, Linus Walleij, linux-mmc,
	linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad,
	Kyungmin Park

Hi,

On Tue, Aug 24, 2010 at 01:30:45PM +0300, Adrian Hunter wrote:
> From: Adrian Hunter <adrian.hunter@nokia.com>
> Date: Tue, 24 Aug 2010 13:20:26 +0300
> Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support
>
> The DDR support patch needs the following fixes:
>
> - The block driver does not need to know about DDR, any more
> than it needs to know about bus width.
> - Not only the card must be switched to DDR mode.  The host
> controller must also be configured, which is done through
> the 'set_ios()' function.
> - Do not set the DDR mode state until after the switch command
> is successful.
> - Setting block length is not supported in DDR mode.  Make that
> a core function and change the other place it is used (mmc_test)
> also.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>

Applied to mmc-next, thanks very much Adrian.

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
@ 2010-09-30 22:30             ` Chris Ball
  0 siblings, 0 replies; 32+ messages in thread
From: Chris Ball @ 2010-09-30 22:30 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Andrew Morton, Matt Fleming, Linus Walleij, linux-mmc,
	linux-kernel, STEricsson_nomadik_linux, Hanumath Prasad,
	Kyungmin Park

Hi,

On Tue, Aug 24, 2010 at 01:30:45PM +0300, Adrian Hunter wrote:
> From: Adrian Hunter <adrian.hunter@nokia.com>
> Date: Tue, 24 Aug 2010 13:20:26 +0300
> Subject: [PATCH] mmc: Fix Dual Data Rate (DDR) support
>
> The DDR support patch needs the following fixes:
>
> - The block driver does not need to know about DDR, any more
> than it needs to know about bus width.
> - Not only the card must be switched to DDR mode.  The host
> controller must also be configured, which is done through
> the 'set_ios()' function.
> - Do not set the DDR mode state until after the switch command
> is successful.
> - Setting block length is not supported in DDR mode.  Make that
> a core function and change the other place it is used (mmc_test)
> also.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>

Applied to mmc-next, thanks very much Adrian.

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-10-08  7:02 ` Adrian Hunter
@ 2010-10-08 15:26   ` Philip Rakity
  0 siblings, 0 replies; 32+ messages in thread
From: Philip Rakity @ 2010-10-08 15:26 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-mmc



Adrian,

Let me rephrase my question.  

I don't see why both CAPS are needed and why the voltage is specified in the CAPS.  If my understanding is correct the voltage range supported by the host controller is known in the MMC layer.  If the voltage range is supported  and the MMC chip capability says it supports DDR in that range that should be enough for the mmc layer to decide to use DDR.  The host controller should only set the one CAPS option that say the controller supports DDR.
 
On Oct 8, 2010, at 12:02 AM, Adrian Hunter wrote:

> On 01/10/10 06:01, ext Philip Rakity wrote:
>> 
>> I was wondering if we could remove one of the CAPS for DDR voltage (MMC_CAP_1_8V_DDR and MMC_CAP_1_2V_DDR). Both 1.2 and 1.8v are defined in the JEDEC Standard No. 84-A441.
>> 
>> The sd 3.0 host controller only defines the option for 1.8v.  I cannot see a way to set 1.2v.
>> 
>> If this makes sense I can prepare a patch.--
> 
> If the host controller does not support 1.2V DDR then it should definitely
> not set MMC_CAP_1_2V_DDR.  That is precisely what the caps are for.
> 
> 
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
> 


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

* Re: [PATCH] mmc: MMC 4.4 DDR support
  2010-10-01  3:01 Philip Rakity
@ 2010-10-08  7:02 ` Adrian Hunter
  2010-10-08 15:26   ` Philip Rakity
  0 siblings, 1 reply; 32+ messages in thread
From: Adrian Hunter @ 2010-10-08  7:02 UTC (permalink / raw)
  To: Philip Rakity; +Cc: linux-mmc

On 01/10/10 06:01, ext Philip Rakity wrote:
>
> I was wondering if we could remove one of the CAPS for DDR voltage (MMC_CAP_1_8V_DDR and MMC_CAP_1_2V_DDR). Both 1.2 and 1.8v are defined in the JEDEC Standard No. 84-A441.
>
> The sd 3.0 host controller only defines the option for 1.8v.  I cannot see a way to set 1.2v.
>
> If this makes sense I can prepare a patch.--

If the host controller does not support 1.2V DDR then it should definitely
not set MMC_CAP_1_2V_DDR.  That is precisely what the caps are for.


> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


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

* Re: [PATCH] mmc: MMC 4.4 DDR support
@ 2010-10-01  3:01 Philip Rakity
  2010-10-08  7:02 ` Adrian Hunter
  0 siblings, 1 reply; 32+ messages in thread
From: Philip Rakity @ 2010-10-01  3:01 UTC (permalink / raw)
  To: linux-mmc


I was wondering if we could remove one of the CAPS for DDR voltage (MMC_CAP_1_8V_DDR and MMC_CAP_1_2V_DDR). Both 1.2 and 1.8v are defined in the JEDEC Standard No. 84-A441.

The sd 3.0 host controller only defines the option for 1.8v.  I cannot see a way to set 1.2v. 

If this makes sense I can prepare a patch.

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

end of thread, other threads:[~2010-10-08 15:26 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-09  6:59 [PATCH] mmc: MMC 4.4 DDR support Hanumath Prasad
2010-07-09  6:59 ` Hanumath Prasad
2010-07-10  5:28 ` Kyungmin Park
2010-07-10  5:29   ` Kyungmin Park
     [not found]   ` <81C3A93C17462B4BBD7E272753C10579169F9BD429@EXDCVYMBSTM005.EQ1STM.local>
2010-07-13  1:14     ` Kyungmin Park
2010-08-21 22:30 ` Linus Walleij
2010-08-21 22:37   ` Chris Ball
2010-08-23  7:21     ` Linus Walleij
2010-08-23 20:48     ` Matt Fleming
2010-08-23 21:28       ` Andrew Morton
2010-08-24 10:30         ` Adrian Hunter
2010-08-24 10:30           ` Adrian Hunter
2010-09-14 11:21           ` Chris Ball
2010-09-14 11:21             ` Chris Ball
2010-09-15  9:32             ` Ghorai, Sukumar
2010-09-15  9:32               ` Ghorai, Sukumar
2010-09-20  4:34             ` Ghorai, Sukumar
2010-09-20  4:34               ` Ghorai, Sukumar
2010-09-22  2:20               ` Chris Ball
2010-09-22  2:20                 ` Chris Ball
2010-09-30  8:06                 ` zhangfei gao
2010-09-30  8:06                   ` zhangfei gao
2010-09-30 22:30           ` Chris Ball
2010-09-30 22:30             ` Chris Ball
2010-08-23 21:45       ` MMC workflow (was Re: [PATCH] mmc: MMC 4.4 DDR support) Chris Ball
2010-08-23 22:05         ` Andrew Morton
2010-09-14  0:33         ` Chris Ball
2010-09-14  6:26           ` Wolfram Sang
2010-09-30 22:29 ` [PATCH] mmc: MMC 4.4 DDR support Chris Ball
2010-10-01  3:01 Philip Rakity
2010-10-08  7:02 ` Adrian Hunter
2010-10-08 15:26   ` Philip Rakity

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.