arm: mach-keystone: Use appended original image size in image processing
authorAndrew F. Davis <afd@ti.com>
Tue, 16 Jul 2019 13:49:38 +0000 (09:49 -0400)
committerTom Rini <trini@konsulko.com>
Mon, 29 Jul 2019 21:58:52 +0000 (17:58 -0400)
commitc1c564af5200dd50bfa4a2f2e9a6c73d10de691c
tree29ed3d9705eb153eefbf04eb16c59a1eb4595a12
parent411c1f0e635f5e49ef2e3f5d9d31f01f37d962a8
arm: mach-keystone: Use appended original image size in image processing

When an image is signed/encrypted on K2 devices the image may get padded
to meet alignment requirements for the signature/encryption type. The
original size is appended as 4 bytes little-endian to the end of the
final image.

Normally the trailing extra bytes are ignored and so restoring the
exact original size is not important. In the case of initrd the
original size is important as the kernel uses it to look for
additional filesystem data and can do the wrong thing when the
size is not correct.

Read off the original size and report it back from the image post
processing stage.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
arch/arm/mach-keystone/mon.c