libuuu: sdps: add support for uploading i.MX8MP/N barebox binaries
commitaa70f196f0178862eb9d2bc6ac13072cbda76cc8
authorAhmad Fatoum <a.fatoum@pengutronix.de>
Wed, 18 Oct 2023 10:14:15 +0000 (18 12:14 +0200)
committernxpfrankli <frank.li@nxp.com>
Wed, 18 Oct 2023 20:03:06 +0000 (18 16:03 -0400)
tree7e6fa254aafef6b5ad685b9c58ebc13c6da11a1a
parent3f512a617cb52489a18f4ae35af87bd89af78264
libuuu: sdps: add support for uploading i.MX8MP/N barebox binaries

uuu can already upload preprocessed barebox binaries on the i.MX8M Nano
and Plus, because barebox uses the BootROM's API to chainload barebox
proper on these platforms.

The preprocessing that needs to happen is the removal of the first 32K
of the barebox image, which allows barebox to be flashed directly to the
start of an SD-Card or the eMMC user area.

Improve user experience by transparently removing the first 32K of
images if the image has no IVT magic at offset 0, but an IVT magic at
offset 0x8000.

This should ensure that existing upload of U-Boot images works as before,
while allowing upload of barebox images for Nano and Plus as well.

This change has been verified by uploading both a barebox and an U-Boot
binary on an i.MX8MN.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
libuuu/sdps.cpp