From ad906753c20a5bafbb6b4f34d454ed8355fa22e7 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Fri, 23 Jul 2021 11:14:31 +0200 Subject: tools: kwbimage: Remove v1 kwbimage SPL padding to CONFIG_SYS_U_BOOT_OFFS bytes This padding depends on board config file and therefore it makes the mkimage binary tool board specific, which is not correct. One cannot use mkimage tool built as a result for board A to generate images for board B, even if both A and B are on the same platform. This CONFIG_SYS_U_BOOT_OFFS padding was needed when kwbimage v1 contained SPL code which loaded U-Boot proper based on CONFIG_SYS_U_BOOT_OFFS, instead of reading correct offset from kwbimage header. Now that SPL code parses kwbimage header and deterinate correct offset, there is no need for this CONFIG_SYS_U_BOOT_OFFS padding anymore. By removing it we also reduce the size of SPL code and therefore also decrease the final size of v1 kwbimage. This means there is more space for U-Boot proper binary. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún Reviewed-by: Chris Packham Reviewed-by: Stefan Roese --- tools/kwbimage.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'tools/kwbimage.c') diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 9ecda861e4f..ccb0b922669 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -979,19 +979,6 @@ static size_t image_headersz_v1(int *hasext) *hasext = 1; } -#if defined(CONFIG_SYS_U_BOOT_OFFS) - if (headersz > CONFIG_SYS_U_BOOT_OFFS) { - fprintf(stderr, - "Error: Image header (incl. SPL image) too big!\n"); - fprintf(stderr, "header=0x%x CONFIG_SYS_U_BOOT_OFFS=0x%x!\n", - (int)headersz, CONFIG_SYS_U_BOOT_OFFS); - fprintf(stderr, "Increase CONFIG_SYS_U_BOOT_OFFS!\n"); - return 0; - } - - headersz = CONFIG_SYS_U_BOOT_OFFS; -#endif - /* * The payload should be aligned on some reasonable * boundary -- cgit v1.2.3