From eeb739a6fde6e926b389b253668b2a8fd09a58c7 Mon Sep 17 00:00:00 2001 From: Loic Poulain Date: Thu, 26 Jan 2023 10:24:17 +0100 Subject: 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 Reviewed-by: Simon Glass Reviewed-by: Jaehoon Chung --- drivers/mmc/mmc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/mmc') diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index dde251c87bc..1af6af82e6b 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) { -- cgit v1.2.3