From cfbcdade763c87c7dde52020b8b98d399540ede2 Mon Sep 17 00:00:00 2001 From: Heiko Stübner Date: Sat, 18 Feb 2017 19:46:27 +0100 Subject: 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 Reviewed-by: Simon Glass Reviewed-by: Kever Yang Tested-by: Kever Yang --- tools/rkspi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/rkspi.c') diff --git a/tools/rkspi.c b/tools/rkspi.c index a0b0051d38..0271d2e817 100644 --- a/tools/rkspi.c +++ b/tools/rkspi.c @@ -48,6 +48,10 @@ 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 -- cgit v1.2.3