aboutsummaryrefslogtreecommitdiff
path: root/include/mmc.h
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 /include/mmc.h
parent7daa8dd59bc8455a43cdd2d0e34206e406e5cdcc (diff)
downloadu-boot-eeb739a6fde6e926b389b253668b2a8fd09a58c7.zip
u-boot-eeb739a6fde6e926b389b253668b2a8fd09a58c7.tar.gz
u-boot-eeb739a6fde6e926b389b253668b2a8fd09a58c7.tar.bz2
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 'include/mmc.h')
-rw-r--r--include/mmc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h
index 36dd841..b8fbff1 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -241,6 +241,7 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)
#define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */
#define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */
#define EXT_CSD_BOOT_MULT 226 /* RO */
+#define EXT_CSD_SEC_FEATURE 231 /* RO */
#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */
#define EXT_CSD_BKOPS_SUPPORT 502 /* RO */
@@ -315,6 +316,8 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)
#define EXT_CSD_WR_DATA_REL_USR (1 << 0) /* user data area WR_REL */
#define EXT_CSD_WR_DATA_REL_GP(x) (1 << ((x)+1)) /* GP part (x+1) WR_REL */
+#define EXT_CSD_SEC_FEATURE_TRIM_EN (1 << 4) /* Support secure & insecure trim */
+
#define R1_ILLEGAL_COMMAND (1 << 22)
#define R1_APP_CMD (1 << 5)
@@ -687,6 +690,7 @@ struct mmc {
uint tran_speed;
uint legacy_speed; /* speed for the legacy mode provided by the card */
uint read_bl_len;
+ bool can_trim;
#if CONFIG_IS_ENABLED(MMC_WRITE)
uint write_bl_len;
uint erase_grp_size; /* in 512-byte sectors */