summaryrefslogtreecommitdiffstats
path: root/scripts/imx
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-05-24 07:31:18 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-05-24 12:22:41 +0200
commitca929ac265bd7560b82e7b0c5ce4521ac658b768 (patch)
tree432d385989a0891e6f0fbbf07bd46f895650f635 /scripts/imx
parent56d1e82d77c5e7269e91dc2b1dbc63c0a15bb6db (diff)
downloadbarebox-ca929ac265bd7560b82e7b0c5ce4521ac658b768.tar.gz
barebox-ca929ac265bd7560b82e7b0c5ce4521ac658b768.tar.xz
imx-usb-loader: dump memory bytewise on verification mismatch
dump_long only prints the full words and does not print the unaligned rest. This means that some bytes (and maybe actually the interesting ones) may not be printed. Use dump_bytes instead which does not have this problem. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/imx')
-rw-r--r--scripts/imx/imx-usb-loader.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 7e0a110ab4..541c59e36e 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -331,28 +331,6 @@ static libusb_device *find_imx_dev(libusb_device **devs, const struct mach_id **
return NULL;
}
-static void dump_long(const void *src, unsigned cnt, unsigned addr)
-{
- const unsigned *p = (unsigned *)src;
-
- while (cnt >= 32) {
- printf("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
- addr, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
- p += 8;
- cnt -= 32;
- addr += 32;
- }
- if (cnt) {
- printf("%08x:", addr);
- while (cnt >= 4) {
- printf(" %08x", p[0]);
- p++;
- cnt -= 4;
- }
- printf("\n");
- }
-}
-
static void dump_bytes(const void *src, unsigned cnt, unsigned addr)
{
const unsigned char *p = src;
@@ -1179,9 +1157,9 @@ static int verify_memory(const void *buf, unsigned len, unsigned addr)
if (memcmp(buf + offset, readbuf + offset, now)) {
printf("mismatch at offset 0x%08x. expected:\n", offset);
- dump_long(buf + offset, now, addr + offset);
+ dump_bytes(buf + offset, now, addr + offset);
printf("read:\n");
- dump_long(readbuf + offset, now, addr + offset);
+ dump_bytes(readbuf + offset, now, addr + offset);
ret = -EINVAL;
mismatch++;
if (mismatch > 4)