From: xiaoyao Date: Thu, 22 Sep 2016 09:21:24 +0000 (+0800) Subject: mmc: core: changes frequency to hs_max_dtr when selecting hs400es X-Git-Tag: firefly_0821_release~1489 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5b0edb353a0eab4abd466682b7099147a3d573f0;p=firefly-linux-kernel-4.4.55.git mmc: core: changes frequency to hs_max_dtr when selecting hs400es Per JESD84-B51 P69, Host need to change frequency to <=52MHz after setting HS_TIMING to 0x1, and host may changes frequency to <= 200MHz after setting HS_TIMING to 0x3. It seems there is no difference if we don't change frequency to <= 52MHz as f_init is already less than 52MHz. But actually it does make difference. When doing compatibility test we see failures for some eMMC devices without changing the frequency to hs_max_dtr. And let's read the spec again, we could see that "Host may changes frequency to 200MHz" implies that it's not mandatory. But the "Host need to change frequency to <= 52MHz" implies that we should do this. Change-Id: I1dc9f5fa8dc217e033fc4b1689ca1b0204c294c0 Signed-off-by: Shawn Lin Signed-off-by: xiaoyao --- diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index ed5d54dd7c4e..3c2c026f66cd 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1266,6 +1266,8 @@ static int mmc_select_hs400es(struct mmc_card *card) if (err) goto out_err; + mmc_set_clock(host, card->ext_csd.hs_max_dtr); + err = mmc_switch_status(card); if (err) goto out_err;