diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-01-22 18:06:12 -0800 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2017-01-11 16:51:10 +0100 |
commit | cf18abd34fd2a9e1a126a13931b2e66f02bc44c9 (patch) | |
tree | b03428a748fffeb77aed67afa4b7362f20429f1e /board/toradex | |
parent | 1b4fa4210e299c75b6347459c397361be70327ab (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/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 0014ce80a18..cc120dba191 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -110,6 +110,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"); |