From bb4c87a93399326257f8ae6aa8829cd6d31b0e7d Mon Sep 17 00:00:00 2001 From: "Schoyswohl, Roland" Date: Thu, 23 Mar 2023 13:42:46 +0000 Subject: 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 --- 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 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); -- cgit v1.2.1