Skip to content

Commit 1c73875

Browse files
Luke Wangstorulf
authored andcommitted
mmc: sdhci-esdhc-imx: switch standard tuning to manual tuning
Current standard tuning has some limitations: 1. Standard tuning only try 40 times to find first pass window, but this pass window maybe not the best pass window. 2. Sometimes there are two tuning pass windows and the gap between those two windows may only have one cell. If tuning step > 1, the gap may just be skipped and host assumes those two windows as a continuous windows. This will cause a bad delay cell near the gap to be selected. 3. Standard tuning logic need to detect at least one success and failure to pass the tuning. If all cells in the tuning window pass, the hardware will not set the SDHCI_CTRL_TUNED_CLK bit, causing tuning failed. 4. Standard tuning logic only check the CRC, do not really compare the data pattern. If data pins are connected incorrectly, standard will not detect this kind of issue. Switch to manual tuning to avoid those limitations Signed-off-by: Luke Wang <[email protected]> Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 309d7ef commit 1c73875

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,35 +275,35 @@ static const struct esdhc_soc_data usdhc_imx6q_data = {
275275
};
276276

277277
static const struct esdhc_soc_data usdhc_imx6sl_data = {
278-
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
278+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
279279
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_ERR004536
280280
| ESDHC_FLAG_HS200
281281
| ESDHC_FLAG_BROKEN_AUTO_CMD23,
282282
};
283283

284284
static const struct esdhc_soc_data usdhc_imx6sll_data = {
285-
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
285+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
286286
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
287287
| ESDHC_FLAG_HS400
288288
| ESDHC_FLAG_STATE_LOST_IN_LPMODE,
289289
};
290290

291291
static const struct esdhc_soc_data usdhc_imx6sx_data = {
292-
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
292+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
293293
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
294294
| ESDHC_FLAG_STATE_LOST_IN_LPMODE
295295
| ESDHC_FLAG_BROKEN_AUTO_CMD23,
296296
};
297297

298298
static const struct esdhc_soc_data usdhc_imx6ull_data = {
299-
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
299+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
300300
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
301301
| ESDHC_FLAG_ERR010450
302302
| ESDHC_FLAG_STATE_LOST_IN_LPMODE,
303303
};
304304

305305
static const struct esdhc_soc_data usdhc_imx7d_data = {
306-
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
306+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
307307
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
308308
| ESDHC_FLAG_HS400
309309
| ESDHC_FLAG_STATE_LOST_IN_LPMODE
@@ -319,7 +319,7 @@ static struct esdhc_soc_data usdhc_s32g2_data = {
319319
};
320320

321321
static struct esdhc_soc_data usdhc_imx7ulp_data = {
322-
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
322+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
323323
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
324324
| ESDHC_FLAG_PMQOS | ESDHC_FLAG_HS400
325325
| ESDHC_FLAG_STATE_LOST_IN_LPMODE,
@@ -332,7 +332,7 @@ static struct esdhc_soc_data usdhc_imxrt1050_data = {
332332
};
333333

334334
static struct esdhc_soc_data usdhc_imx8qxp_data = {
335-
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
335+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
336336
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
337337
| ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
338338
| ESDHC_FLAG_STATE_LOST_IN_LPMODE
@@ -341,7 +341,7 @@ static struct esdhc_soc_data usdhc_imx8qxp_data = {
341341
};
342342

343343
static struct esdhc_soc_data usdhc_imx8mm_data = {
344-
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
344+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
345345
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
346346
| ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
347347
| ESDHC_FLAG_STATE_LOST_IN_LPMODE,

0 commit comments

Comments
 (0)