Lines Matching refs:params
188 static int rkcommon_get_aligned_size(struct image_tool_params *params, in rkcommon_get_aligned_size() argument
193 size = imagetool_get_filesize(params, fname); in rkcommon_get_aligned_size()
204 int rkcommon_check_params(struct image_tool_params *params) in rkcommon_check_params() argument
212 if (params->lflag || params->iflag) in rkcommon_check_params()
215 if (!rkcommon_get_spl_info(params->imagename)) in rkcommon_check_params()
218 spl_params.init_file = params->datafile; in rkcommon_check_params()
227 rkcommon_get_aligned_size(params, spl_params.init_file); in rkcommon_check_params()
234 rkcommon_get_aligned_size(params, spl_params.boot_file); in rkcommon_check_params()
239 if (spl_params.init_size > rkcommon_get_spl_size(params)) { in rkcommon_check_params()
242 spl_params.init_size, rkcommon_get_spl_size(params)); in rkcommon_check_params()
250 params->imagename ? params->imagename : "NULL"); in rkcommon_check_params()
260 const char *rkcommon_get_spl_hdr(struct image_tool_params *params) in rkcommon_get_spl_hdr() argument
262 struct spl_info *info = rkcommon_get_spl_info(params->imagename); in rkcommon_get_spl_hdr()
270 int rkcommon_get_spl_size(struct image_tool_params *params) in rkcommon_get_spl_size() argument
272 struct spl_info *info = rkcommon_get_spl_info(params->imagename); in rkcommon_get_spl_size()
280 bool rkcommon_need_rc4_spl(struct image_tool_params *params) in rkcommon_need_rc4_spl() argument
282 struct spl_info *info = rkcommon_get_spl_info(params->imagename); in rkcommon_need_rc4_spl()
290 bool rkcommon_is_header_v2(struct image_tool_params *params) in rkcommon_is_header_v2() argument
292 struct spl_info *info = rkcommon_get_spl_info(params->imagename); in rkcommon_is_header_v2()
309 static void rkcommon_set_header0(void *buf, struct image_tool_params *params) in rkcommon_set_header0() argument
315 hdr->disable_rc4 = !rkcommon_need_rc4_spl(params); in rkcommon_set_header0()
337 static void rkcommon_set_header0_v2(void *buf, struct image_tool_params *params) in rkcommon_set_header0_v2() argument
345 printf("Image Type: Rockchip %s boot image\n", rkcommon_get_spl_hdr(params)); in rkcommon_set_header0_v2()
368 struct image_tool_params *params) in rkcommon_set_header() argument
372 if (rkcommon_is_header_v2(params)) { in rkcommon_set_header()
373 rkcommon_set_header0_v2(buf, params); in rkcommon_set_header()
375 rkcommon_set_header0(buf, params); in rkcommon_set_header()
379 memcpy(&hdr->magic, rkcommon_get_spl_hdr(params), RK_SPL_HDR_SIZE); in rkcommon_set_header()
381 if (rkcommon_need_rc4_spl(params)) in rkcommon_set_header()
386 if (rkcommon_need_rc4_spl(params)) in rkcommon_set_header()
458 struct image_tool_params *params) in rkcommon_verify_header() argument
481 if (params->imagename == NULL) in rkcommon_verify_header()
485 spl_info = rkcommon_get_spl_info(params->imagename); in rkcommon_verify_header()
551 int rkcommon_vrec_header(struct image_tool_params *params, in rkcommon_vrec_header() argument
581 params->cmdname, strerror(errno)); in rkcommon_vrec_header()
590 params->orig_file_size = tparams->header_size + in rkcommon_vrec_header()
593 params->file_size = ROUND(params->orig_file_size, RK_SIZE_ALIGN); in rkcommon_vrec_header()
599 static int pad_file(struct image_tool_params *params, int ifd, int pad) in pad_file() argument
612 params->cmdname, params->imagefile, in pad_file()
622 static int copy_file(struct image_tool_params *params, int ifd, in copy_file() argument
630 if (params->vflag) in copy_file()
636 params->cmdname, file, strerror(errno)); in copy_file()
642 params->cmdname, file, strerror(errno)); in copy_file()
646 if (params->vflag) in copy_file()
653 params->cmdname, file, strerror(errno)); in copy_file()
660 params->cmdname, params->imagefile, strerror(errno)); in copy_file()
666 return pad_file(params, ifd, padded_size - size); in copy_file()
675 int rockchip_copy_image(int ifd, struct image_tool_params *params) in rockchip_copy_image() argument
679 ret = copy_file(params, ifd, spl_params.init_file, in rockchip_copy_image()
685 ret = copy_file(params, ifd, spl_params.boot_file, in rockchip_copy_image()
691 return pad_file(params, ifd, in rockchip_copy_image()
692 params->file_size - params->orig_file_size); in rockchip_copy_image()