public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Eichenberger <eichest@gmail.com>
To: francesco.dolcini@toradex.com, trini@konsulko.com,
	stefan.eichenberger@toradex.com, emanuele.ghidoli@toradex.com,
	joao.goncalves@toradex.com, vitor.soares@toradex.com,
	igor.opaniuk@foundries.io, max.krummenacher@toradex.com
Cc: u-boot@lists.denx.de
Subject: [PATCH v1] toradex: tdx-cfg-block: fix switch to user partition
Date: Fri, 24 Jan 2025 16:14:30 +0100	[thread overview]
Message-ID: <20250124151443.576075-1-eichest@gmail.com> (raw)

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


             reply	other threads:[~2025-01-24 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24 15:14 Stefan Eichenberger [this message]
2025-01-24 15:25 ` [PATCH v1] toradex: tdx-cfg-block: fix switch to user partition Francesco Dolcini
2025-01-31 22:06 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250124151443.576075-1-eichest@gmail.com \
    --to=eichest@gmail.com \
    --cc=emanuele.ghidoli@toradex.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=igor.opaniuk@foundries.io \
    --cc=joao.goncalves@toradex.com \
    --cc=max.krummenacher@toradex.com \
    --cc=stefan.eichenberger@toradex.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vitor.soares@toradex.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox