* [PATCH] commands: mmc_extcsd: fix calculation of RPMB size
@ 2025-07-29 13:59 Michael Tretter
2025-07-29 14:53 ` Marco Felsch
2025-08-05 7:41 ` Sascha Hauer
0 siblings, 2 replies; 3+ messages in thread
From: Michael Tretter @ 2025-07-29 13:59 UTC (permalink / raw)
To: barebox; +Cc: Michael Tretter
EXT_CSD_RPMB_SIZE_MULT contains the number of 128 KB blocks in the RPMB.
While the calculated RMPB is labeled as KB, it actually contains the
size in bytes.
Fix the calculation to report the RPMB size in KB.
An alternative would have been to change the label to bytes, but since
the RPMB size is at least in an order of magnitude of KB, changing the
label is not intuitive.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
commands/mmc_extcsd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c
index 7fa6235a4da9..e7b0fd82ee29 100644
--- a/commands/mmc_extcsd.c
+++ b/commands/mmc_extcsd.c
@@ -1544,7 +1544,7 @@ static int print_field(u8 *reg, int index)
case EXT_CSD_RPMB_SIZE_MULT:
val = get_field_val(EXT_CSD_RPMB_SIZE_MULT, 0, 0xFF);
- val = val * 131072;
+ val = val * 128;
printf("\t[7-0] RPMB Partition Size: %u KB\n", val);
return 1;
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] commands: mmc_extcsd: fix calculation of RPMB size
2025-07-29 13:59 [PATCH] commands: mmc_extcsd: fix calculation of RPMB size Michael Tretter
@ 2025-07-29 14:53 ` Marco Felsch
2025-08-05 7:41 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Marco Felsch @ 2025-07-29 14:53 UTC (permalink / raw)
To: Michael Tretter; +Cc: barebox
On 25-07-29, Michael Tretter wrote:
> EXT_CSD_RPMB_SIZE_MULT contains the number of 128 KB blocks in the RPMB.
> While the calculated RMPB is labeled as KB, it actually contains the
> size in bytes.
>
> Fix the calculation to report the RPMB size in KB.
>
> An alternative would have been to change the label to bytes, but since
> the RPMB size is at least in an order of magnitude of KB, changing the
> label is not intuitive.
>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] commands: mmc_extcsd: fix calculation of RPMB size
2025-07-29 13:59 [PATCH] commands: mmc_extcsd: fix calculation of RPMB size Michael Tretter
2025-07-29 14:53 ` Marco Felsch
@ 2025-08-05 7:41 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-08-05 7:41 UTC (permalink / raw)
To: barebox, Michael Tretter
On Tue, 29 Jul 2025 15:59:24 +0200, Michael Tretter wrote:
> EXT_CSD_RPMB_SIZE_MULT contains the number of 128 KB blocks in the RPMB.
> While the calculated RMPB is labeled as KB, it actually contains the
> size in bytes.
>
> Fix the calculation to report the RPMB size in KB.
>
> An alternative would have been to change the label to bytes, but since
> the RPMB size is at least in an order of magnitude of KB, changing the
> label is not intuitive.
>
> [...]
Applied, thanks!
[1/1] commands: mmc_extcsd: fix calculation of RPMB size
https://git.pengutronix.de/cgit/barebox/commit/?id=88b5cfb580fe (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-05 7:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-29 13:59 [PATCH] commands: mmc_extcsd: fix calculation of RPMB size Michael Tretter
2025-07-29 14:53 ` Marco Felsch
2025-08-05 7:41 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox