Recent versions broke compat with U-Boot "Jump to Script" feature
delroth opened this issue · comments
U-Boot supports SDP jumping to something that is not an IMX header. If that happens, it tries interpreting the data as a U-Boot script:
/* If imx header fails, try some U-Boot specific headers */
if (status) {
#ifdef CONFIG_SPL_BUILD
/* In SPL, allow jumps to U-Boot images */
...
#else
/* In U-Boot, allow jumps to scripts */
source(sdp_func->jmp_address, "script@1");
#endif
}
Unfortunately, recent versions of imx_usb_loader broke this by always trying to append a header and jumping to that header. I'm talking specifically about this in imx_sdp.c:
ld.dladdr = curr->load_addr;
ld.header_addr = ld.dladdr + ld.max_length;
ld.header_offset = curr->load_skip + ld.max_length;
...
ret = jump(dev, ld.header_addr);
Note: this new feature seems to be broken in my tests anyway -- the header was never transferred to the device because a bounds check later on caps the transfer size to the original file size.
Could you provide a way to restore the previous behaviour of transferring and jumping to headerless data?
Thanks!
Haven't tested it myself but 2 people reported it working on fail0verflow/shofel2#2
Thanks a lot for a super prompt response to this issue!
Best,