diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-01-22 18:06:12 -0800 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2018-05-01 15:26:45 +0200 |
commit | 0520b532d77d238be8015d3041a95188e47945cc (patch) | |
tree | bb121b85c0ea80d8abebbff5ed1b50878a21c792 /board | |
parent | 18426b50681e6cd64ab5977f0ba84efd3f7c4495 (diff) |
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>
Conflicts:
board/toradex/common/configblock.c
Diffstat (limited to 'board')
-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 9ddd1c10780..9e9fe2997ed 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -117,6 +117,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->block_dev.hwpart) { if (blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part)) { puts("MMC partition switch failed\n"); |