Hello community, here is the log from the commit of package imx-usb-loader for openSUSE:Factory checked in at 2018-03-24 16:15:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/imx-usb-loader (Old) and /work/SRC/openSUSE:Factory/.imx-usb-loader.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "imx-usb-loader" Sat Mar 24 16:15:46 2018 rev:7 rq:590353 version:0.0~git20180210 Changes: -------- --- /work/SRC/openSUSE:Factory/imx-usb-loader/imx-usb-loader.changes 2017-10-13 14:21:05.155042700 +0200 +++ /work/SRC/openSUSE:Factory/.imx-usb-loader.new/imx-usb-loader.changes 2018-03-24 16:16:04.202005326 +0100 @@ -1,0 +2,6 @@ +Thu Mar 22 14:34:02 UTC 2018 - [email protected] + +- Update to 0.0~git20180210: + * imx_sdp: move jump command out of main download function + +------------------------------------------------------------------- Old: ---- imx_usb_loader-1507537358.7e77787.tar.bz2 New: ---- imx_usb_loader-1518291894.869d06b.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ imx-usb-loader.spec ++++++ --- /var/tmp/diff_new_pack.eUPnRu/_old 2018-03-24 16:16:05.101972884 +0100 +++ /var/tmp/diff_new_pack.eUPnRu/_new 2018-03-24 16:16:05.101972884 +0100 @@ -1,7 +1,7 @@ # # spec file for package imx-usb-loader # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2012 Guillaume GARDET <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -17,13 +17,13 @@ # -%define git_version 1507537358.7e77787 +%define git_version 1518291894.869d06b Name: imx-usb-loader -Version: 0.0~git20171009 +Version: 0.0~git20180210 Release: 0 Summary: Vybrid/i.MX recovery utility -License: LGPL-2.1+ +License: LGPL-2.1-or-later Group: Hardware/Other Url: https://github.com/boundarydevices/imx_usb_loader Source0: imx_usb_loader-%{git_version}.tar.bz2 ++++++ imx_usb_loader-1507537358.7e77787.tar.bz2 -> imx_usb_loader-1518291894.869d06b.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imx_usb_loader-1507537358.7e77787/Makefile new/imx_usb_loader-1518291894.869d06b/Makefile --- old/imx_usb_loader-1507537358.7e77787/Makefile 2017-10-09 10:22:38.000000000 +0200 +++ new/imx_usb_loader-1518291894.869d06b/Makefile 2018-02-10 20:44:54.000000000 +0100 @@ -38,6 +38,11 @@ install -m755 imx_usb '$(DESTDIR)$(bindir)/imx_usb' install -m755 imx_uart '$(DESTDIR)$(bindir)/imx_uart' +uninstall: + rm -rf '$(DESTDIR)$(sysconfdir)/imx-loader.d/' + rm -rf '$(DESTDIR)$(bindir)/imx_usb' + rm -rf '$(DESTDIR)$(bindir)/imx_uart' + clean: rm -f imx_usb imx_uart imx_usb.o imx_uart.o imx_sdp.o diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imx_usb_loader-1507537358.7e77787/imx_sdp.c new/imx_usb_loader-1518291894.869d06b/imx_sdp.c --- old/imx_usb_loader-1507537358.7e77787/imx_sdp.c 2017-10-09 10:22:38.000000000 +0200 +++ new/imx_usb_loader-1518291894.869d06b/imx_sdp.c 2018-02-10 20:44:54.000000000 +0100 @@ -1500,16 +1500,10 @@ return transferSize; } -#define MAX_IN_LENGTH 100 // max length for user input strings - -#define FT_APP 0xaa -#define FT_CSF 0xcc -#define FT_DCD 0xee -#define FT_LOAD_ONLY 0x00 -int DoIRomDownload(struct sdp_dev *dev, struct sdp_work *curr, int verify) +int jump(struct sdp_dev *dev, unsigned int header_addr) { -// address, format, data count, data, type - //static unsigned char jump_command[] = {0x0b,0x0b, V(0), 0x00, V(0x00000000), V(0), 0x00}; + int last_trans, err, retry = 0; + unsigned char tmp[64]; struct sdp_command jump_command = { .cmd = SDP_JUMP_ADDRESS, .addr = 0, @@ -1518,6 +1512,40 @@ .data = 0, .rsvd = 0x00}; + printf("jumping to 0x%08x\n", header_addr); + jump_command.addr = BE32(header_addr); + for (;;) { + err = dev->transfer(dev, 1, (unsigned char *)&jump_command, sizeof(jump_command), 0, &last_trans); + if (!err) + break; + printf("jump_command err=%i, last_trans=%i\n", err, last_trans); + if (retry > 5) { + return -4; + } + retry++; + } + memset(tmp, 0, sizeof(tmp)); + err = dev->transfer(dev, 3, tmp, sizeof(tmp), 4, &last_trans); + if (err) + printf("j3 in err=%i, last_trans=%i %02x %02x %02x %02x\n", err, last_trans, tmp[0], tmp[1], tmp[2], tmp[3]); + + memset(tmp, 0, sizeof(tmp)); + err = dev->transfer(dev, 4, tmp, sizeof(tmp), 4, &last_trans); + if (tmp[0] || tmp[1] || tmp[2] || tmp[3]) + printf("j4 in err=%i, last_trans=%i %02x %02x %02x %02x\n", err, last_trans, tmp[0], tmp[1], tmp[2], tmp[3]); + + // Ignore error. Documentation says "This report is sent by device only in case of an error jumping to the given address..." + return 0; +} + +#define MAX_IN_LENGTH 100 // max length for user input strings + +#define FT_APP 0xaa +#define FT_CSF 0xcc +#define FT_DCD 0xee +#define FT_LOAD_ONLY 0x00 +int DoIRomDownload(struct sdp_dev *dev, struct sdp_work *curr, int verify) +{ int ret; FILE* xfile; unsigned char type; @@ -1525,13 +1553,11 @@ unsigned header_offset; int cnt; unsigned file_base; - int last_trans, err; #define BUF_SIZE (1024*16) unsigned char *buf = NULL; unsigned char *verify_buffer = NULL; unsigned verify_cnt; unsigned char *p; - unsigned char tmp[64]; unsigned dladdr = 0; unsigned max_length; unsigned plugin = 0; @@ -1539,7 +1565,6 @@ unsigned skip = 0; unsigned transferSize=0; - int retry = 0; print_sdp_work(curr); xfile = fopen(curr->filename, "rb" ); @@ -1660,35 +1685,17 @@ } } - if (dev->mode == MODE_HID) if (type == FT_APP) { - printf("jumping to 0x%08x\n", header_addr); - jump_command.addr = BE32(header_addr); - //Any command will initiate jump for mx51, jump address is ignored by mx51 - retry = 0; - for (;;) { - err = dev->transfer(dev, 1, (unsigned char *)&jump_command, sizeof(jump_command), 0, &last_trans); - if (!err) - break; - printf("jump_command err=%i, last_trans=%i\n", err, last_trans); - if (retry > 5) { - return -4; - } - retry++; - } - memset(tmp, 0, sizeof(tmp)); - err = dev->transfer(dev, 3, tmp, sizeof(tmp), 4, &last_trans); - if (err) - printf("j3 in err=%i, last_trans=%i %02x %02x %02x %02x\n", err, last_trans, tmp[0], tmp[1], tmp[2], tmp[3]); - if (dev->mode == MODE_HID) { - memset(tmp, 0, sizeof(tmp)); - err = dev->transfer(dev, 4, tmp, sizeof(tmp), 4, &last_trans); - if (tmp[0] || tmp[1] || tmp[2] || tmp[3]) - printf("j4 in err=%i, last_trans=%i %02x %02x %02x %02x\n", err, last_trans, tmp[0], tmp[1], tmp[2], tmp[3]); - // Ignore error. Documentation says "This report is sent by device only in case of an error jumping to the given address..." - err = 0; - } + /* + * Any command will initiate jump for bulk devices, no need to + * explicitly send a jump command + */ + if (dev->mode == MODE_HID && type == FT_APP) { + ret = jump(dev, header_addr); + if (ret < 0) + goto cleanup; } + ret = (fsize <= transferSize) ? 0 : -16; cleanup: fclose(xfile);
