Hello community,
I have a problem regarding booting from MMC on my custom IMX6Dual board, using U-Boot version branch imx_v2017.03_4.9.51_imx8_beta2.
On most of my boards the boot process works. I can select my mmc dev 1 and get the following trace log:
boot_mmc_good_log - Pastebin.com
switch to partitions #0, OK
mmc1(part 0) is current device
But on some of the boards, selecting mmc dev 1 fails with the following trace logs:
boot_mmc_bad_log - Pastebin.com
mmc_init: -110, time 128
This is the code that fails in drivers/mmc/mmc.c in function static int mmc_startup(struct mmc *mmc):
/* Put the Card in Identify Mode */
cmd.cmdidx = mmc_host_is_spi(mmc) ? MMC_CMD_SEND_CID :
MMC_CMD_ALL_SEND_CID; /* cmd not supported in spi */
cmd.resp_type = MMC_RSP_R2;
cmd.cmdarg = 0;do {
err = mmc_send_cmd(mmc, &cmd, NULL);
} while (err && retries-- > 0);if (err)
return err;
This problem did not occur on my boards with the U-Boot v2014 version.
How can I resolve this issue?
Solved! Go to Solution.
So I found the issue that caused the init_error.
In drivers/mmc/mmc.c in function static int mmc_send_op_cond(struct mmc *mmc):
changing the OCR busy flag evaluation from
if (mmc->ocr & OCR_BUSY)break;
to
if (!(mmc->ocr & OCR_BUSY))break;
and the MMC is initialized properly. I honestly have no idea why this flag is assumed to be inverted.
Thanks anyway for the help!
So I found the issue that caused the init_error.
In drivers/mmc/mmc.c in function static int mmc_send_op_cond(struct mmc *mmc):
changing the OCR busy flag evaluation from
if (mmc->ocr & OCR_BUSY)break;
to
if (!(mmc->ocr & OCR_BUSY))break;
and the MMC is initialized properly. I honestly have no idea why this flag is assumed to be inverted.
Thanks anyway for the help!
Hi Igor,
thank you for the response.
Unfortunately I get the same error with the imx_v2017.03_4.9.88 branch.
How can I tweak the MMC driver?
Hi Igor,
thank you for the tip.
Sadly, increasing the driver strength of the MMC pins by changing:
#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP | \PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \PAD_CTL_SRE_FAST | PAD_CTL_HYS)
to
#define USDHC_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \PAD_CTL_PUS_22K_UP | PAD_CTL_SPEED_LOW | \PAD_CTL_DSE_120ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
did not help either. I still get the mmc_init error.
The strange thing is, with the version 2014 of u-boot, I don't get this error accessing MMC.
On some boards, the first selection of my mmc dev 1 works, but the second selection of mmc dev 1 fails with the init error.
Is there anything else I could try?
Hi Igor,
can you help me what other parts you mean? Most other solutions seem to be related to the linux kernel, but because the MMC device is not found, I can't boot into kernel.
I know the DDR settings and the hardware are not the issue, because everything worked with u-boot v2014 and kernel 3.14.
Porting to new u-boot now and the problem appeared.
The MMC is soldered directy to the board.
Hi David
different emmc parts may have different drive strengths, so you can try
with any other available emmc. i.MX drive strength may be adjusted in linux dts file,
for example:
pinctrl_usdhc2: usdhc2grp {
fsl,pins = <
MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059
during boot, please check sect.Table 8-14. USDHC boot eFUSE descriptions
i.MX6DQ Reference Manual
https://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf
BOOT_CFG2[0] Override pad settings 1 - Use PAD_SETTINGS values
Best regards
igor
Hi David
one can try with other emmc parts as in the case
eMMC 8GB to 4GB - crash on linux (yocto) boot
Best regards
igor
Hi David
in general one try to tweak driver strength of i.mx, emmc signals, however
imx_v2017.03_4.9.51_imx8_beta2 was not tested with i.MX6DQ, recommended to use imx_v2017.03_4.9.88
link below shows which software versions should be used for each i.mx family
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------