提交 a4c577f9 编写于 作者: P Pali Rohár 提交者: Stefan Roese

mmc: mmc_get_op_cond: Allow quiet detection of eMMC

Add a new 'quiet' argument to mmc_get_op_cond() function which avoids
printing error message when SD/eMMC card is not detected.

Espressobin and mx6cuboxi boards use this function for detecting presence
of eMMC and therefore it is expected and normal that eMMC does not have to
be connected. So error message "Card did not respond to voltage select!"
should be skipped in this case as it is not an error.
Signed-off-by: NPali Rohár <pali@kernel.org>
Reviewed-by: NStefan Roese <sr@denx.de>
Acked-by: NJaehoon Chung <jh80.chung@samsung.com>
上级 42ba5669
......@@ -124,7 +124,7 @@ int board_late_init(void)
/* eMMC is mmc dev num 1 */
mmc_dev = find_mmc_device(1);
emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
emmc = (mmc_dev && mmc_get_op_cond(mmc_dev, true) == 0);
/* if eMMC is not present then remove it from DM */
if (!emmc && mmc_dev) {
......
......@@ -374,7 +374,7 @@ static bool has_emmc(void)
mmc = find_mmc_device(2);
if (!mmc)
return 0;
return (mmc_get_op_cond(mmc) < 0) ? 0 : 1;
return (mmc_get_op_cond(mmc, true) < 0) ? 0 : 1;
}
int checkboard(void)
......
......@@ -2766,7 +2766,7 @@ static int mmc_power_cycle(struct mmc *mmc)
return mmc_power_on(mmc);
}
int mmc_get_op_cond(struct mmc *mmc)
int mmc_get_op_cond(struct mmc *mmc, bool quiet)
{
bool uhs_en = supports_uhs(mmc->cfg->host_caps);
int err;
......@@ -2842,7 +2842,8 @@ retry:
if (err) {
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
pr_err("Card did not respond to voltage select! : %d\n", err);
if (!quiet)
pr_err("Card did not respond to voltage select! : %d\n", err);
#endif
return -EOPNOTSUPP;
}
......@@ -2882,7 +2883,7 @@ int mmc_start_init(struct mmc *mmc)
return -ENOMEDIUM;
}
err = mmc_get_op_cond(mmc);
err = mmc_get_op_cond(mmc, false);
if (!err)
mmc->init_in_progress = 1;
......
......@@ -900,9 +900,10 @@ int mmc_set_bkops_enable(struct mmc *mmc);
* the presence of SD/eMMC when no card detect logic is available.
*
* @param mmc Pointer to a MMC device struct
* @param quiet Be quiet, do not print error messages when card is not detected.
* @return 0 on success, <0 on error.
*/
int mmc_get_op_cond(struct mmc *mmc);
int mmc_get_op_cond(struct mmc *mmc, bool quiet);
/**
* Start device initialization and return immediately; it does not block on
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册