]> git.baikalelectronics.ru Git - uboot.git/commit
mmc: fsl_esdhc: Fix PIO timeout
authorBenoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Sun, 29 Oct 2017 21:08:58 +0000 (22:08 +0100)
committerStefano Babic <sbabic@denx.de>
Tue, 7 Nov 2017 09:26:27 +0000 (10:26 +0100)
commit0ce6e5c4fe73cd3bae54f4f5bdceadda0418bc2c
tree1270d542e8e13e1399be7a4e7cc42ebf2ef29c31
parent2b32c2a911fc93558a316183d1e99bad6f100ffe
mmc: fsl_esdhc: Fix PIO timeout

The following error has been observed on i.MX25 with a high-speed SDSC
card:
    Data Write Failed in PIO Mode.

It was caused by the timeout set on PRSSTAT.BWEN, which was triggered
because this bit takes 15 ms to be set after writing the first block to
DATPORT with this card. Without this timeout, all the blocks are
properly written.

This timeout was implemented by decrementing a variable, so it was
depending on the CPU frequency. Fix this issue by setting this timeout
to a long enough absolute duration (500 ms).

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
drivers/mmc/fsl_esdhc.c
include/fsl_esdhc.h