Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jaehoon Chung and committed by
Chris Ball
41babf75 e7054ba1

+9 -1
+8
drivers/mmc/host/dw_mmc.c
··· 662 662 static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) 663 663 { 664 664 struct dw_mci_slot *slot = mmc_priv(mmc); 665 + u32 regs; 665 666 666 667 /* set default 1 bit mode */ 667 668 slot->ctype = SDMMC_CTYPE_1BIT; ··· 677 676 case MMC_BUS_WIDTH_8: 678 677 slot->ctype = SDMMC_CTYPE_8BIT; 679 678 break; 679 + } 680 + 681 + /* DDR mode set */ 682 + if (ios->ddr) { 683 + regs = mci_readl(slot->host, UHS_REG); 684 + regs |= (0x1 << slot->id) << 16; 685 + mci_writel(slot->host, UHS_REG, regs); 680 686 } 681 687 682 688 if (ios->clock) {
+1 -1
drivers/mmc/host/dw_mmc.h
··· 43 43 #define SDMMC_USRID 0x068 44 44 #define SDMMC_VERID 0x06c 45 45 #define SDMMC_HCON 0x070 46 + #define SDMMC_UHS_REG 0x074 46 47 #define SDMMC_BMOD 0x080 47 48 #define SDMMC_PLDMND 0x084 48 49 #define SDMMC_DBADDR 0x088 ··· 52 51 #define SDMMC_DSCADDR 0x094 53 52 #define SDMMC_BUFADDR 0x098 54 53 #define SDMMC_DATA 0x100 55 - #define SDMMC_DATA_ADR 0x100 56 54 57 55 /* shift bit field */ 58 56 #define _SBF(f, v) ((v) << (f))