summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBo Shen <voice.shen@atmel.com>2012-04-25 16:48:53 +0800
committerJosh Wu <josh.wu@atmel.com>2012-09-25 16:20:38 +0800
commit93aaa15e7d09489b1c52b0c2955f39c10a72d24d (patch)
tree7913f5370116ca917e57bc4b3893915a0279bf4f /drivers
parentcbc6a2ee24cee7aca98ee663f0220136638443e1 (diff)
MMC: enable MMC support in u-boot
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/gen_atmel_mci.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c
index 4968c5e491..1e104f6fe1 100644
--- a/drivers/mmc/gen_atmel_mci.c
+++ b/drivers/mmc/gen_atmel_mci.c
@@ -83,10 +83,17 @@ static void mci_set_mode(struct mmc *mmc, u32 hz, u32 blklen)
blklen &= 0xfffc;
/* On some platforms RDPROOF and WRPROOF are ignored */
+#ifdef CONFIG_AT91SAMA5
+ writel((MMCI_BF(CLKDIV, clkdiv)
+ | MMCI_BIT(RDPROOF)
+ | MMCI_BIT(WRPROOF)), &mci->mr);
+ writel((blklen << 16), &mci->blkr);
+#else
writel((MMCI_BF(CLKDIV, clkdiv)
| MMCI_BF(BLKLEN, blklen)
| MMCI_BIT(RDPROOF)
| MMCI_BIT(WRPROOF)), &mci->mr);
+#endif
initialized = 1;
}
@@ -183,6 +190,10 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
/* Figure out the transfer arguments */
cmdr = mci_encode_cmd(cmd, data, &error_flags);
+ if ((cmd->cmdidx == MMC_CMD_READ_MULTIPLE_BLOCK)
+ || (cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK))
+ writel(data->blocks | mmc->read_bl_len << 16, &mci->blkr);
+
/* Send the command */
writel(cmd->cmdarg, &mci->argr);
writel(cmdr, &mci->cmdr);