mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v1] imx-usb-loader: skip image verification on iMX25
@ 2018-05-23 11:21 Oleksij Rempel
  2018-05-24  5:50 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksij Rempel @ 2018-05-23 11:21 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

it is broken an multiple MX25 based devices and
we have no information how to fix it.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 scripts/imx/imx-usb-loader.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 43dde8b7f..399bc2a9c 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -72,6 +72,9 @@ struct mach_id {
 #define DEV_IMX		0
 #define DEV_MXS		1
 	unsigned char dev_type;
+	unsigned char verify_mode;
+#define VER_DEFAULT	0
+#define VER_SKIP	1
 };
 
 struct usb_work {
@@ -107,6 +110,7 @@ static const struct mach_id imx_ids[] = {
 		.header_type = HDR_MX51,
 		.mode = MODE_BULK,
 		.max_transfer = 64,
+		.verify_mode = VER_SKIP,
 	}, {
 		.vid = 0x15a2,
 		.pid = 0x0041,
@@ -1346,6 +1350,7 @@ static int do_irom_download(struct usb_work *curr, int verify)
 	unsigned plugin = 0;
 	unsigned header_addr = 0;
 	unsigned skip = 0;
+	const struct mach_id *id = usb_id->mach_id;
 
 	ret = read_file(curr->filename, &buf, &fsize);
 	if (ret < 0)
@@ -1394,6 +1399,11 @@ static int do_irom_download(struct usb_work *curr, int verify)
 
 	type = FT_APP;
 
+	if (id->verify_mode == VER_SKIP) {
+		printf("Verification of flashed image is not supported. Skipping.\n");
+		verify = 0;
+	}
+
 	if (verify) {
 		verify_buffer = malloc(64);
 
-- 
2.17.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH v1] imx-usb-loader: skip image verification on iMX25
  2018-05-23 11:21 [PATCH v1] imx-usb-loader: skip image verification on iMX25 Oleksij Rempel
@ 2018-05-24  5:50 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2018-05-24  5:50 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: barebox

On Wed, May 23, 2018 at 01:21:50PM +0200, Oleksij Rempel wrote:
> it is broken an multiple MX25 based devices and
> we have no information how to fix it.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Dropped in favour for a patch fixing the problem.

Sascha

> ---
>  scripts/imx/imx-usb-loader.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
> index 43dde8b7f..399bc2a9c 100644
> --- a/scripts/imx/imx-usb-loader.c
> +++ b/scripts/imx/imx-usb-loader.c
> @@ -72,6 +72,9 @@ struct mach_id {
>  #define DEV_IMX		0
>  #define DEV_MXS		1
>  	unsigned char dev_type;
> +	unsigned char verify_mode;
> +#define VER_DEFAULT	0
> +#define VER_SKIP	1
>  };
>  
>  struct usb_work {
> @@ -107,6 +110,7 @@ static const struct mach_id imx_ids[] = {
>  		.header_type = HDR_MX51,
>  		.mode = MODE_BULK,
>  		.max_transfer = 64,
> +		.verify_mode = VER_SKIP,
>  	}, {
>  		.vid = 0x15a2,
>  		.pid = 0x0041,
> @@ -1346,6 +1350,7 @@ static int do_irom_download(struct usb_work *curr, int verify)
>  	unsigned plugin = 0;
>  	unsigned header_addr = 0;
>  	unsigned skip = 0;
> +	const struct mach_id *id = usb_id->mach_id;
>  
>  	ret = read_file(curr->filename, &buf, &fsize);
>  	if (ret < 0)
> @@ -1394,6 +1399,11 @@ static int do_irom_download(struct usb_work *curr, int verify)
>  
>  	type = FT_APP;
>  
> +	if (id->verify_mode == VER_SKIP) {
> +		printf("Verification of flashed image is not supported. Skipping.\n");
> +		verify = 0;
> +	}
> +
>  	if (verify) {
>  		verify_buffer = malloc(64);
>  
> -- 
> 2.17.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2018-05-24  5:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 11:21 [PATCH v1] imx-usb-loader: skip image verification on iMX25 Oleksij Rempel
2018-05-24  5:50 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox