diff options
author | Teppei Kamijou <teppei.kamijou.yb@renesas.com> | 2012-12-12 09:38:08 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-02-11 12:51:24 -0500 |
commit | 555061f987787a966b01e62517b9befbd35e2f89 (patch) | |
tree | d43970605c7c2f4bf8178c399855697552369cf0 /drivers/mmc/host | |
parent | 2cd5b3e061e3742de6b3a50f45f7d3b96aa50964 (diff) |
mmc: sh_mmcif: Add support for eMMC Dual Data Rate
Some MMCIF implementations support the Dual Data Rate. With this patch,
platforms can set the MMC_CAP_UHS_DDR50 capability flag in MMCIF platform
data. This will let the MMC core to actually use the DDR mode.
Signed-off-by: Teppei Kamijou <teppei.kamijou.yb@renesas.com>
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/sh_mmcif.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index c7984bad8efc..6d4328dce320 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c | |||
@@ -88,6 +88,7 @@ | |||
88 | #define CMD_SET_TBIT (1 << 7) /* 1: tran mission bit "Low" */ | 88 | #define CMD_SET_TBIT (1 << 7) /* 1: tran mission bit "Low" */ |
89 | #define CMD_SET_OPDM (1 << 6) /* 1: open/drain */ | 89 | #define CMD_SET_OPDM (1 << 6) /* 1: open/drain */ |
90 | #define CMD_SET_CCSH (1 << 5) | 90 | #define CMD_SET_CCSH (1 << 5) |
91 | #define CMD_SET_DARS (1 << 2) /* Dual Data Rate */ | ||
91 | #define CMD_SET_DATW_1 ((0 << 1) | (0 << 0)) /* 1bit */ | 92 | #define CMD_SET_DATW_1 ((0 << 1) | (0 << 0)) /* 1bit */ |
92 | #define CMD_SET_DATW_4 ((0 << 1) | (1 << 0)) /* 4bit */ | 93 | #define CMD_SET_DATW_4 ((0 << 1) | (1 << 0)) /* 4bit */ |
93 | #define CMD_SET_DATW_8 ((1 << 1) | (0 << 0)) /* 8bit */ | 94 | #define CMD_SET_DATW_8 ((1 << 1) | (0 << 0)) /* 8bit */ |
@@ -216,6 +217,7 @@ struct sh_mmcif_host { | |||
216 | struct clk *hclk; | 217 | struct clk *hclk; |
217 | unsigned int clk; | 218 | unsigned int clk; |
218 | int bus_width; | 219 | int bus_width; |
220 | unsigned char timing; | ||
219 | bool sd_error; | 221 | bool sd_error; |
220 | bool dying; | 222 | bool dying; |
221 | long timeout; | 223 | long timeout; |
@@ -781,6 +783,17 @@ static u32 sh_mmcif_set_cmd(struct sh_mmcif_host *host, | |||
781 | dev_err(&host->pd->dev, "Unsupported bus width.\n"); | 783 | dev_err(&host->pd->dev, "Unsupported bus width.\n"); |
782 | break; | 784 | break; |
783 | } | 785 | } |
786 | switch (host->timing) { | ||
787 | case MMC_TIMING_UHS_DDR50: | ||
788 | /* | ||
789 | * MMC core will only set this timing, if the host | ||
790 | * advertises the MMC_CAP_UHS_DDR50 capability. MMCIF | ||
791 | * implementations with this capability, e.g. sh73a0, | ||
792 | * will have to set it in their platform data. | ||
793 | */ | ||
794 | tmp |= CMD_SET_DARS; | ||
795 | break; | ||
796 | } | ||
784 | } | 797 | } |
785 | /* DWEN */ | 798 | /* DWEN */ |
786 | if (opc == MMC_WRITE_BLOCK || opc == MMC_WRITE_MULTIPLE_BLOCK) | 799 | if (opc == MMC_WRITE_BLOCK || opc == MMC_WRITE_MULTIPLE_BLOCK) |
@@ -1002,6 +1015,7 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
1002 | sh_mmcif_clock_control(host, ios->clock); | 1015 | sh_mmcif_clock_control(host, ios->clock); |
1003 | } | 1016 | } |
1004 | 1017 | ||
1018 | host->timing = ios->timing; | ||
1005 | host->bus_width = ios->bus_width; | 1019 | host->bus_width = ios->bus_width; |
1006 | host->state = STATE_IDLE; | 1020 | host->state = STATE_IDLE; |
1007 | } | 1021 | } |