]> Git Repo - J-u-boot.git/blobdiff - lib/display_options.c
aes: Allow to store randomly generated IV in the FIT
[J-u-boot.git] / lib / display_options.c
index c08a87e31629157d50aa3d21110c8e8e734b39e0..2c15cc5b5c4aa69568d7cede90a3deb003aa5dac 100644 (file)
@@ -4,13 +4,16 @@
  * Wolfgang Denk, DENX Software Engineering, [email protected].
  */
 
-#include <common.h>
 #include <compiler.h>
 #include <console.h>
+#include <display_options.h>
 #include <div64.h>
-#include <version.h>
+#include <version_string.h>
 #include <linux/ctype.h>
+#include <linux/kernel.h>
 #include <asm/io.h>
+#include <stdio.h>
+#include <vsprintf.h>
 
 char *display_options_get_banner_priv(bool newlines, const char *build_tag,
                                      char *buf, int size)
@@ -107,7 +110,12 @@ void print_size(uint64_t size, const char *s)
        }
 
        if (!c) {
-               printf("%llu Bytes%s", size, s);
+               /*
+                * SPL tiny-printf is not capable for printing uint64_t.
+                * We have just checked that the size is small enought to fit
+                * unsigned int safely.
+                */
+               printf("%u Bytes%s", (unsigned int)size, s);
                return;
        }
 
@@ -121,6 +129,12 @@ void print_size(uint64_t size, const char *s)
                if (m >= 10) {
                        m -= 10;
                        n += 1;
+
+                       if (n == 1024 && i > 0) {
+                               n = 1;
+                               m = 0;
+                               c = names[i - 1];
+                       }
                }
        }
 
@@ -222,7 +236,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
                addr += thislinelen * width;
                count -= thislinelen;
 
-               if (!IS_ENABLED(CONFIG_SPL_BUILD) && ctrlc())
+               if (!IS_ENABLED(CONFIG_XPL_BUILD) && ctrlc())
                        return -EINTR;
        }
 
This page took 0.023331 seconds and 4 git commands to generate.