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>2020-03-05 19:22:15 +0100
commit7696d0752719ede28df6c4b5c0e0108ea0a8aed0 (patch)
tree5e22a5e736e001451a01a9afc64811aededa0524 /board
parent192a8c0ce6d7e0575922e0626eb2824e93abde29 (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 ad5a6ad399d..76dfeae9485 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");