Lines Matching refs:params
180 static int rkcommon_get_aligned_size(struct image_tool_params *params, in rkcommon_get_aligned_size() argument
185 size = imagetool_get_filesize(params, fname); in rkcommon_get_aligned_size()
196 int rkcommon_check_params(struct image_tool_params *params) in rkcommon_check_params() argument
204 if (params->lflag || params->iflag) in rkcommon_check_params()
207 if (!rkcommon_get_spl_info(params->imagename)) in rkcommon_check_params()
210 spl_params.init_file = params->datafile; in rkcommon_check_params()
218 size = rkcommon_get_aligned_size(params, spl_params.init_file); in rkcommon_check_params()
225 size = rkcommon_get_aligned_size(params, spl_params.boot_file); in rkcommon_check_params()
231 if (spl_params.init_size > rkcommon_get_spl_size(params)) { in rkcommon_check_params()
234 spl_params.init_size, rkcommon_get_spl_size(params)); in rkcommon_check_params()
242 params->imagename ? params->imagename : "NULL"); in rkcommon_check_params()
252 const char *rkcommon_get_spl_hdr(struct image_tool_params *params) in rkcommon_get_spl_hdr() argument
254 struct spl_info *info = rkcommon_get_spl_info(params->imagename); in rkcommon_get_spl_hdr()
262 int rkcommon_get_spl_size(struct image_tool_params *params) in rkcommon_get_spl_size() argument
264 struct spl_info *info = rkcommon_get_spl_info(params->imagename); in rkcommon_get_spl_size()
272 bool rkcommon_need_rc4_spl(struct image_tool_params *params) in rkcommon_need_rc4_spl() argument
274 struct spl_info *info = rkcommon_get_spl_info(params->imagename); in rkcommon_need_rc4_spl()
282 bool rkcommon_is_header_v2(struct image_tool_params *params) in rkcommon_is_header_v2() argument
284 struct spl_info *info = rkcommon_get_spl_info(params->imagename); in rkcommon_is_header_v2()
298 static void rkcommon_set_header0(void *buf, struct image_tool_params *params) in rkcommon_set_header0() argument
305 hdr->disable_rc4 = cpu_to_le32(!rkcommon_need_rc4_spl(params)); in rkcommon_set_header0()
326 static void rkcommon_set_header0_v2(void *buf, struct image_tool_params *params) in rkcommon_set_header0_v2() argument
335 rkcommon_get_spl_hdr(params)); in rkcommon_set_header0_v2()
360 struct image_tool_params *params) in rkcommon_set_header() argument
364 if (rkcommon_is_header_v2(params)) { in rkcommon_set_header()
365 rkcommon_set_header0_v2(buf, params); in rkcommon_set_header()
367 rkcommon_set_header0(buf, params); in rkcommon_set_header()
371 memcpy(&hdr->magic, rkcommon_get_spl_hdr(params), RK_SPL_HDR_SIZE); in rkcommon_set_header()
373 if (rkcommon_need_rc4_spl(params)) in rkcommon_set_header()
378 if (rkcommon_need_rc4_spl(params)) in rkcommon_set_header()
452 struct image_tool_params *params) in rkcommon_verify_header() argument
475 if (params->imagename == NULL || !strlen(params->imagename)) in rkcommon_verify_header()
479 spl_info = rkcommon_get_spl_info(params->imagename); in rkcommon_verify_header()
486 void rkcommon_print_header(const void *buf, struct image_tool_params *params) in rkcommon_print_header() argument
546 int rkcommon_vrec_header(struct image_tool_params *params, in rkcommon_vrec_header() argument
576 params->cmdname, strerror(errno)); in rkcommon_vrec_header()
585 params->orig_file_size = tparams->header_size + in rkcommon_vrec_header()
588 params->file_size = ROUND(params->orig_file_size, RK_SIZE_ALIGN); in rkcommon_vrec_header()
594 static int pad_file(struct image_tool_params *params, int ifd, int pad) in pad_file() argument
607 params->cmdname, params->imagefile, in pad_file()
617 static int copy_file(struct image_tool_params *params, int ifd, in copy_file() argument
625 if (params->vflag) in copy_file()
631 params->cmdname, file, strerror(errno)); in copy_file()
637 params->cmdname, file, strerror(errno)); in copy_file()
641 if (params->vflag) in copy_file()
648 params->cmdname, file, strerror(errno)); in copy_file()
655 params->cmdname, params->imagefile, strerror(errno)); in copy_file()
661 return pad_file(params, ifd, padded_size - size); in copy_file()
670 int rockchip_copy_image(int ifd, struct image_tool_params *params) in rockchip_copy_image() argument
674 ret = copy_file(params, ifd, spl_params.init_file, in rockchip_copy_image()
680 ret = copy_file(params, ifd, spl_params.boot_file, in rockchip_copy_image()
686 return pad_file(params, ifd, in rockchip_copy_image()
687 params->file_size - params->orig_file_size); in rockchip_copy_image()