summaryrefslogtreecommitdiff
path: root/tools/rksd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/rksd.c')
-rw-r--r--tools/rksd.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/tools/rksd.c b/tools/rksd.c
index ff2233ff2d..ac8a67d3bc 100644
--- a/tools/rksd.c
+++ b/tools/rksd.c
@@ -13,8 +13,6 @@
#include "mkimage.h"
#include "rkcommon.h"
-static char dummy_hdr[RK_IMAGE_HEADER_LEN];
-
static int rksd_verify_header(unsigned char *buf, int size,
struct image_tool_params *params)
{
@@ -38,13 +36,6 @@ static void rksd_set_header(void *buf, struct stat *sbuf, int ifd,
printf("Warning: SPL image is too large (size %#x) and will not boot\n",
size);
}
-
- 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)
@@ -66,10 +57,12 @@ static int rksd_vrec_header(struct image_tool_params *params,
{
int pad_size;
+ rkcommon_vrec_header(params, tparams);
+
pad_size = RK_SPL_HDR_START + rkcommon_get_spl_size(params);
debug("pad_size %x\n", pad_size);
- return pad_size - params->file_size;
+ return pad_size - params->file_size - tparams->header_size;
}
/*
@@ -78,8 +71,8 @@ static int rksd_vrec_header(struct image_tool_params *params,
U_BOOT_IMAGE_TYPE(
rksd,
"Rockchip SD Boot Image support",
- RK_IMAGE_HEADER_LEN,
- dummy_hdr,
+ 0,
+ NULL,
rkcommon_check_params,
rksd_verify_header,
rksd_print_header,