[U-Boot] mmc: Add support for downgrading HS200/HS400 to HS mode

Tom Rini trini at konsulko.com
Wed Jan 16 02:42:26 UTC 2019


On Thu, Jan 03, 2019 at 09:19:24PM +0100, Marek Vasut wrote:

> The mmc_select_mode_and_width() function can be called while the card
> is in HS200/HS400 mode and can be used to downgrade the card to lower
> mode, e.g. HS. This is used for example by mmc_boot_part_access_chk()
> which cannot access the card in HS200/HS400 mode and which is in turn
> called by saveenv if env is in the MMC.
> 
> In such case, forcing the card clock to legacy frequency cannot work.
> Instead, the card must be switched to HS mode first, from which it can
> then be reprogrammed as needed.
> 
> However, this procedure needs additional code changes, since the current
> implementation checks whether the card correctly switched to HS mode in
> mmc_set_card_speed(). The check only expects that the card will be going
> to HS mode from lower modes, not from higher modes, hence add a parameter
> which indicates that the HS200/HS400 to HS downgrade is happening. This
> makes the code send the switch command first, reconfigure the controller
> next and finally perform the EXT_CSD readback check. The last two steps
> cannot be done in reverse order as the card is already in HS mode when
> the clock are being switched on the controller side.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
> Cc: Jaehoon Chung <jh80.chung at samsung.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190115/aeafca26/attachment.sig>


More information about the U-Boot mailing list