summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSchoyswohl, Roland <Roland.Schoyswohl@ife-doors.com>2023-03-23 13:42:46 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2023-04-05 11:54:37 +0200
commitbb4c87a93399326257f8ae6aa8829cd6d31b0e7d (patch)
tree69b9755ab5f55feae5fc94f6a795a71d1476568c /commands
parent0e47f028dae4b132a55ff09def532dc620c07fa3 (diff)
downloadbarebox-bb4c87a93399326257f8ae6aa8829cd6d31b0e7d.tar.gz
barebox-bb4c87a93399326257f8ae6aa8829cd6d31b0e7d.tar.xz
mmc: fix calculation of Max Enhanced Area
According extcsd documentation, the HC_ERASE_GRP_SIZE must be multiplied by HC_ERASE_GRP_SIZE and not added. Signed-off-by: Roland Schoyswohl roland.schoyswohl@ife-doors.com Link: https://lore.barebox.org/AM6PR04MB472829B69D627CA15218927EA2879@AM6PR04MB4728.eurprd04.prod.outlook.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/mmc_extcsd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c
index 7ae068348d..f67c48404a 100644
--- a/commands/mmc_extcsd.c
+++ b/commands/mmc_extcsd.c
@@ -1427,7 +1427,7 @@ static int print_field(u8 *reg, int index)
case EXT_CSD_MAX_ENH_SIZE_MULT:
tmp = get_field_val(EXT_CSD_HC_WP_GRP_SIZE, 0, 0xFF);
- tmp = tmp + get_field_val(EXT_CSD_HC_ERASE_GRP_SIZE, 0, 0xFF);
+ tmp = tmp * get_field_val(EXT_CSD_HC_ERASE_GRP_SIZE, 0, 0xFF);
tmp64 *= tmp;
tmp64 *= SZ_512K;
printf("\tMax Enhanced Area: %llu B\n", tmp64);