From patchwork Fri Sep 21 00:19:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atsushi Nemoto X-Patchwork-Id: 973178 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sord.co.jp Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42Grk12H5jz9sBJ for ; Fri, 21 Sep 2018 21:20:25 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 030BAC21E1E; Fri, 21 Sep 2018 11:19:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5ED95C21E56; Fri, 21 Sep 2018 11:19:00 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 822E5C21C4A; Fri, 21 Sep 2018 00:19:41 +0000 (UTC) Received: from dmz-ms2.toshiba-tops.co.jp (ms2.toshiba-tops.co.jp [61.200.21.4]) by lists.denx.de (Postfix) with ESMTP id EA814C21C38 for ; Fri, 21 Sep 2018 00:19:36 +0000 (UTC) Received: from [192.168.254.254] ([192.168.254.254]) by dmz-ms2.toshiba-tops.co.jp ([192.168.254.3]) with ESMTP id 1537489248.907057.2786614176.dmz-ms2 for <>; Fri, 21 Sep 2018 09:20:48 +0900 (JST) Received: from localhost (172.17.28.65) by TPSSRV64.toshiba-tops.co.jp (172.16.4.164) with Microsoft SMTP Server id 14.2.318.1; Fri, 21 Sep 2018 09:20:44 +0900 Date: Fri, 21 Sep 2018 09:19:13 +0900 Message-ID: <20180921.091913.1501105377254922471.atsushi.nemoto@sord.co.jp> To: X-TERRACE-DUMMYSUBJECT: Terrace Spam system * From: Atsushi Nemoto X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A B746 CA77 FE94 2874 D52F X-Pgp-Public-Key: http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0x2874D52F X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) MIME-Version: 1.0 X-TERRACE-SPAMMARK: NO (SR:19.72) (by Terrace) X-TERRACE-SID: 1537489248.907057.2786614176.dmz-ms2 X-TERRACE-CLASSID: Terrace Spam system X-Mailman-Approved-At: Fri, 21 Sep 2018 11:18:56 +0000 Cc: Marek Vasut Subject: [U-Boot] [PATCH v2] tools: socfpga: fix sfp_verify_header X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- v2: move the *ver assignment to just before return. tools/socfpgaimage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/socfpgaimage.c b/tools/socfpgaimage.c index 390c9bb..72d8b96 100644 --- a/tools/socfpgaimage.c +++ b/tools/socfpgaimage.c @@ -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; }