summaryrefslogtreecommitdiff
path: root/lib/display_options.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-08 20:20:24 -0400
committerTom Rini <trini@konsulko.com>2020-07-08 20:20:24 -0400
commit61608f395e7dcb2be6060407a72a1149b046430a (patch)
tree387269e837a47126d5a7ccdef2b4d5af60598e16 /lib/display_options.c
parent186529953fd10a97e6343418095edd1c535aaeb2 (diff)
parentc89b41b4db4a746647c4f0e6d33c6f4edfe96e38 (diff)
Merge branch '2020-07-08-misc-features-and-fixes'
- mem cmd improvements - TPM fixes - SPL/NAND/FIT fixes - RSA improvements
Diffstat (limited to 'lib/display_options.c')
-rw-r--r--lib/display_options.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/display_options.c b/lib/display_options.c
index 1dd5b6affd..ea9977cc18 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -138,19 +138,13 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
{
/* linebuf as a union causes proper alignment */
union linebuf {
-#ifdef MEM_SUPPORT_64BIT_DATA
uint64_t uq[MAX_LINE_LENGTH_BYTES/sizeof(uint64_t) + 1];
-#endif
uint32_t ui[MAX_LINE_LENGTH_BYTES/sizeof(uint32_t) + 1];
uint16_t us[MAX_LINE_LENGTH_BYTES/sizeof(uint16_t) + 1];
uint8_t uc[MAX_LINE_LENGTH_BYTES/sizeof(uint8_t) + 1];
} lb;
int i;
-#ifdef MEM_SUPPORT_64BIT_DATA
- uint64_t __maybe_unused x;
-#else
- uint32_t __maybe_unused x;
-#endif
+ ulong x;
if (linelen*width > MAX_LINE_LENGTH_BYTES)
linelen = MAX_LINE_LENGTH_BYTES / width;
@@ -169,20 +163,16 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
for (i = 0; i < thislinelen; i++) {
if (width == 4)
x = lb.ui[i] = *(volatile uint32_t *)data;
-#ifdef MEM_SUPPORT_64BIT_DATA
- else if (width == 8)
- x = lb.uq[i] = *(volatile uint64_t *)data;
-#endif
+ else if (MEM_SUPPORT_64BIT_DATA && width == 8)
+ x = lb.uq[i] = *(volatile ulong *)data;
else if (width == 2)
x = lb.us[i] = *(volatile uint16_t *)data;
else
x = lb.uc[i] = *(volatile uint8_t *)data;
#if defined(CONFIG_SPL_BUILD)
printf(" %x", (uint)x);
-#elif defined(MEM_SUPPORT_64BIT_DATA)
- printf(" %0*llx", width * 2, (long long)x);
#else
- printf(" %0*x", width * 2, x);
+ printf(" %0*lx", width * 2, x);
#endif
data += width;
}