diff --git a/drivers/mmcsd/Kconfig b/drivers/mmcsd/Kconfig index 4f8e2ff9c5..790f67caf3 100644 --- a/drivers/mmcsd/Kconfig +++ b/drivers/mmcsd/Kconfig @@ -163,6 +163,13 @@ config SDIO_BLOCKSETUP number of blocks. Others just work on the byte stream. This option enables the block setup method in the SDIO vtable. +config MMCSD_BLOCK_WDATADELAY + int "The wait timeout to write one data block" + default 260 + ---help--- + Some hardware needs to configure this delay to write one data block, because + the hardware needs more time for wear leveling and bad block management. + endif endif # MMCSD diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index b21a8fdea4..1baee5e782 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -83,7 +83,10 @@ #define MMCSD_SCR_DATADELAY (100) /* Wait up to 100MS to get SCR */ #define MMCSD_BLOCK_RDATADELAY (100) /* Wait up to 100MS to get one data block */ -#define MMCSD_BLOCK_WDATADELAY (260) /* Wait up to 260MS to write one data block */ + +/* Wait timeout to write one data block */ + +#define MMCSD_BLOCK_WDATADELAY CONFIG_MMCSD_BLOCK_WDATADELAY #define IS_EMPTY(priv) (priv->type == MMCSD_CARDTYPE_UNKNOWN)