Revert "mmc: fsl_esdhc_imx: add wait_dat0() support"
Subsystems (2)
PATCH 1/1 Revert "mmc: fsl_esdhc_imx: add wait_dat0() support"
This reverts commit b5874b552ffa09bc1dc5dec6b5dd376c62dab45d.
It seems the iMX8MM SDHC controller always reports DAT0 line status as zero after voltage switch at the end of mmc_switch_voltage(), even if it is supposed to be high and scope confirms the DAT0 is high. Reverting this patch makes SDR104 work on iMX8MM, however, it is not clear why the DAT0 status is not correctly reported by the controller.
--- drivers/mmc/fsl_esdhc_imx.c | 15 --------------- 1 file changed, 15 deletions(-)
drivers/mmc/fsl_esdhc_imx.c +0 -15
@@ -1552,20 +1552,6 @@ static int __maybe_unused fsl_esdhc_set_enhanced_strobe(struct udevice *dev)return 0 ; } -static int fsl_esdhc_wait_dat0 (struct udevice *dev,int state, -int timeout_us) -{ -int ret; -u32 tmp; -struct fsl_esdhc_priv *priv =dev_get_priv (dev); -struct fsl_esdhc *regs = priv->esdhc_regs; - - ret =readx_poll_timeout (esdhc_read32, ®s->prsstat, tmp, - !!(tmp &PRSSTAT_DAT0 ) == !!state, - timeout_us); -return ret; -} -static const struct dm_mmc_ops fsl_esdhc_ops = { .get_cd = fsl_esdhc_get_cd, .send_cmd = fsl_esdhc_send_cmd,
@@ -1576,7 +1562,6 @@ static const struct dm_mmc_ops fsl_esdhc_ops = {#if CONFIG_IS_ENABLED (MMC_HS400_ES_SUPPORT ) .set_enhanced_strobe = fsl_esdhc_set_enhanced_strobe,#endif - .wait_dat0 = fsl_esdhc_wait_dat0, };static struct esdhc_soc_data usdhc_imx7d_data = {
Signature · 1 line
2.34.1
Hi Marek,
Quoted 8 lines · Marek Vasut
This reverts commit
b5874b552ffa09bc1dc5dec6b5dd376c62dab45d.It seems the iMX8MM SDHC controller always reports DAT0 line status as zero after voltage switch at the end of
mmc_switch_voltage(), even if it is supposed to be high and scope confirms the DAT0 is high. Reverting this patch makes SDR104 work on iMX8MM, however, it is not clear why the DAT0 status is not correctly reported by the controller.
I didn't have an imx8mm board, so I wonder that other boards which is using fsl_esdhci_imx driver have same problem. I'm not sure...I remember that some controller doesn't support a busy signal.
In kernel driver, also doesn't report correct status?
Best Regards,
Jaehoon Chung
Quoted 44 lines
Signed-off-by Marek Vasut <[email protected]>Cc Haibo Chen <[email protected]>Cc Igor Opaniuk <[email protected]>Cc Jaehoon Chung <[email protected]>Cc Peng Fan <[email protected]>Cc Stefano Babic <[email protected]>--- drivers/mmc/fsl_esdhc_imx.c | 15 --------------- 1 file changed, 15 deletions(-)drivers/mmc/fsl_esdhc_imx.c +0
-15@@ -1552,20 +1552,6 @@ static int __maybe_unused fsl_esdhc_set_enhanced_strobe(struct udevice *dev)return 0 ; } -static int fsl_esdhc_wait_dat0 (struct udevice *dev,int state, -int timeout_us) -{ -int ret; -u32 tmp; -struct fsl_esdhc_priv *priv =dev_get_priv (dev); -struct fsl_esdhc *regs = priv->esdhc_regs; - - ret =readx_poll_timeout (esdhc_read32, ®s->prsstat, tmp, - !!(tmp &PRSSTAT_DAT0 ) == !!state, - timeout_us); -return ret; -} -static const struct dm_mmc_ops fsl_esdhc_ops = { .get_cd = fsl_esdhc_get_cd, .send_cmd = fsl_esdhc_send_cmd,@@ -1576,7 +1562,6 @@ static const struct dm_mmc_ops fsl_esdhc_ops = {#if CONFIG_IS_ENABLED (MMC_HS400_ES_SUPPORT ) .set_enhanced_strobe = fsl_esdhc_set_enhanced_strobe,#endif - .wait_dat0 = fsl_esdhc_wait_dat0, };static struct esdhc_soc_data usdhc_imx7d_data = {
Quoted 1 line · Jaehoon Chung
Hi Marek,
Hi,
Quoted 11 lines · Marek Vasut
Quoted 8 lines
This reverts commit
b5874b552ffa09bc1dc5dec6b5dd376c62dab45d.It seems the iMX8MM SDHC controller always reports DAT0 line status as zero after voltage switch at the end of
mmc_switch_voltage(), even if it is supposed to be high and scope confirms the DAT0 is high. Reverting this patch makes SDR104 work on iMX8MM, however, it is not clear why the DAT0 status is not correctly reported by the controller.I didn't have an imx8mm board, so I wonder that other boards which is using
fsl_esdhci_imxdriver have same problem.
I have multiple 8mm, just not the 8mm-evk.
Quoted 2 lines
I'm not sure...I remember that some controller doesn't support a busy signal. In kernel driver, also doesn't report correct status?
Kernel doesn't use this DAT0 readback, that's why it works in kernel.
U-Boot has been augmented with this DAT0 readback some time ago, I just noticed it on an 8mm board recently that it doesn't really work. There is also no errata.
I think it would be good to have NXP check this.
Fabio Estevam
reviewerHi Haibo and Peng,
Quoted 1 line · Marek Vasut
I think it would be good to have NXP check this.
Could you please help to review this?
Thanks
Bough Chen
Tested-by Tim HarveyQuoted 32 lines
-----Original Message-----
From: Marek Vasut [mailto:[email protected]]
Sent: 2022年1月29日 1:37
To: Jaehoon Chung <[email protected]>; [email protected]
Cc: [email protected]; Bough Chen <[email protected]>; Igor Opaniuk <[email protected]>; Peng Fan <[email protected]>
Subject: Re: [PATCH] Revert "mmc:fsl_esdhc_imx: addwait_dat0()support"Quoted 1 line · Jaehoon Chung
Hi Marek,
Hi,
Quoted 11 lines · Marek Vasut
Quoted 8 lines
This reverts commit
b5874b552ffa09bc1dc5dec6b5dd376c62dab45d.It seems the iMX8MM SDHC controller always reports DAT0 line status as zero after voltage switch at the end of
mmc_switch_voltage(), even if it is supposed to be high and scope confirms the DAT0 is high. Reverting this patch makes SDR104 work on iMX8MM, however, it is not clear why the DAT0 status is not correctly reported by the controller.I didn't have an imx8mm board, so I wonder that other boards which is using
fsl_esdhci_imxdriver have same problem.I have multiple 8mm, just not the 8mm-evk.
Quoted 2 lines
I'm not sure...I remember that some controller doesn't support a busy signal. In kernel driver, also doesn't report correct status?
Quoted 7 lines
Kernel doesn't use this DAT0 readback, that's why it works in kernel.
U-Boot has been augmented with this DAT0 readback some time ago, I just noticed it on an 8mm board recently that it doesn't really work. There is also no errata.
I think it would be good to have NXP check this.
Hi,
The issue you meet should be related to one patch that was revert recently, refer to Commit f132aab40327 " Revert "mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output""
The issue you meet seems the same as what I mentioned in my original commit log, I paste in the end. Revert this patch because we did find this patch has some side effect, like enlarge the whole boot up time about 20s. If you will, you can add back this patch on your side, and test it.
I will send one new patch this week, to fix issue and avoid side effect.
Best Regards
Haibo Chen
commit 63756575b42b8b4fb3f59cbbf0cedf03331bc2d2
Author: Haibo Chen <[email protected]> Date: Wed Mar 3 17:05:46 2021 +0800
mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output
For FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN, these are reserved bits. Instead, use VENDORSPEC_FRC_SDCLK_ON to gate on/off the card clock output.
After commit b5874b552ffa ("mmc: fsl_esdhc_imx: add wait_dat0() support"), we meet SD3.0 card can't work at UHS mode, mmc_switch_voltage() fail because the second mmc_wait_dat0 return -ETIMEDOUT. According to SD spec, during voltage switch, need to gate off/on the card clock. If not set the FRC_SDCLK_ON, after CMD11, hardware will gate off the card clock automatically, so card do not detect the clock off/on behavior, so will draw the data0 line low until next command.
Quoted 72 lines · Bough Chen
Quoted 32 lines
-----Original Message-----
From: Marek Vasut [mailto:[email protected]]
Sent: 2022年1月29日 1:37
To: Jaehoon Chung <[email protected]>; [email protected]
Cc: [email protected]; Bough Chen <[email protected]>; Igor Opaniuk <[email protected]>; Peng Fan <[email protected]>
Subject: Re: [PATCH] Revert "mmc:fsl_esdhc_imx: addwait_dat0()support"Quoted 1 line · Jaehoon Chung
Hi Marek,
Hi,
Quoted 11 lines · Marek Vasut
Quoted 8 lines
This reverts commit
b5874b552ffa09bc1dc5dec6b5dd376c62dab45d.It seems the iMX8MM SDHC controller always reports DAT0 line status as zero after voltage switch at the end of
mmc_switch_voltage(), even if it is supposed to be high and scope confirms the DAT0 is high. Reverting this patch makes SDR104 work on iMX8MM, however, it is not clear why the DAT0 status is not correctly reported by the controller.I didn't have an imx8mm board, so I wonder that other boards which is using
fsl_esdhci_imxdriver have same problem.I have multiple 8mm, just not the 8mm-evk.
Quoted 2 lines
I'm not sure...I remember that some controller doesn't support a busy signal. In kernel driver, also doesn't report correct status?
Quoted 7 lines
Kernel doesn't use this DAT0 readback, that's why it works in kernel.
U-Boot has been augmented with this DAT0 readback some time ago, I just noticed it on an 8mm board recently that it doesn't really work. There is also no errata.
I think it would be good to have NXP check this.
Hi,
The issue you meet should be related to one patch that was revert recently, refer to Commit
f132aab40327" Revert "mmc:fsl_esdhc_imx: useVENDORSPEC_FRC_SDCLK_ONto control card clock output""The issue you meet seems the same as what I mentioned in my original commit log, I paste in the end. Revert this patch because we did find this patch has some side effect, like enlarge the whole boot up time about 20s. If you will, you can add back this patch on your side, and test it.
I will send one new patch this week, to fix issue and avoid side effect.Best Regards
Haibo Chencommit
63756575b42b8b4fb3f59cbbf0cedf03331bc2d2Author: Haibo Chen <[email protected]> Date: Wed Mar 3 17:05:46 2021 +0800mmc:
fsl_esdhc_imx: useVENDORSPEC_FRC_SDCLK_ONto control card clock outputFor
FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN, these are reserved bits. Instead, useVENDORSPEC_FRC_SDCLK_ONto gate on/off the card clock output.After commit
b5874b552ffa("mmc:fsl_esdhc_imx: addwait_dat0()support"), we meet SD3.0 card can't work at UHS mode,mmc_switch_voltage()fail because the secondmmc_wait_dat0return-ETIMEDOUT. According to SD spec, during voltage switch, need to gate off/on the card clock. If not set theFRC_SDCLK_ON, after CMD11, hardware will gate off the card clock automatically, so card do not detect the clock off/on behavior, so will draw the data0 line low until next command.
Quoted 4 lines
Fixes b5874b552ffa ("mmc: fsl_esdhc_imx: add wait_dat0() support")Tested-by Tim Harvey <[email protected]>Signed-off-by Haibo Chen <[email protected]>
I see you already managed to post follow up patches, I already tested those and they indeed help. I'll provide RB shortly, thanks.