u-boot-brain/drivers
Patrice Chotard 23441fbf2b mmc: stm32_sdmmc2: Increase SDMMC_BUSYD0END_TIMEOUT_US
Increase SDMMC_BUSYD0END_TIMEOUT_US from 1s to 2s to
avoid timeout error during blocks erase on some sdcard

Issue seen on Kingston 16GB :
  Device: STM32 SDMMC2
  Manufacturer ID: 27
  OEM: 5048
  Name: SD16G
  Bus Speed: 50000000
  Mode: SD High Speed (50MHz)
  card capabilities: widths [4, 1] modes [SD Legacy, SD High Speed (50MHz)]
  host capabilities: widths [4, 1] modes [MMC legacy, SD Legacy, MMC High Speed (26MHz), SD High Speed (50MHz), MMC High Speed (52MHz)]
  Rd Block Len: 512
  SD version 3.0
  High Capacity: Yes
  Capacity: 14.5 GiB
  Bus Width: 4-bit
  Erase Group Size: 512 Bytes

Issue reproduced with following command:

STM32MP> mmc erase 0 100000

MMC erase: dev # 0, block # 0, count 1048576 ... mmc erase failed
16384 blocks erased: ERROR

By setting SDMMC_BUSYD0END_TIMEOUT_US at 2 seconds and by adding
time measurement in stm32_sdmmc2_end_cmd() as shown below:

	+start = get_timer(0);
	/* Polling status register */
	ret = readl_poll_timeout(priv->base + SDMMC_STA,
				 status, status & mask,
 				 SDMMC_BUSYD0END_TIMEOUT_US);

	+printf("time = %ld ms\n", get_timer(start));

We get the following trace:

STM32MP> mmc erase 0  100000

MMC erase: dev # 0, block # 0, count 1048576 ...
time = 17 ms
time = 1 ms
time = 1025 ms
time = 54 ms
time = 56 ms
time = 1021 ms
time = 57 ms
time = 56 ms
time = 1020 ms
time = 53 ms
time = 57 ms
time = 1021 ms
time = 53 ms
time = 57 ms
time = 1313 ms
time = 54 ms
time = 56 ms
time = 1026 ms
time = 54 ms
time = 56 ms
time = 1036 ms
time = 54 ms
time = 56 ms
time = 1028 ms
time = 53 ms
time = 56 ms
time = 1027 ms
time = 54 ms
time = 56 ms
time = 1024 ms
time = 54 ms
time = 56 ms
time = 1020 ms
time = 54 ms
time = 57 ms
time = 1023 ms
time = 54 ms
time = 56 ms
time = 1033 ms
time = 53 ms
time = 57 ms
....
time = 53 ms
time = 57 ms
time = 1021 ms
time = 56 ms
time = 56 ms
time = 1026 ms
time = 54 ms
time = 56 ms
1048576 blocks erased: OK

We see that 1 second timeout is not enough, we also see one measurement
up to 1313 ms. Set the timeout to 2 second to keep a security margin.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-08-27 09:36:56 +02:00
..
adc adc: stm32: Fix warnings when compiling with W=1 2019-07-12 11:50:55 +02:00
ata dm: scsi: Scan the actual number of ports 2019-08-26 11:46:20 -04:00
axi drivers: cosmetic: Convert SPDX license tags to Linux Kernel style 2018-10-28 09:26:39 -04:00
bios_emulator bios_emulator: remove stray break 2019-08-09 22:24:02 +08:00
block blk: Invalidate block cache when switching hwpart 2019-07-18 11:31:31 -04:00
board board: gazerbeam: Fix SC detection 2019-05-21 08:03:38 +02:00
bootcount env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
cache dm: cache: add the pl310 cache controller driver 2019-05-05 08:48:50 -04:00
clk Kconfig: Varios: Fix more SPL, TPL dependencies 2019-08-26 11:46:29 -04:00
core Kconfig: Varios: Fix more SPL, TPL dependencies 2019-08-26 11:46:29 -04:00
cpu cpu: Bind timer driver for boot hart 2019-02-27 09:12:33 +08:00
crypto Revert "drivers/crypto/fsl: assign job-rings to non-TrustZone" 2019-06-11 10:42:48 +02:00
ddr boards: lx2160a: Add support of I2C driver model 2019-08-22 09:07:35 +05:30
demo
dfu env: Move env_get() to env.h 2019-08-11 16:43:41 -04:00
dma CONFIG_SPL_SYS_[DI]CACHE_OFF: add 2019-05-18 08:15:35 -04:00
fastboot env: Move env_get() to env.h 2019-08-11 16:43:41 -04:00
firmware firmware: ti_sci: Parse all resource ranges even if some is not available 2019-08-12 13:33:43 -04:00
fpga fpga: altera: cyclon2: Check function pointer before calling 2019-07-30 10:21:15 +02:00
gpio kconfig: Convert CONFIG_MXS_GPIO to Kconfig 2019-08-23 13:59:06 -04:00
hwspinlock hwspinlock: add stm32 hardware spinlock support 2018-12-06 23:26:33 -05:00
i2c drivers: i2c: mxc: Fix compiler error when using i2c dm mode 2019-08-22 09:07:35 +05:30
input env: Move env_get() to env.h 2019-08-11 16:43:41 -04:00
led led: bcm6858: allow to use this driver on ARCH_963158 2019-04-23 17:57:22 -04:00
mailbox mailbox: introduce stm32-ipcc driver 2019-07-12 11:18:53 +02:00
memory
misc Kconfig: Varios: Fix more SPL, TPL dependencies 2019-08-26 11:46:29 -04:00
mmc mmc: stm32_sdmmc2: Increase SDMMC_BUSYD0END_TIMEOUT_US 2019-08-27 09:36:56 +02:00
mtd mtd: nand: raw: Move CONFIG_SYS_NAND_USE_FLASH_BBT to Kconfig 2019-08-25 20:58:37 -04:00
net drivers: net: mc: Report extra memory to Linux 2019-08-22 09:07:35 +05:30
nvme nvme: Fix PRP Offset Invalid 2019-08-26 11:46:28 -04:00
pch pch: Add ioctl support 2019-02-20 15:27:08 +08:00
pci Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell 2019-08-12 23:03:44 -04:00
pci_endpoint pci_ep: Fix Coverity warning 2019-08-07 15:31:04 -04:00
phy Kconfig: Varios: Fix more SPL, TPL dependencies 2019-08-26 11:46:29 -04:00
pinctrl pinctrl: renesas: Add R8A77980 V3H PFC tables 2019-08-09 23:15:01 +02:00
power sysreset: move stm32mp sysreset poweroff implementation to sysreset uclass 2019-08-19 12:43:26 +08:00
pwm pwm: imx: add DM_PWM support 2019-07-19 20:14:50 +02:00
qe env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
ram ram: rk3399: update cap and ddrconfig for each channel after init 2019-08-23 15:27:40 +08:00
remoteproc remoteproc: k3_rproc: Rename to ti_k3_arm64_rproc 2019-07-26 21:49:25 -04:00
reset env: Move env_get() to env.h 2019-08-11 16:43:41 -04:00
rtc rtc: ds3232/ds3231: Add support to generate 32KHz output for driver module 2019-08-22 09:07:36 +05:30
scsi env: Move env_set_ulong() to env.h 2019-08-11 16:43:41 -04:00
serial Kconfig: Varios: Fix more SPL, TPL dependencies 2019-08-26 11:46:29 -04:00
smem drivers: smem: sandbox 2018-07-19 16:31:38 -04:00
soc soc: keystone: Merge into ti specific directory 2019-04-11 20:07:12 -04:00
sound sound: tegra: Add a sound driver 2019-05-24 10:14:10 -07:00
spi x86: ich-spi: Convert driver to spi-mem ops 2019-08-09 22:24:02 +08:00
spmi
sysreset sysreset: move stm32mp sysreset poweroff implementation to sysreset uclass 2019-08-19 12:43:26 +08:00
tee env: Drop the ACTION typedef 2019-08-11 16:43:41 -04:00
thermal thermal: add i.MX8 thermal driver 2019-07-19 15:17:05 +02:00
timer dm: timer: Skip device that does not have a valid ofnode in pre_probe() 2019-07-24 12:54:08 -07:00
tpm tpm: wait for valid status 2019-07-11 14:11:18 -04:00
usb env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
video env: Move env_get() to env.h 2019-08-11 16:43:41 -04:00
virtio virtio: Add a Sandbox transport driver 2018-11-14 09:16:28 -08:00
w1 w1: Add driver for i.MX bus master controller 2019-01-01 14:12:18 +01:00
w1-eeprom w1-eeprom: Add support for Maxim DS2502 add only memory 2018-11-16 16:51:55 -05:00
watchdog watchdog: omap_wdt: Disable DM watchdog support in SPL 2019-08-12 13:27:55 -04:00
Kconfig Drop PCMCIA 2019-08-11 19:27:41 -04:00
Makefile Drop PCMCIA 2019-08-11 19:27:41 -04:00