]> git.sur5r.net Git - u-boot/commitdiff
mmc: Fix mmc bus width
authorMario Schuknecht <mario.schuknecht@dresearch-fe.de>
Tue, 30 Sep 2014 15:04:42 +0000 (17:04 +0200)
committerPantelis Antoniou <panto@antoniou-consulting.com>
Fri, 3 Oct 2014 14:26:50 +0000 (17:26 +0300)
After setting the bus width, the extended CSD register is read. Some selected
fields are compared with previously read extended CSD register fields. In this
comparison the EXT_CSD_ERASE_GROUP_DEF field is compared. But this field is
previously written under certain circumstances. And then the comparison fails.

Only compare read-only fields. Therefore compare field EXT_CSD_HC_WP_GRP_SIZE
instead of field EXT_CSD_ERASE_GROUP_DEF.

Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
drivers/mmc/mmc.c

index e4a28d4b4ae4105f10d757cae443a27dccf41c6d..44a4feb96e0446c2c65df569afb2b3c0294817de 100644 (file)
@@ -1134,10 +1134,11 @@ static int mmc_startup(struct mmc *mmc)
                        mmc_set_bus_width(mmc, widths[idx]);
 
                        err = mmc_send_ext_csd(mmc, test_csd);
+                       /* Only compare read only fields */
                        if (!err && ext_csd[EXT_CSD_PARTITIONING_SUPPORT] \
                                    == test_csd[EXT_CSD_PARTITIONING_SUPPORT]
-                                && ext_csd[EXT_CSD_ERASE_GROUP_DEF] \
-                                   == test_csd[EXT_CSD_ERASE_GROUP_DEF] \
+                                && ext_csd[EXT_CSD_HC_WP_GRP_SIZE] \
+                                   == test_csd[EXT_CSD_HC_WP_GRP_SIZE] \
                                 && ext_csd[EXT_CSD_REV] \
                                    == test_csd[EXT_CSD_REV]
                                 && ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] \