diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2019-07-12 13:35:05 +0300 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2019-07-19 21:32:24 +0300 |
commit | 42a4f182555e095256926630f1ecde0190ded25f (patch) | |
tree | 3d7b19f3fc825cacaefa6d2cbd8917d69aa955fc /board/toradex | |
parent | 5fdef6c4c5cb33ad675b5203eea39230d6f84914 (diff) | |
download | u-boot-42a4f182555e095256926630f1ecde0190ded25f.tar.xz |
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>
Diffstat (limited to 'board/toradex')
-rw-r--r-- | board/toradex/common/tdx-cfg-block.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index f69c4433b2..67e0557f67 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -129,6 +129,10 @@ static int tdx_cfg_block_mmc_storage(u8 *config_block, int write) ret = -ENODEV; goto out; } + if (mmc_init(mmc)) { + puts("MMC init failed\n"); + return -EINVAL; + } if (part != mmc_get_blk_desc(mmc)->hwpart) { if (blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part)) { puts("MMC partition switch failed\n"); |