aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2012-04-09 02:38:32 -0400
committerChris Ball <cjb@laptop.org>2012-04-22 11:16:43 -0400
commitdba3c29ea4a1d5d544f59b94fd8a41662135e071 (patch)
treef1134118b883fa329b9fd075d150dda2d6c168ce
parent66f75a5d028beaf67c931435fdc3e7823125730c (diff)
mmc: omap_hsmmc: Enable Auto CMD12
Enable Auto-CMD12 for multi block read/write on HSMMC. Tested on OMAP4430, OMAP3430 and OMAP2430 SDP Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/omap_hsmmc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 56d4499d4388..dfa6f87b6cc2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -85,6 +85,7 @@
85#define BRR_ENABLE (1 << 5) 85#define BRR_ENABLE (1 << 5)
86#define DTO_ENABLE (1 << 20) 86#define DTO_ENABLE (1 << 20)
87#define INIT_STREAM (1 << 1) 87#define INIT_STREAM (1 << 1)
88#define ACEN_ACMD12 (1 << 2)
88#define DP_SELECT (1 << 21) 89#define DP_SELECT (1 << 21)
89#define DDIR (1 << 4) 90#define DDIR (1 << 4)
90#define DMA_EN 0x1 91#define DMA_EN 0x1
@@ -115,6 +116,7 @@
115#define OMAP_MMC_MAX_CLOCK 52000000 116#define OMAP_MMC_MAX_CLOCK 52000000
116#define DRIVER_NAME "omap_hsmmc" 117#define DRIVER_NAME "omap_hsmmc"
117 118
119#define AUTO_CMD12 (1 << 0) /* Auto CMD12 support */
118/* 120/*
119 * One controller can have multiple slots, like on some omap boards using 121 * One controller can have multiple slots, like on some omap boards using
120 * omap.c controller driver. Luckily this is not currently done on any known 122 * omap.c controller driver. Luckily this is not currently done on any known
@@ -175,6 +177,7 @@ struct omap_hsmmc_host {
175 int reqs_blocked; 177 int reqs_blocked;
176 int use_reg; 178 int use_reg;
177 int req_in_progress; 179 int req_in_progress;
180 unsigned int flags;
178 struct omap_hsmmc_next next_data; 181 struct omap_hsmmc_next next_data;
179 182
180 struct omap_mmc_platform_data *pdata; 183 struct omap_mmc_platform_data *pdata;
@@ -766,6 +769,8 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
766 cmdtype = 0x3; 769 cmdtype = 0x3;
767 770
768 cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22); 771 cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22);
772 if ((host->flags & AUTO_CMD12) && mmc_op_multi(cmd->opcode))
773 cmdreg |= ACEN_ACMD12;
769 774
770 if (data) { 775 if (data) {
771 cmdreg |= DP_SELECT | MSBS | BCE; 776 cmdreg |= DP_SELECT | MSBS | BCE;
@@ -837,11 +842,14 @@ omap_hsmmc_xfer_done(struct omap_hsmmc_host *host, struct mmc_data *data)
837 else 842 else
838 data->bytes_xfered = 0; 843 data->bytes_xfered = 0;
839 844
840 if (!data->stop) { 845 if (data->stop && ((!(host->flags & AUTO_CMD12)) || data->error)) {
846 omap_hsmmc_start_command(host, data->stop, NULL);
847 } else {
848 if (data->stop)
849 data->stop->resp[0] = OMAP_HSMMC_READ(host->base,
850 RSP76);
841 omap_hsmmc_request_done(host, data->mrq); 851 omap_hsmmc_request_done(host, data->mrq);
842 return;
843 } 852 }
844 omap_hsmmc_start_command(host, data->stop, NULL);
845} 853}
846 854
847/* 855/*
@@ -1844,6 +1852,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
1844 host->mapbase = res->start + pdata->reg_offset; 1852 host->mapbase = res->start + pdata->reg_offset;
1845 host->base = ioremap(host->mapbase, SZ_4K); 1853 host->base = ioremap(host->mapbase, SZ_4K);
1846 host->power_mode = MMC_POWER_OFF; 1854 host->power_mode = MMC_POWER_OFF;
1855 host->flags = AUTO_CMD12;
1847 host->next_data.cookie = 1; 1856 host->next_data.cookie = 1;
1848 1857
1849 platform_set_drvdata(pdev, host); 1858 platform_set_drvdata(pdev, host);