MLK-21176 mmc: correct the HS400 initialization process
authorHaibo Chen <haibo.chen@nxp.com>
Mon, 18 Mar 2019 08:01:45 +0000 (16:01 +0800)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 10:38:54 +0000 (03:38 -0700)
commit5d275bd3be0892b1be37728e2e7066dd7a728638
treeba2ce84d83112c778b684f392510634b9392886c
parent17611959e5949dc8c956a5dee19b791b5aca6e36
MLK-21176 mmc: correct the HS400 initialization process

After the commit b9a2a0e2e9c0 ("mmc: Add support for downgrading
HS200/HS400 to HS mode"), it add a parameter in mmc_set_card_speed()
which indicates that the HS200/HS400 to HS downgrade is happening.

During the HS400 initialization, first select to HS200, and config
the related clock rate, then downgrade to HS mode. So here also need
to config the downgrade value to be true, make sure in the function
mmc_set_card_speed(), after switch to HS mode, first config the
clock rate, then read the EXT_CSD. Otherwise read EXT_CSD in HS mode
at wrong clock rate, e.g. 200MHz, may lead to uncertain result.

Test on i.MX8QM MEK board, some Micron eMMC will stuck in transfer
mode in this case, and USDHC will never get data transfer complete
status, cause the uboot hang.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 0ba8e1c6efa2e9c34c9b54105d6c50ee293ec1d7)
drivers/mmc/mmc.c