summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvri Altman <avri.altman@wdc.com>2024-10-06 08:11:48 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2024-10-14 12:40:10 +0200
commit899404e1503461adde3890828f7ed18a3032ec59 (patch)
treed524b85c8cbe8c69ac5124264276e6f1ed4ed72f
parenta7861651943dac0006f55e0b6db28ed8e9dbe411 (diff)
mmc: core: Enable SDUC
Enable SDUC if the card responded to ACMD41 with HCS & HO2T bits set. Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Avri Altman <avri.altman@wdc.com> Link: https://lore.kernel.org/r/20241006051148.160278-11-avri.altman@wdc.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/core/sd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 33e806adcbf7..918b86bf8bbb 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -836,8 +836,11 @@ try_again:
* block-addressed SDHC cards.
*/
err = mmc_send_if_cond(host, ocr);
- if (!err)
+ if (!err) {
ocr |= SD_OCR_CCS;
+ /* Set HO2T as well - SDUC card won't respond otherwise */
+ ocr |= SD_OCR_2T;
+ }
/*
* If the host supports one of UHS-I modes, request the card
@@ -1448,7 +1451,10 @@ retry:
}
if (!oldcard) {
- err = mmc_sd_get_csd(card, false);
+ u32 sduc_arg = SD_OCR_CCS | SD_OCR_2T;
+ bool is_sduc = (rocr & sduc_arg) == sduc_arg;
+
+ err = mmc_sd_get_csd(card, is_sduc);
if (err)
goto free_card;