[U-Boot] [PATCH] tools: socfpga: fix sfp_verify_header
Atsushi Nemoto
atsushi.nemoto at sord.co.jp
Thu Sep 20 08:12:05 UTC 2018
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 at sord.co.jp>
---
tools/socfpgaimage.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/socfpgaimage.c b/tools/socfpgaimage.c
index 390c9bb..fea22b4 100644
--- a/tools/socfpgaimage.c
+++ b/tools/socfpgaimage.c
@@ -174,6 +174,7 @@ static int sfp_verify_header(const uint8_t *buf, uint8_t *ver)
if (le32_to_cpu(header_v0.validation) != VALIDATION_WORD)
return -1;
+ *ver = header_v0.version;
if (header_v0.version == 0) {
hdr_csum = le16_to_cpu(header_v0.checksum);
sfp_csum = sfp_hdr_checksum((uint8_t *)&header_v0, 0);
--
2.1.4
More information about the U-Boot
mailing list