imx: ventana: hexdump invalid EEPROM data
authorTim Harvey <tharvey@gateworks.com>
Thu, 21 Feb 2019 16:48:48 +0000 (08:48 -0800)
committerStefano Babic <sbabic@denx.de>
Wed, 13 Mar 2019 08:14:35 +0000 (09:14 +0100)
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
board/gateworks/gw_ventana/eeprom.c
configs/gwventana_emmc_defconfig
configs/gwventana_gw5904_defconfig
configs/gwventana_nand_defconfig

index ee227320c05049a1656e67d9ce947fd1effe0cac..5e9cf1157528d2926eb0cc21a307b83428ae06c3 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <hexdump.h>
 #include <i2c.h>
 #include <malloc.h>
 #include <asm/bitops.h>
@@ -46,6 +47,8 @@ read_eeprom(int bus, struct ventana_board_info *info)
        /* sanity checks */
        if (info->model[0] != 'G' || info->model[1] != 'W') {
                puts("EEPROM: Invalid Model in EEPROM\n");
+               print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf,
+                                    sizeof(*info));
                return GW_UNKNOWN;
        }
 
@@ -55,6 +58,8 @@ read_eeprom(int bus, struct ventana_board_info *info)
        if ((info->chksum[0] != chksum>>8) ||
            (info->chksum[1] != (chksum&0xff))) {
                puts("EEPROM: Failed EEPROM checksum\n");
+               print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf,
+                                    sizeof(*info));
                return GW_UNKNOWN;
        }
 
@@ -116,6 +121,11 @@ read_eeprom(int bus, struct ventana_board_info *info)
                else if (info->model[4] == '0' && info->model[5] == '9')
                        type = GW5909;
                break;
+       default:
+               printf("EEPROM: Unknown model in EEPROM: %s\n", info->model);
+               print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf,
+                                    sizeof(*info));
+               break;
        }
        return type;
 }
index f95957adabeec5673f0c99ae6dc1070357a65747..07171c7009976b1a7388874d9ef2195f7783b9d7 100644 (file)
@@ -85,5 +85,6 @@ CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_HEXDUMP=y
 CONFIG_OF_LIBFDT=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
index 219d31a9a186839ceb92e072bdd263a58e751918..0ed2209e3b79c6add500ed658a26f3c02e909360 100644 (file)
@@ -89,5 +89,6 @@ CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_HEXDUMP=y
 CONFIG_OF_LIBFDT=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
index 466a7752ad81317f4c7dc6701a7899b58b315d43..57e4a999aba92d25e8bc5f579224631cec85de2a 100644 (file)
@@ -88,5 +88,6 @@ CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_HEXDUMP=y
 CONFIG_OF_LIBFDT=y
 CONFIG_FDT_FIXUP_PARTITIONS=y