]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: m5253demo: remove floating point flash size calculation
authorAngelo Dureghello <angelo@kernel-space.org>
Tue, 14 Mar 2023 23:43:07 +0000 (00:43 +0100)
committerAngelo Dureghello <angelo@kernel-space.org>
Wed, 15 Mar 2023 00:52:15 +0000 (01:52 +0100)
This board is using floating point arithmetic to display
the SST39VF6401B flash size.

This actually generates errors with toolchains without
appropriate sw fp math functions available.

SST39VF6401B is the only flash for wich the size is displayed,
it's size is 8192KB and floating point calculation seems not
needed. Removing it.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
board/freescale/m5253demo/flash.c

index fbd4835416085b791fa0abaa911c73c0f87b8b95..eeb9cfd31259e632b08c31924194f398c17cc712 100644 (file)
@@ -96,24 +96,8 @@ void flash_print_info(flash_info_t * info)
                return;
        }
 
-       if (info->size > 0x100000) {
-               int remainder;
-
-               printf("  Size: %ld", info->size >> 20);
-
-               remainder = (info->size % 0x100000);
-               if (remainder) {
-                       remainder >>= 10;
-                       remainder = (int)((float)
-                                         (((float)remainder / (float)1024) *
-                                          10000));
-                       printf(".%d ", remainder);
-               }
-
-               printf("MB in %d Sectors\n", info->sector_count);
-       } else
-               printf("  Size: %ld KB in %d Sectors\n",
-                      info->size >> 10, info->sector_count);
+       printf("  Size: %ld KB in %d Sectors\n",
+              info->size >> 10, info->sector_count);
 
        printf("  Sector Start Addresses:");
        for (i = 0; i < info->sector_count; ++i) {