mmc: tmio: sdhi: Do not use auto-retuning in HS400 mode
PATCH 1/1 mmc: tmio: sdhi: Do not use auto-retuning in HS400 mode
The SDHI supports automatic correction of sampling point in HS200/SDR104 modes. However, on R-Car Gen3, this feature is not supported in HS400 mode.
Auto and manual correction cannot both be used in HS400 mode. Therefore, in HS400 mode, disable auto correction and ignore the error status.
--- drivers/mmc/renesas-sdhi.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/mmc/renesas-sdhi.c +14 -5
@@ -265,7 +265,10 @@ static int renesas_sdhi_hs400(struct udevice *dev)tmio_sd_writel (priv, reg,RENESAS_SDHI_SCC_CKSEL ); reg =tmio_sd_readl (priv,RENESAS_SDHI_SCC_RVSCNTL ); - reg |=RENESAS_SDHI_SCC_RVSCNTL_RVSEN ; +if (hs400) + reg &= ~RENESAS_SDHI_SCC_RVSCNTL_RVSEN ; +else + reg |=RENESAS_SDHI_SCC_RVSCNTL_RVSEN ;tmio_sd_writel (priv, reg,RENESAS_SDHI_SCC_RVSCNTL );/* Execute adjust hs400 offset after setting to HS400 mode */
@@ -288,10 +291,13 @@ static unsigned int renesas_sdhi_compare_scc_data(struct tmio_sd_priv *priv)return tmio_sd_readl (priv,RENESAS_SDHI_SCC_SMPCMP ); } -static int renesas_sdhi_select_tuning (struct tmio_sd_priv *priv, +static int renesas_sdhi_select_tuning (struct udevice *dev,unsigned int tap_num,unsigned int taps,unsigned int smpcmp) { +struct tmio_sd_priv *priv =dev_get_priv (dev); +struct mmc_uclass_priv *upriv =dev_get_uclass_priv (dev); +struct mmc *mmc = upriv->mmc;unsigned long tap_cnt;/* counter of tuning success */ unsigned long tap_start;/* start position of tuning success */ unsigned long tap_end;/* end position of tuning success */
@@ -385,9 +391,12 @@ static int renesas_sdhi_select_tuning(struct tmio_sd_priv *priv,/* Set SCC */ tmio_sd_writel (priv, priv->tap_set,RENESAS_SDHI_SCC_TAPSET ); -/* Enable auto re-tuning */ +/* Enable auto re-tuning in HS200/SDR104 modes */ reg =tmio_sd_readl (priv,RENESAS_SDHI_SCC_RVSCNTL ); - reg |=RENESAS_SDHI_SCC_RVSCNTL_RVSEN ; +if (mmc->selected_mode ==MMC_HS_400 ) + reg &= ~RENESAS_SDHI_SCC_RVSCNTL_RVSEN ; +else + reg |=RENESAS_SDHI_SCC_RVSCNTL_RVSEN ;tmio_sd_writel (priv, reg,RENESAS_SDHI_SCC_RVSCNTL );return 0 ;
@@ -447,7 +456,7 @@ int renesas_sdhi_execute_tuning(struct udevice *dev, uint opcode)mdelay (1 ); } - ret =renesas_sdhi_select_tuning (priv, tap_num, taps, smpcmp); + ret =renesas_sdhi_select_tuning (dev, tap_num, taps, smpcmp); out:if (ret <0 ) {
Signature · 1 line
2.20.1
PATCH 1/1 mmc: tmio: sdhi: Do not use auto-retuning in HS400 mode
Quoted 11 lines · Marek Vasut
The SDHI supports automatic correction of sampling point in HS200/SDR104 modes. However, on R-Car Gen3, this feature is not supported in HS400 mode.
Auto and manual correction cannot both be used in HS400 mode. Therefore, in HS400 mode, disable auto correction and ignore the error status.
Signed-off-by Marek Vasut <[email protected]>Cc Nobuhiro Iwamatsu <[email protected]>Cc Peng Fan <[email protected]>
Please postpone this patch, I'll be sending V2 once there's more information on this topic.
Signature · 2 lines
Best regards, Marek Vasut