mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-09 18:58:18 +01:00
Merge "mmc: Timeout calculation for erase operation"
This commit is contained in:
commit
b9477bb47a
3 changed files with 7 additions and 2 deletions
|
|
@ -1235,8 +1235,10 @@ static int mmc_startup(struct mmc *mmc)
|
|||
ext_csd[EXT_CSD_BOOT_MULT])
|
||||
mmc->part_config = ext_csd[EXT_CSD_PART_CONF];
|
||||
|
||||
if(ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT])
|
||||
if(ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]) {
|
||||
mmc->sec_feature_support = ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT];
|
||||
mmc->trim_timeout = 300 * ext_csd[EXT_CSD_TRIM_MULT]; /* In milliseconds */
|
||||
}
|
||||
if (part_completed &&
|
||||
(ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & ENHNCD_SUPPORT))
|
||||
mmc->part_attr = ext_csd[EXT_CSD_PARTITIONS_ATTRIBUTE];
|
||||
|
|
|
|||
|
|
@ -71,12 +71,13 @@ unsigned long mmc_berase(int dev_num, lbaint_t start, lbaint_t blkcnt)
|
|||
u32 start_rem, blkcnt_rem;
|
||||
struct mmc *mmc = find_mmc_device(dev_num);
|
||||
lbaint_t blk = 0, blk_r = 0;
|
||||
int timeout = 2000;
|
||||
int timeout;
|
||||
int arg = MMC_ERASE_ARG;
|
||||
|
||||
if (!mmc)
|
||||
return -1;
|
||||
|
||||
timeout = mmc->trim_timeout;
|
||||
if (!(mmc->sec_feature_support & EXT_CSD_SEC_ER_EN)) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@
|
|||
#define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */
|
||||
#define EXT_CSD_BOOT_MULT 226 /* RO */
|
||||
#define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */
|
||||
#define EXT_CSD_TRIM_MULT 232 /* RO */
|
||||
|
||||
#define EXT_CSD_SEC_ER_EN (1 << 0)
|
||||
#define EXT_CSD_SEC_GB_CL_EN (1 << 4)
|
||||
|
|
@ -391,6 +392,7 @@ struct mmc {
|
|||
char preinit; /* start init as early as possible */
|
||||
int ddr_mode;
|
||||
uchar sec_feature_support;
|
||||
unsigned int trim_timeout; /* In milliseconds */
|
||||
};
|
||||
|
||||
struct mmc_hwpart_conf {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue