All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] tools: socfpga: fix sfp_verify_header
@ 2018-09-21  0:19 Atsushi Nemoto
  2018-09-21  0:30 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2018-09-21  0:19 UTC (permalink / raw)
  To: 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 <atsushi.nemoto@sord.co.jp>
---
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;
 }
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH v2] tools: socfpga: fix sfp_verify_header
  2018-09-21  0:19 [U-Boot] [PATCH v2] tools: socfpga: fix sfp_verify_header Atsushi Nemoto
@ 2018-09-21  0:30 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2018-09-21  0:30 UTC (permalink / raw)
  To: u-boot

On 09/21/2018 02:19 AM, Atsushi Nemoto wrote:
> 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>

Applied, thanks.

> ---
> 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;
>  }
>  
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-21  0:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21  0:19 [U-Boot] [PATCH v2] tools: socfpga: fix sfp_verify_header Atsushi Nemoto
2018-09-21  0:30 ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.