summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-01-22 18:06:12 -0800
committerMax Krummenacher <max.krummenacher@toradex.com>2019-01-30 18:05:15 +0100
commite28e4cf5b0599932d24002ea3f4534a95c636eba (patch)
treecbb5e306a924819d15eb9872915373b8b3e28396 /board
parentaad79470d13b263802c4601baa843a113786629e (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) (cherry picked from commit 79d3008acaebc0d33ba8fc21ffe46f058416d4a3) Conflicts: board/toradex/common/tdx-cfg-block.c (cherry picked from commit cdcc3a8660fa4254d6d3ca6932a7cd599c0f1662)
Diffstat (limited to 'board')
-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 ad5a6ad399..76dfeae948 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -118,6 +118,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");