Hi Shimoda-san, > We should set the needs_adjust_hs400 when HS400EN=1 is set. > In other words, we should set it in renesas_sdhi_hs400_complete(), > not renesas_sdhi_prepare_hs400_tuning(). Oh, thanks for pointing this out! I simply put it into the same function as the BSP, but due to massive refactoring in the upstream driver we really need to put it where tuning is completed. I used the following patch on top of this patch: diff --git b/drivers/mmc/host/renesas_sdhi_core.c a/drivers/mmc/host/renesas_sdhi_core.c index 2834b30c3ba6..b54dd8a7ecaa 100644 --- b/drivers/mmc/host/renesas_sdhi_core.c +++ a/drivers/mmc/host/renesas_sdhi_core.c @@ -419,6 +419,9 @@ static void renesas_sdhi_hs400_complete(struct mmc_host *mmc) sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, CLK_CTL_SCLKEN | sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); + + if (priv->adjust_hs400_calib_table) + priv->needs_adjust_hs400 = true; } static void renesas_sdhi_reset_scc(struct tmio_mmc_host *host, @@ -544,12 +547,8 @@ static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host, static int renesas_sdhi_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios) { struct tmio_mmc_host *host = mmc_priv(mmc); - struct renesas_sdhi *priv = host_to_priv(host); - if (priv->adjust_hs400_calib_table) - priv->needs_adjust_hs400 = true; - - renesas_sdhi_reset_hs400_mode(host, priv); + renesas_sdhi_reset_hs400_mode(host, host_to_priv(host)); return 0; } and got these debug reports from my M3-N: kworker/0:1-21 [000] .... 4.171435: renesas_sdhi_fixup_request: code 17 replacement 18 which was different without the fix: kworker/0:1-21 [000] .... 4.171435: renesas_sdhi_fixup_request: code 31 replacement 31 > When we read the calib_code at room temperature, the value will be around 0x10. > However, we will get 0x00 here. So, we need to fix it. So, my new debug output looks good. I will fold the fixup patch into the next version of this series. I still need to get the stalled-SCC issue tackled first. But I am now working on it. Thanks again, Wolfram
Attachment:
signature.asc
Description: PGP signature