diff mbox

[U-Boot,3/4] mmc: Fix block length for DDR mode

Message ID 1417438752-18931-4-git-send-email-andrew_gabbasov@mentor.com
State Accepted
Delegated to: Pantelis Antoniou
Headers show

Commit Message

Gabbasov, Andrew Dec. 1, 2014, 12:59 p.m. UTC
Block length for write and read commands is fixed to 512 bytes
when the card is in Dual Data Rate mode. If block length read from CSD
is different, make sure the driver will use correct length
in all further calculations and settings.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
---
 drivers/mmc/mmc.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Pantelis Antoniou Dec. 12, 2014, 7:13 p.m. UTC | #1
Hi Andrew,

> On Dec 1, 2014, at 14:59 , Andrew Gabbasov <andrew_gabbasov@mentor.com> wrote:
> 
> Block length for write and read commands is fixed to 512 bytes
> when the card is in Dual Data Rate mode. If block length read from CSD
> is different, make sure the driver will use correct length
> in all further calculations and settings.
> 
> Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
> ---
> drivers/mmc/mmc.c | 6 ++++++
> 1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index d878c1e..9918597 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1170,6 +1170,12 @@ static int mmc_startup(struct mmc *mmc)
> 
> 	mmc_set_clock(mmc, mmc->tran_speed);
> 
> +	/* Fix the block length for DDR mode */
> +	if (mmc->ddr_mode) {
> +		mmc->read_bl_len = MMC_MAX_BLOCK_LEN;
> +		mmc->write_bl_len = MMC_MAX_BLOCK_LEN;
> +	}
> +
> 	/* fill in device description */
> 	mmc->block_dev.lun = 0;
> 	mmc->block_dev.type = 0;
> -- 
> 2.1.0

Applied, thanks.

— Pantelis
diff mbox

Patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index d878c1e..9918597 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1170,6 +1170,12 @@  static int mmc_startup(struct mmc *mmc)
 
 	mmc_set_clock(mmc, mmc->tran_speed);
 
+	/* Fix the block length for DDR mode */
+	if (mmc->ddr_mode) {
+		mmc->read_bl_len = MMC_MAX_BLOCK_LEN;
+		mmc->write_bl_len = MMC_MAX_BLOCK_LEN;
+	}
+
 	/* fill in device description */
 	mmc->block_dev.lun = 0;
 	mmc->block_dev.type = 0;