summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2014-02-26 17:03:19 -0800
committerTom Rini <trini@ti.com>2014-03-04 12:15:30 -0500
commit4d1fd7f1ae6cf4e6e4e1cad975f1dcdea62b6d83 (patch)
treefac005cacc864827055709aad05b3924a1eae3e3 /lib
parentf9aa6a1086f6b7da1814a2c95feefa91c9c4b593 (diff)
downloadtalos-obmc-uboot-4d1fd7f1ae6cf4e6e4e1cad975f1dcdea62b6d83.tar.gz
talos-obmc-uboot-4d1fd7f1ae6cf4e6e4e1cad975f1dcdea62b6d83.zip
Add 64-bit data support for memory commands
Add 64-bit data for memory commands, such as md, mw, mm, cmp. The new size ".q " is introduced. For 64-bit architecture, 64-bit data is enabled by default, by detecting compiler __LP64__. It is optional for other architectures. Signed-off-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/display_options.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/display_options.c b/lib/display_options.c
index 4a972b08a4..4c0c886d61 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -87,11 +87,19 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
{
/* linebuf as a union causes proper alignment */
union linebuf {
+#ifdef CONFIG_SYS_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 CONFIG_SYS_SUPPORT_64BIT_DATA
+ uint64_t x;
+#else
+ uint32_t x;
+#endif
if (linelen*width > MAX_LINE_LENGTH_BYTES)
linelen = MAX_LINE_LENGTH_BYTES / width;
@@ -108,14 +116,21 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
/* Copy from memory into linebuf and print hex values */
for (i = 0; i < thislinelen; i++) {
- uint32_t x;
if (width == 4)
x = lb.ui[i] = *(volatile uint32_t *)data;
+#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+ else if (width == 8)
+ x = lb.uq[i] = *(volatile uint64_t *)data;
+#endif
else if (width == 2)
x = lb.us[i] = *(volatile uint16_t *)data;
else
x = lb.uc[i] = *(volatile uint8_t *)data;
+#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+ printf(" %0*llx", width * 2, x);
+#else
printf(" %0*x", width * 2, x);
+#endif
data += width;
}
OpenPOWER on IntegriCloud