public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dw_mmc: support DDR mode
@ 2011-02-24  4:46 Jaehoon Chung
  2011-02-24 10:22 ` Will Newton
  0 siblings, 1 reply; 3+ messages in thread
From: Jaehoon Chung @ 2011-02-24  4:46 UTC (permalink / raw)
  To: linux-mmc@vger.kernel.org; +Cc: will.newton, Chris Ball, Kyungmin Park

This patch is applied DDR mode in dw_mmc.

DW_MMC is supported DDR mode. 
If set any bit in UHS_REG bit[16:31], the card of that slot is supported DDR mode.
For example, if UHS_REG[16] is set, card number 0 is DDR mode.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/mmc/host/dw_mmc.c |    8 ++++++++
 drivers/mmc/host/dw_mmc.h |    2 +-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 62c8440..58476c1 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -662,6 +662,7 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 {
 	struct dw_mci_slot *slot = mmc_priv(mmc);
+	u32 regs;
 
 	/* set default 1 bit mode */
 	slot->ctype = SDMMC_CTYPE_1BIT;
@@ -678,6 +679,13 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		break;
 	}
 
+	/* DDR mode set */
+	if (ios->ddr) {
+		regs = mci_readl(slot->host, UHS_REG);
+		regs |= (0x1 << slot->id) << 16;
+		mci_writel(slot->host, UHS_REG, regs);
+	}
+
 	if (ios->clock) {
 		/*
 		 * Use mirror of ios->clock to prevent race with mmc
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index 5dd55a7..23c662a 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -43,6 +43,7 @@
 #define SDMMC_USRID		0x068
 #define SDMMC_VERID		0x06c
 #define SDMMC_HCON		0x070
+#define SDMMC_UHS_REG		0x074
 #define SDMMC_BMOD		0x080
 #define SDMMC_PLDMND		0x084
 #define SDMMC_DBADDR		0x088
@@ -51,7 +52,6 @@
 #define SDMMC_DSCADDR		0x094
 #define SDMMC_BUFADDR		0x098
 #define SDMMC_DATA		0x100
-#define SDMMC_DATA_ADR		0x100
 
 /* shift bit field */
 #define _SBF(f, v)		((v) << (f))

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

* Re: [PATCH] dw_mmc: support DDR mode
  2011-02-24  4:46 [PATCH] dw_mmc: support DDR mode Jaehoon Chung
@ 2011-02-24 10:22 ` Will Newton
  2011-02-24 15:19   ` Chris Ball
  0 siblings, 1 reply; 3+ messages in thread
From: Will Newton @ 2011-02-24 10:22 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc@vger.kernel.org, Chris Ball, Kyungmin Park

On Thu, Feb 24, 2011 at 4:46 AM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> This patch is applied DDR mode in dw_mmc.
>
> DW_MMC is supported DDR mode.
> If set any bit in UHS_REG bit[16:31], the card of that slot is supported DDR mode.
> For example, if UHS_REG[16] is set, card number 0 is DDR mode.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

This looks ok to me.

Acked-by: Will Newton <will.newton@imgtec.com>

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

* Re: [PATCH] dw_mmc: support DDR mode
  2011-02-24 10:22 ` Will Newton
@ 2011-02-24 15:19   ` Chris Ball
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Ball @ 2011-02-24 15:19 UTC (permalink / raw)
  To: Will Newton; +Cc: Jaehoon Chung, linux-mmc@vger.kernel.org, Kyungmin Park

On Thu, Feb 24, 2011 at 10:22:05AM +0000, Will Newton wrote:
> On Thu, Feb 24, 2011 at 4:46 AM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> > This patch is applied DDR mode in dw_mmc.
> >
> > DW_MMC is supported DDR mode.
> > If set any bit in UHS_REG bit[16:31], the card of that slot is supported DDR mode.
> > For example, if UHS_REG[16] is set, card number 0 is DDR mode.
> >
> > Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> 
> This looks ok to me.
> 
> Acked-by: Will Newton <will.newton@imgtec.com>

Thanks, pushed to mmc-next for .39.

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

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

end of thread, other threads:[~2011-02-24 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24  4:46 [PATCH] dw_mmc: support DDR mode Jaehoon Chung
2011-02-24 10:22 ` Will Newton
2011-02-24 15:19   ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox