]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mmc: Fix block length for DDR mode
authorAndrew Gabbasov <andrew_gabbasov@mentor.com>
Mon, 1 Dec 2014 12:59:11 +0000 (06:59 -0600)
committerPantelis Antoniou <pantelis.antoniou@konsulko.com>
Fri, 12 Dec 2014 19:08:38 +0000 (21:08 +0200)
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

index 65d8b3a87ac1c11e6fe52290dc89b3fa85f949c1..1eb9c2733948bf954aa00414824aa491adc4a4e3 100644 (file)
@@ -1188,6 +1188,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;