X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=tools%2Fkwbimage.c;h=3fa90d3a758ab407206773fa3fd932d696794a8d;hb=7237a4b0e45a28991c3822cc60b1289c4aced997;hp=66f459ad6b1c7f2b65eb612349e6a2e647c8238e;hpb=a0573d19885236ba03d412f7788104f75f0dea64;p=karo-tx-uboot.git diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 66f459ad6b..3fa90d3a75 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -115,6 +115,7 @@ struct boot_mode boot_modes[] = { { 0x78, "sata" }, { 0x9C, "pex" }, { 0x69, "uart" }, + { 0xAE, "sdio" }, {}, }; @@ -420,6 +421,18 @@ static size_t image_headersz_v1(struct image_tool_params *params, *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; + } else { + headersz = CONFIG_SYS_U_BOOT_OFFS; + } +#endif + /* * The payload should be aligned on some reasonable * boundary @@ -498,6 +511,7 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params, binhdrsz = sizeof(struct opt_hdr_v1) + (binarye->binary.nargs + 1) * sizeof(unsigned int) + s.st_size; + binhdrsz = ALIGN_SUP(binhdrsz, 32); hdr->headersz_lsb = binhdrsz & 0xFFFF; hdr->headersz_msb = (binhdrsz & 0xFFFF0000) >> 16;