]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/kwbimage.c
tpm: Move the I2C TPM code into one file
[karo-tx-uboot.git] / tools / kwbimage.c
index 66f459ad6b1c7f2b65eb612349e6a2e647c8238e..3fa90d3a758ab407206773fa3fd932d696794a8d 100644 (file)
@@ -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;