summaryrefslogtreecommitdiff
path: root/tools/rksd.c
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2017-02-18 19:46:27 +0100
committerSimon Glass <sjg@chromium.org>2017-03-16 16:03:44 -0600
commitcfbcdade763c87c7dde52020b8b98d399540ede2 (patch)
tree43917a090f0f48f4d076f2483f11392cee5f3384 /tools/rksd.c
parentaade077e431b584980a0418c0e464f6ef31c5c20 (diff)
rockchip: mkimage: Allow encoding of loader code in spl images
Rockchip SoCs allow the spl code to be rc4-encoded, not only the image header, but only newer SoCs allow this encoding to be disabled. The rk3188 is not part of those and requires its boot code to be rc4-encoded with the regular key. So add the ability to do this encoding via a setting on a per-soc basis when building spl images. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'tools/rksd.c')
-rw-r--r--tools/rksd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/rksd.c b/tools/rksd.c
index a2baa74d31..ff2233ff2d 100644
--- a/tools/rksd.c
+++ b/tools/rksd.c
@@ -41,6 +41,10 @@ static void rksd_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);
}
static int rksd_extract_subimage(void *buf, struct image_tool_params *params)