path: root/drivers/mci/imx-esdhc.h
diff options
authorAndrey Smirnov <>2019-09-30 17:35:27 -0700
committerSascha Hauer <>2019-10-02 08:38:50 +0200
commitff6c7c9929eba589f68c83674bccf4d53a7b805d (patch)
tree0f3ad42436fc9e26afa566bd4e5ab2fecad0b09a /drivers/mci/imx-esdhc.h
parente9332035f41ee9f7a8b96842a3da00b1f546f9a7 (diff)
mci: imx-esdhc-pbl: Fix watermark level value for i.MX
Layerscape and i.MX have different semantics of Watermark Level Register. Whereas the former uses "0" to signify maximum allowed value, the latter does not. According to the RM (i.MX8MQ, i.MX6): "...The read burst length must be less than or equal to the read watermark level.." Setting Watermark Level Register to zero violates that limitation. It appears that, on i.MX8MQ, not following that rule causes certain configs + toolchains to result in non-bootable image. Specifically, polling for CICHB, CIDHB and DLA to clear in esdhc_send_cmd() times out. There doesn't appear to be any clear relationship as to what kind of image will have the problem, but the following combinations failed to boot on ZII i.MX8MQ Zest board: - gcc version 9.2.1 20190827 (Red Hat Cross 9.2.1-1) (GCC) + imx_v8_defconfig + CONFIG_DEBUG_LL and CONFIG_PBL_CONSOLE - gcc version 5.5.0 (Timesys 20190405) (custom toolchain) + imx_v8_defconfig Setting WML's *_BRST_LE to 16 and *_WML to 128 on i.MX resolves the issue (same setting that's selected by writing 0 on Layerscape). Fixes: 48562aeaa8 ("esdhc-xload: check for PRSSTAT_BREN only after each block") Cc: Chris Healy <> Cc: Ruslan Sushko <> Signed-off-by: Andrey Smirnov <> Tested-by: Ahmad Fatoum <> Signed-off-by: Sascha Hauer <>
Diffstat (limited to 'drivers/mci/imx-esdhc.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mci/imx-esdhc.h b/drivers/mci/imx-esdhc.h
index 9b79346..2d54719 100644
--- a/drivers/mci/imx-esdhc.h
+++ b/drivers/mci/imx-esdhc.h
@@ -24,6 +24,7 @@
#include <errno.h>
#include <asm/byteorder.h>
+#include <linux/bitfield.h>
#define SYSCTL_INITA 0x08000000
#define SYSCTL_TIMEOUT_MASK 0x000f0000
@@ -43,7 +44,9 @@
#define WML_WRITE 0x00010000
#define WML_RD_WML_MASK 0xff
+#define WML_WR_BRST_LEN GENMASK(28, 24)
#define WML_WR_WML_MASK 0xff0000
+#define WML_RD_BRST_LEN GENMASK(12, 8)
#define BLKATTR_CNT(x) ((x & 0xffff) << 16)
#define BLKATTR_SIZE(x) (x & 0x1fff)