toradex: configblock: initialize MMC before switching partition
authorStefan Agner <stefan.agner@toradex.com>
Fri, 12 Jul 2019 10:35:05 +0000 (12:35 +0200)
committerStefano Babic <sbabic@denx.de>
Fri, 19 Jul 2019 18:32:24 +0000 (20:32 +0200)
commit42a4f182555e095256926630f1ecde0190ded25f
tree3d7b19f3fc825cacaefa6d2cbd8917d69aa955fc
parent5fdef6c4c5cb33ad675b5203eea39230d6f84914
toradex: configblock: initialize MMC before switching partition

If the module is in serial downloader mode, we do no longer read the
environment from eMMC. Therefor, the eMMC is unitialized when trying
to read the config block. Use mmc_init to initialize the selected
MMC device before using it.

Note: In case the MMC has already been initialized, the mmc_init
detects that and returns immediately.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
board/toradex/common/tdx-cfg-block.c