tools: kwbimage: Check for maximal kwbimage header size

BootROM loads kwbimage header to L2-SRAM and BootROM reserve only 192 kB for it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Pali Rohár 2022-01-12 18:20:43 +01:00 committed by Stefan Roese
parent 252e7c3a24
commit 78d997f98b

View file

@ -2033,6 +2033,11 @@ static int kwbimage_generate(struct image_tool_params *params,
free(image_cfg);
exit(EXIT_FAILURE);
}
if (alloc_len > 192*1024) {
fprintf(stderr, "Header is too big (%u bytes), maximal kwbimage header size is %u bytes\n", alloc_len, 192*1024);
free(image_cfg);
exit(EXIT_FAILURE);
}
break;
default: