summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-01-21 14:53:18 -0700
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2019-02-01 16:59:11 +0100
commitf60662de77282360b995e2de4798ab8763d762c5 (patch)
treefa92041022d6e68eba57f76cdd7ec2c511d879a5
parente5b29d870b0a7711affe640aa506fda633f0ef59 (diff)
lib: Allow using display_buffer() in SPL
At present this function uses printf() format strings that are not supported in SPL, so the output just consists of %llx strings on 64-bit. machines. Fix this by adding a special case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
-rw-r--r--lib/display_options.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/display_options.c b/lib/display_options.c
index 32849821f4..af1802ef99 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -174,7 +174,9 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
x = lb.us[i] = *(volatile uint16_t *)data;
else
x = lb.uc[i] = *(volatile uint8_t *)data;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#if defined(CONFIG_SPL_BUILD)
+ printf(" %x", (uint)x);
+#elif defined(CONFIG_SYS_SUPPORT_64BIT_DATA)
printf(" %0*llx", width * 2, (long long)x);
#else
printf(" %0*x", width * 2, x);