From e9628402820b88543443529fae87106f74689aa7 Mon Sep 17 00:00:00 2001 From: Barnali Sarkar Date: Wed, 27 Dec 2017 13:51:18 +0530 Subject: [PATCH] storage: Fix CMD13 failure issue This patch stores the correct capabilities for EMMC media which in turn sets the correct timing data for HS400 mode. Without this code change, EMMC CMD13 is failing at the end of HS400 mode switching. BUG=none BRANCH=none TEST=Build and boot Soraka Change-Id: I3f00c9eace7cc136d86a1e07f040fbfc09e0e02e Signed-off-by: Barnali Sarkar Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/23541 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/commonlib/storage/mmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commonlib/storage/mmc.c b/src/commonlib/storage/mmc.c index ad7861704f..ca067054e0 100644 --- a/src/commonlib/storage/mmc.c +++ b/src/commonlib/storage/mmc.c @@ -338,6 +338,10 @@ int mmc_change_freq(struct storage_media *media) if (err) return err; + /* Determine if the device supports enhanced strobe */ + media->caps |= ext_csd[EXT_CSD_STROBE_SUPPORT] + ? DRVR_CAP_ENHANCED_STROBE : 0; + if ((ctrlr->caps & DRVR_CAP_HS400) && (ext_csd[EXT_CSD_CARD_TYPE] & MMC_HS400)) err = mmc_select_hs400(media); @@ -419,10 +423,6 @@ int mmc_update_capacity(struct storage_media *media) if (ext_csd[EXT_CSD_REV] < 2) return 0; - /* Determine if the device supports enhanced strobe */ - media->caps |= ext_csd[EXT_CSD_STROBE_SUPPORT] - ? DRVR_CAP_ENHANCED_STROBE : 0; - /* Determine the eMMC device information */ media->partition_config = ext_csd[EXT_CSD_PART_CONF] & EXT_CSD_PART_ACCESS_MASK;