提交 f6549c85 编写于 作者: H Heinrich Schuchardt 提交者: Tom Rini

mmc: avoid division by zero in meson_mmc_config_clock

The Odroid C2 fails to read from mmc with U-Boot v2018.03.
The change avoids a division by zero.

The fix was suggested by Jaehoon in
https://lists.denx.de/pipermail/u-boot/2018-January/318577.htmlReported-by: NVagrant Cascadian <vagrant@debian.org>
Suggested-by: NJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: NVagrant Cascadian <vagrant@debian.org>
上级 275d80a4
......@@ -35,6 +35,9 @@ static void meson_mmc_config_clock(struct mmc *mmc)
uint32_t meson_mmc_clk = 0;
unsigned int clk, clk_src, clk_div;
if (!mmc->clock)
return;
/* 1GHz / CLK_MAX_DIV = 15,9 MHz */
if (mmc->clock > 16000000) {
clk = SD_EMMC_CLKSRC_DIV2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册