You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/07/28 12:01:41 UTC
[nuttx] branch master updated: drivers/mmcsd_sdio: config timout to write one data block
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 37fc0a0208 drivers/mmcsd_sdio: config timout to write one data block
37fc0a0208 is described below
commit 37fc0a0208a93067f0b712d43d5839c32212dbc8
Author: dongjiuzhu1 <do...@xiaomi.com>
AuthorDate: Fri May 19 12:03:34 2023 +0800
drivers/mmcsd_sdio: config timout to write one data block
Some hardware needs to config this delay to write one data block, because
the hardware needs more time to wear leveling and bad block manage.
Signed-off-by: dongjiuzhu1 <do...@xiaomi.com>
---
drivers/mmcsd/Kconfig | 7 +++++++
drivers/mmcsd/mmcsd_sdio.c | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
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)