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.tret...@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


Reply via email to