Skip to content

Commit 68dbe38

Browse files
claudiubezneastorulf
authored andcommitted
mmc: renesas_sdhi: Set the SDBUF after reset
For development purpose, renesas_sdhi_probe() could be called w/ dma_ops = NULL to force the usage of PIO mode. In this case the renesas_sdhi_enable_dma() will not be called before transferring data. If renesas_sdhi_enable_dma() is not called, renesas_sdhi_clk_enable() call from renesas_sdhi_probe() will configure SDBUF by calling the renesas_sdhi_sdbuf_width() function, but then SDBUF will be reset in tmio_mmc_host_probe() when calling tmio_mmc_reset() though host->reset(). If SDBUF is zero the data transfer will not work in PIO mode for RZ/G3S. To fix this call again the renesas_sdhi_sdbuf_width(host, 16) in renesas_sdhi_reset(). The call of renesas_sdhi_sdbuf_width() was not removed from renesas_sdhi_clk_enable() as the host->reset() is optional. Co-developed-by: Hien Huynh <[email protected]> Signed-off-by: Hien Huynh <[email protected]> Signed-off-by: Claudiu Beznea <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent ef65b1f commit 68dbe38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/mmc/host/renesas_sdhi_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,9 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host, bool preserve)
589589
sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
590590
priv->needs_adjust_hs400 = false;
591591
renesas_sdhi_set_clock(host, host->clk_cache);
592+
593+
/* Ensure default value for this driver. */
594+
renesas_sdhi_sdbuf_width(host, 16);
592595
} else if (priv->scc_ctl) {
593596
renesas_sdhi_scc_reset(host, priv);
594597
}

0 commit comments

Comments
 (0)