Commit edea52f4 authored by Tony Lindgren's avatar Tony Lindgren

ARM: OMAP: Update MMC for response types

Quick fix to make drivers compile and work again. Needs
to be verified.
parent eba8b594
...@@ -184,25 +184,16 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd) ...@@ -184,25 +184,16 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd)
host->hw_bus_mode = host->bus_mode; host->hw_bus_mode = host->bus_mode;
} }
/* Protocol layer does not provide response type, if (!(cmd->flags & MMC_RSP_PRESENT))
* but our hardware needs to know exact type, not just size! resptype = 0; /* Resp 0 */
*/
switch (cmd->flags & MMC_RSP_MASK) { if (cmd->flags & MMC_RSP_136)
case MMC_RSP_NONE: resptype = 2; /* Resp 2 */
/* resp 0 */ else {
break;
case MMC_RSP_SHORT:
/* resp 1, resp 1b */
/* OR resp 3!! (assume this if bus is set opendrain) */
if (host->bus_mode == MMC_BUSMODE_OPENDRAIN) if (host->bus_mode == MMC_BUSMODE_OPENDRAIN)
resptype = 3; resptype = 3; /* Resp 3 */
else else
resptype = 1; resptype = 1; /* Resp 1, Resp 1b */
break;
case MMC_RSP_LONG:
/* resp 2 */
resptype = 2;
break;
} }
/* Protocol layer does not provide command type, but our hardware /* Protocol layer does not provide command type, but our hardware
...@@ -343,19 +334,8 @@ mmc_omap_cmd_done(struct mmc_omap_host *host, struct mmc_command *cmd) ...@@ -343,19 +334,8 @@ mmc_omap_cmd_done(struct mmc_omap_host *host, struct mmc_command *cmd)
{ {
host->cmd = NULL; host->cmd = NULL;
switch (cmd->flags & MMC_RSP_MASK) { if (cmd->flags & MMC_RSP_136) {
case MMC_RSP_NONE: /* Response type 2 */
/* resp 0 */
break;
case MMC_RSP_SHORT:
/* response types 1, 1b, 3, 4, 5, 6 */
cmd->resp[0] =
OMAP_MMC_READ(host->base, RSP6) |
(OMAP_MMC_READ(host->base, RSP7) << 16);
DBG("MMC%d: Response %08x\n", host->id, cmd->resp[0]);
break;
case MMC_RSP_LONG:
/* response type 2 */
cmd->resp[3] = cmd->resp[3] =
OMAP_MMC_READ(host->base, RSP0) | OMAP_MMC_READ(host->base, RSP0) |
(OMAP_MMC_READ(host->base, RSP1) << 16); (OMAP_MMC_READ(host->base, RSP1) << 16);
...@@ -371,7 +351,12 @@ mmc_omap_cmd_done(struct mmc_omap_host *host, struct mmc_command *cmd) ...@@ -371,7 +351,12 @@ mmc_omap_cmd_done(struct mmc_omap_host *host, struct mmc_command *cmd)
DBG("MMC%d: Response %08x %08x %08x %08x\n", host->id, DBG("MMC%d: Response %08x %08x %08x %08x\n", host->id,
cmd->resp[0], cmd->resp[1], cmd->resp[0], cmd->resp[1],
cmd->resp[2], cmd->resp[3]); cmd->resp[2], cmd->resp[3]);
break; } else {
/* Response types 1, 1b, 3, 4, 5, 6 */
cmd->resp[0] =
OMAP_MMC_READ(host->base, RSP6) |
(OMAP_MMC_READ(host->base, RSP7) << 16);
DBG("MMC%d: Response %08x\n", host->id, cmd->resp[0]);
} }
if (host->data == NULL || cmd->error != MMC_ERR_NONE) { if (host->data == NULL || cmd->error != MMC_ERR_NONE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment