scripts: imx-image: Limit v2 header size to HEADER_LEN
Given the following:

 1. Assembly code, namely "b 0x1000" instruction, in bb_header[]
    assumes that i.MX image header occupies first HEADER_LEN bytes and
    bootloader executable is located right after.

 2. Code in imx_image_size() assumes that i.MX image header is
    HEADER_LEN bytes

 3. Original code handling v2 header allocated more than HEADER_LEN
    buffer to store IVT + boot data + DCD. However, the code writing
    that buffer to disk is only set up to use first HEADER_LEN bytes
    and to silently discard the rest as a side effect.

Let's be conservative and limit total size of v2 header to not exceed
Inital Load Region (4K or HEADER_LEN) to match what's being done for
v1.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 247117e commit 5849fbf6f92899d4aca4ca99b6d4ba486d781ce5
@Andrey Smirnov Andrey Smirnov authored on 7 Jun 2018
Sascha Hauer committed on 11 Jun 2018
Showing 1 changed file
View
scripts/imx/imx-image.c