summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-01-22 18:06:12 -0800
committerMax Krummenacher <max.krummenacher@toradex.com>2018-10-08 18:52:03 +0200
commit79d3008acaebc0d33ba8fc21ffe46f058416d4a3 (patch)
treefce137e98ad509fb1e8789c0d2d53cee62195bf0
parentae31e946da33510a352795de09aa1c0ea9fc8280 (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 (cherry picked from commit 0520b532d77d238be8015d3041a95188e47945cc) (cherry picked from commit 3cb5f6450c39678a6361620bd45c423a503895cd)
-rw-r--r--board/toradex/common/tdx-cfg-block.c4
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 9ddd1c1078..9e9fe2997e 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");