diff options
| author | Stefano Babic <sbabic@denx.de> | 2012-11-10 08:05:54 +0100 | 
|---|---|---|
| committer | Stefano Babic <sbabic@denx.de> | 2012-11-10 08:05:54 +0100 | 
| commit | 3e4d27b06d7484040355e22eec2cbce7335d6dab (patch) | |
| tree | 9672a2bb2e4ce0edc0ab776ddf0e2ca8e39a5f62 /drivers/mmc/gen_atmel_mci.c | |
| parent | bad05afe083eec0467220de21683443292c5012e (diff) | |
| parent | 59852d03867108217fe88e3bfc3e1e9cedfe63c5 (diff) | |
| download | olio-uboot-2014.01-3e4d27b06d7484040355e22eec2cbce7335d6dab.tar.xz olio-uboot-2014.01-3e4d27b06d7484040355e22eec2cbce7335d6dab.zip | |
Merge git://git.denx.de/u-boot
Diffstat (limited to 'drivers/mmc/gen_atmel_mci.c')
| -rw-r--r-- | drivers/mmc/gen_atmel_mci.c | 15 | 
1 files changed, 13 insertions, 2 deletions
| diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c index 4968c5e49..67b2dbe8d 100644 --- a/drivers/mmc/gen_atmel_mci.c +++ b/drivers/mmc/gen_atmel_mci.c @@ -87,6 +87,11 @@ static void mci_set_mode(struct mmc *mmc, u32 hz, u32 blklen)  		 | MMCI_BF(BLKLEN, blklen)  		 | MMCI_BIT(RDPROOF)  		 | MMCI_BIT(WRPROOF)), &mci->mr); +	/* +	 * On some new platforms BLKLEN in mci->mr is ignored. +	 * Should use the BLKLEN in the block register. +	 */ +	writel(MMCI_BF(BLKLEN, blklen), &mci->blkr);  	initialized = 1;  } @@ -183,6 +188,12 @@ 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); +	/* For multi blocks read/write, set the block register */ +	if ((cmd->cmdidx == MMC_CMD_READ_MULTIPLE_BLOCK) +			|| (cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK)) +		writel(data->blocks | MMCI_BF(BLKLEN, mmc->read_bl_len), +			&mci->blkr); +  	/* Send the command */  	writel(cmd->cmdarg, &mci->argr);  	writel(cmdr, &mci->cmdr); @@ -310,8 +321,8 @@ static int mci_init(struct mmc *mmc)  	writel(MMCI_BIT(MCIEN), &mci->cr);	/* enable mci */  	writel(MMCI_BF(SCDSEL, MCI_BUS), &mci->sdcr);	/* select port */ -	/* Initial Time-outs */ -	writel(0x5f, &mci->dtor); +	/* This delay can be optimized, but stick with max value */ +	writel(0x7f, &mci->dtor);  	/* Disable Interrupts */  	writel(~0UL, &mci->idr); |