diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2011-02-23 23:46:11 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-03-15 13:51:47 -0400 |
commit | 41babf753cc82ab6208903625a084bf305c32d06 (patch) | |
tree | 1418a029223084fc3860a64683b3a65b0baeec0a /drivers/mmc | |
parent | e7054ba1f73c0a0e2489251499bdbc21b88b4190 (diff) |
mmc: dw_mmc: support DDR mode
This patch adds DDR mode support to dw_mmc.
If we set any bit in UHS_REG bit[16:31], the card of that slot is
supported for 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>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 8 | ||||
-rw-r--r-- | 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 62c8440ff04b..58476c1bb056 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) | |||
662 | static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | 662 | static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) |
663 | { | 663 | { |
664 | struct dw_mci_slot *slot = mmc_priv(mmc); | 664 | struct dw_mci_slot *slot = mmc_priv(mmc); |
665 | u32 regs; | ||
665 | 666 | ||
666 | /* set default 1 bit mode */ | 667 | /* set default 1 bit mode */ |
667 | slot->ctype = SDMMC_CTYPE_1BIT; | 668 | slot->ctype = SDMMC_CTYPE_1BIT; |
@@ -678,6 +679,13 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
678 | break; | 679 | break; |
679 | } | 680 | } |
680 | 681 | ||
682 | /* DDR mode set */ | ||
683 | if (ios->ddr) { | ||
684 | regs = mci_readl(slot->host, UHS_REG); | ||
685 | regs |= (0x1 << slot->id) << 16; | ||
686 | mci_writel(slot->host, UHS_REG, regs); | ||
687 | } | ||
688 | |||
681 | if (ios->clock) { | 689 | if (ios->clock) { |
682 | /* | 690 | /* |
683 | * Use mirror of ios->clock to prevent race with mmc | 691 | * 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 5dd55a75233d..23c662af5616 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h | |||
@@ -43,6 +43,7 @@ | |||
43 | #define SDMMC_USRID 0x068 | 43 | #define SDMMC_USRID 0x068 |
44 | #define SDMMC_VERID 0x06c | 44 | #define SDMMC_VERID 0x06c |
45 | #define SDMMC_HCON 0x070 | 45 | #define SDMMC_HCON 0x070 |
46 | #define SDMMC_UHS_REG 0x074 | ||
46 | #define SDMMC_BMOD 0x080 | 47 | #define SDMMC_BMOD 0x080 |
47 | #define SDMMC_PLDMND 0x084 | 48 | #define SDMMC_PLDMND 0x084 |
48 | #define SDMMC_DBADDR 0x088 | 49 | #define SDMMC_DBADDR 0x088 |
@@ -51,7 +52,6 @@ | |||
51 | #define SDMMC_DSCADDR 0x094 | 52 | #define SDMMC_DSCADDR 0x094 |
52 | #define SDMMC_BUFADDR 0x098 | 53 | #define SDMMC_BUFADDR 0x098 |
53 | #define SDMMC_DATA 0x100 | 54 | #define SDMMC_DATA 0x100 |
54 | #define SDMMC_DATA_ADR 0x100 | ||
55 | 55 | ||
56 | /* shift bit field */ | 56 | /* shift bit field */ |
57 | #define _SBF(f, v) ((v) << (f)) | 57 | #define _SBF(f, v) ((v) << (f)) |