aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLoic Poulain <loic.poulain@linaro.org>2023-01-26 10:24:17 +0100
committerJaehoon Chung <jh80.chung@samsung.com>2023-04-10 12:17:11 +0900
commiteeb739a6fde6e926b389b253668b2a8fd09a58c7 (patch)
tree5d6eda2c68cc0cb44c71c28abaf6831b6b7d7508 /drivers
parent7daa8dd59bc8455a43cdd2d0e34206e406e5cdcc (diff)
mmc: Check support for TRIM operations
When secure/insecure TRIM operations are supported. When used as erase command argument it applies the erase operation to write blocks instead of erase groups. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mmc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index dde251c87b..1af6af82e6 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2432,6 +2432,9 @@ static int mmc_startup_v4(struct mmc *mmc)
mmc->wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET];
+ mmc->can_trim =
+ !!(ext_csd[EXT_CSD_SEC_FEATURE] & EXT_CSD_SEC_FEATURE_TRIM_EN);
+
return 0;
error:
if (mmc->ext_csd) {