mmc: sdhci-pxav3: disable clock inversion for SD HS cards
PATCH 1/1 mmc: sdhci-pxav3: disable clock inversion for SD HS cards
The SDIO3 Configuration register branch of pxav3_set_uhs_signaling() only clears the clock-inversion and feedback-clock bits for MMC_TIMING_MMC_HS. As a result, MMC_TIMING_SD_HS (ordinary SD High Speed) falls through to the default case, which sets SDIO3_CONF_CLK_INV and leaves the feedback clock cleared.
According to erratum FE-2946959, clock inversion is only needed for slow frequencies when the card hold-time requirement is high and is not required nor desirable for high-speed modes. SD High Speed runs at 50 MHz, so the same timing argument that applies to MMC High Speed holds. Treat MMC_TIMING_SD_HS the same as MMC_TIMING_MMC_HS and clear the clock-inversion and feedback-clock bits for both.
--- drivers/mmc/host/sdhci-pxav3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-pxav3.c +2 -1
@@ -284,7 +284,8 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs) uhs == MMC_TIMING_UHS_DDR50) { reg_val &= ~SDIO3_CONF_CLK_INV ; reg_val |=SDIO3_CONF_SD_FB_CLK ; - } else if (uhs == MMC_TIMING_MMC_HS) { + } else if (uhs == MMC_TIMING_MMC_HS || + uhs == MMC_TIMING_SD_HS) { reg_val &= ~SDIO3_CONF_CLK_INV ; reg_val &= ~SDIO3_CONF_SD_FB_CLK ; } else {
Signature · 1 line
2.55.0
Quoted 13 lines · Rosen Penev
The SDIO3 Configuration register branch of
pxav3_set_uhs_signaling()only clears the clock-inversion and feedback-clock bits forMMC_TIMING_MMC_HS. As a result,MMC_TIMING_SD_HS(ordinary SD High Speed) falls through to the default case, which setsSDIO3_CONF_CLK_INVand leaves the feedback clock cleared.According to erratum FE-2946959, clock inversion is only needed for slow frequencies when the card hold-time requirement is high and is not required nor desirable for high-speed modes. SD High Speed runs at 50 MHz, so the same timing argument that applies to MMC High Speed holds. Treat
MMC_TIMING_SD_HSthe same asMMC_TIMING_MMC_HSand clear the clock-inversion and feedback-clock bits for both.
Quoted 2 lines
Assisted-by opencode:big-pickleSigned-off-by Rosen Penev <[email protected]>
Quoted 18 lines
--- drivers/mmc/host/sdhci-pxav3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/sdhci-pxav3.c +2
-1@@ -284,7 +284,8 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs) uhs == MMC_TIMING_UHS_DDR50) { reg_val &= ~SDIO3_CONF_CLK_INV ; reg_val |=SDIO3_CONF_SD_FB_CLK ; - } else if (uhs == MMC_TIMING_MMC_HS) { + } else if (uhs == MMC_TIMING_MMC_HS || + uhs == MMC_TIMING_SD_HS) { reg_val &= ~SDIO3_CONF_CLK_INV ; reg_val &= ~SDIO3_CONF_SD_FB_CLK ; } else {
Quoted 14 lines · Rosen Penev
The SDIO3 Configuration register branch of
pxav3_set_uhs_signaling()only clears the clock-inversion and feedback-clock bits forMMC_TIMING_MMC_HS. As a result,MMC_TIMING_SD_HS(ordinary SD High Speed) falls through to the default case, which setsSDIO3_CONF_CLK_INVand leaves the feedback clock cleared.According to erratum FE-2946959, clock inversion is only needed for slow frequencies when the card hold-time requirement is high and is not required nor desirable for high-speed modes. SD High Speed runs at 50 MHz, so the same timing argument that applies to MMC High Speed holds. Treat
MMC_TIMING_SD_HSthe same asMMC_TIMING_MMC_HSand clear the clock-inversion and feedback-clock bits for both.
Quoted 2 lines
Assisted-by opencode:big-pickleSigned-off-by Rosen Penev <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 21 lines
--- drivers/mmc/host/sdhci-pxav3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/sdhci-pxav3.c +2
-2@@ -284,7 +284,8 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs) uhs == MMC_TIMING_UHS_DDR50) { reg_val &= ~SDIO3_CONF_CLK_INV ; reg_val |=SDIO3_CONF_SD_FB_CLK ; - } else if (uhs == MMC_TIMING_MMC_HS) { + } else if (uhs == MMC_TIMING_MMC_HS || + uhs == MMC_TIMING_SD_HS) { reg_val &= ~SDIO3_CONF_CLK_INV ; reg_val &= ~SDIO3_CONF_SD_FB_CLK ; } else { --2.55.0