|
108 | 108 |
|
109 | 109 | #define ESDHC_TUNING_CTRL 0xcc
|
110 | 110 | #define ESDHC_STD_TUNING_EN (1 << 24)
|
| 111 | +#define ESDHC_TUNING_WINDOW_MASK GENMASK(22, 20) |
111 | 112 | /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */
|
112 | 113 | #define ESDHC_TUNING_START_TAP_DEFAULT 0x1
|
113 | 114 | #define ESDHC_TUNING_START_TAP_MASK 0x7f
|
|
209 | 210 | /* The IP does not have GPIO CD wake capabilities */
|
210 | 211 | #define ESDHC_FLAG_SKIP_CD_WAKE BIT(18)
|
211 | 212 |
|
| 213 | +#define ESDHC_AUTO_TUNING_WINDOW 3 |
| 214 | + |
212 | 215 | enum wp_types {
|
213 | 216 | ESDHC_WP_NONE, /* no WP, neither controller nor gpio */
|
214 | 217 | ESDHC_WP_CONTROLLER, /* mmc controller internal WP */
|
@@ -1553,6 +1556,16 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
|
1553 | 1556 | << ESDHC_TUNING_STEP_SHIFT;
|
1554 | 1557 | }
|
1555 | 1558 |
|
| 1559 | + /* |
| 1560 | + * Config the tuning window to the hardware suggested value 3. |
| 1561 | + * This tuning window is used for auto tuning logic. The default |
| 1562 | + * tuning window is 2, here change to 3 make the window a bit |
| 1563 | + * wider, give auto tuning enough space to handle the sample |
| 1564 | + * point shift cause by temperature change. |
| 1565 | + */ |
| 1566 | + tmp &= ~ESDHC_TUNING_WINDOW_MASK; |
| 1567 | + tmp |= FIELD_PREP(ESDHC_TUNING_WINDOW_MASK, ESDHC_AUTO_TUNING_WINDOW); |
| 1568 | + |
1556 | 1569 | /* Disable the CMD CRC check for tuning, if not, need to
|
1557 | 1570 | * add some delay after every tuning command, because
|
1558 | 1571 | * hardware standard tuning logic will directly go to next
|
|
0 commit comments