Skip to contentSkip to conversation

toradex: tdx-cfg-block: fix switch to user partition

PATCH In review Stefan Eichenberger 3 participants 3 messages Jan 24, 2025 – Jan 31, 2025 x86 trust domain extensions (TDX)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toradex: tdx-cfg-block: fix switch to user partition

From: Stefan Eichenberger <[email protected]>

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")
---
 board/toradex/common/tdx-cfg-block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/toradex/common/tdx-cfg-block.c +1 -1
index 3855e15b83b..b2149438b88 100644
@@ -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;
 }
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

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.

Quoted 6 lines

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")

Francesco

#2 lore raw
In reply to Stefan Eichenberger
Quoted 10 lines · Stefan Eichenberger

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.

[...]

Applied to u-boot/master, thanks!

Signature · 1 line
Tom