You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the necessary sunxi_boot_size function to determine it dynamically from headers:
Accept a <F: Read + Seek> (as does erofs_size).
Seek to current position + 0x8000. The reason for "current position" (not "start") is so that the function works on either an open u-boot-sunxi-with-spl.bin (good for testing) OR the raw mmcblk0 (which is already seeked to the correct offset).
At this new offset will be the contents of u-boot.img, which will either be:
A legacy/classic U-Boot uImage: header starts with the 4 bytes 27 05 19 56, and the total uImage size is the 64 byte header + body size stored as a big endian u32 at offset 0xC within the header.
A FIT: header starts with D0 0D FE ED , total header size is a big-endian u32 at offset 0x4, whole header to be parsed with fdt crate (a FIT's header is in standard FDT format). Body size is determined by iterating every child of "/images", summing together the "data-size" and "data-offset" properties of each (as usizes), then selecting the maximum. Total FIT size is header size + body size.
Seek back to the original position that the caller expects.
Return the boot image size as the u-boot.img size + 0x8000.
Add the necessary
sunxi_boot_size
function to determine it dynamically from headers:<F: Read + Seek>
(as doeserofs_size
).u-boot-sunxi-with-spl.bin
(good for testing) OR the raw mmcblk0 (which is already seeked to the correct offset).u-boot.img
, which will either be:27 05 19 56
, and the total uImage size is the 64 byte header + body size stored as a big endian u32 at offset 0xC within the header.D0 0D FE ED
, total header size is a big-endian u32 at offset 0x4, whole header to be parsed with fdt crate (a FIT's header is in standard FDT format). Body size is determined by iterating every child of"/images"
, summing together the"data-size"
and"data-offset"
properties of each (as usizes), then selecting the maximum. Total FIT size is header size + body size.u-boot.img
size + 0x8000.Originally posted by @CFSworks in #1 (comment)
The text was updated successfully, but these errors were encountered: