public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v1] toradex: tdx-cfg-block: fix switch to user partition
@ 2025-01-24 15:14 Stefan Eichenberger
  2025-01-24 15:25 ` Francesco Dolcini
  2025-01-31 22:06 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Eichenberger @ 2025-01-24 15:14 UTC (permalink / raw)
  To: francesco.dolcini, trini, stefan.eichenberger, emanuele.ghidoli,
	joao.goncalves, vitor.soares, igor.opaniuk, max.krummenacher
  Cc: u-boot

From: Stefan Eichenberger <stefan.eichenberger@toradex.com>

The Toradex configuration block is stored in the first boot partition of
the eMMC. After reading the configuration block, U-Boot switches back to
the user partition. Currently, this operation always targets mmc device
0, even when the configuration block is stored on mmc device 2.

This patch addresses the issue by switching the mmc device set in
CONFIG_TDX_CFG_BLOCK_DEV to the user partition, rather than using the
hardcoded device 0.

Fixes: a2777ecb9d11 ("toradex: config block handling")
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
 board/toradex/common/tdx-cfg-block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index 3855e15b83b..b2149438b88 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -312,7 +312,7 @@ static int tdx_cfg_block_mmc_storage(u8 *config_block, int write)
 
 out:
 	/* Switch back to regular eMMC user partition */
-	blk_select_hwpart_devnum(UCLASS_MMC, 0, 0);
+	blk_select_hwpart_devnum(UCLASS_MMC, dev, 0);
 
 	return ret;
 }
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-31 22:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-24 15:14 [PATCH v1] toradex: tdx-cfg-block: fix switch to user partition Stefan Eichenberger
2025-01-24 15:25 ` Francesco Dolcini
2025-01-31 22:06 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox