]> git.sur5r.net Git - u-boot/blobdiff - tools/rkspi.c
Merge git://git.denx.de/u-boot-mmc
[u-boot] / tools / rkspi.c
index 800e235168ff5d041469c4c57bc0b5a7c44bc781..0271d2e817bfa0e1d543b4b3c414b4351568238e 100644 (file)
@@ -48,13 +48,17 @@ static void rkspi_set_header(void *buf, struct stat *sbuf, int ifd,
        memcpy(buf + RK_SPL_HDR_START, rkcommon_get_spl_hdr(params),
               RK_SPL_HDR_SIZE);
 
+       if (rkcommon_need_rc4_spl(params))
+               rkcommon_rc4_encode_spl(buf, RK_SPL_START - 4,
+                                       params->file_size - RK_SPL_START + 4);
+
        /*
         * Spread the image out so we only use the first 2KB of each 4KB
         * region. This is a feature of the SPI format required by the Rockchip
         * boot ROM. Its rationale is unknown.
         */
        for (sector = size / RKSPI_SECT_LEN - 1; sector >= 0; sector--) {
-               printf("sector %u\n", sector);
+               debug("sector %u\n", sector);
                memmove(buf + sector * RKSPI_SECT_LEN * 2,
                        buf + sector * RKSPI_SECT_LEN,
                        RKSPI_SECT_LEN);