tools: socfpga: fix sfp_verify_header
authorAtsushi Nemoto <atsushi.nemoto@sord.co.jp>
Fri, 21 Sep 2018 00:19:13 +0000 (09:19 +0900)
committerMarek Vasut <marex@denx.de>
Wed, 3 Oct 2018 10:56:50 +0000 (12:56 +0200)
Fix sfp_verify_header to return correct version number.
This fixes "Not a sane SOCFPGA preloader" error message with v1 header.

Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
tools/socfpgaimage.c

index 390c9bb4025798875f189fedeccaba10d4a254e5..72d8b96f54140c535276040890d5dfc2d05997cd 100644 (file)
@@ -191,6 +191,7 @@ static int sfp_verify_header(const uint8_t *buf, uint8_t *ver)
        if (hdr_csum != sfp_csum)
                return -EINVAL;
 
+       *ver = header_v0.version;
        return img_len;
 }