Lines Matching refs:fit
38 static int spl_fit_get_image_name(const void *fit, int images, in spl_fit_get_image_name() argument
47 conf_node = fit_find_config_node(fit); in spl_fit_get_image_name()
51 for (node = fdt_first_subnode(fit, conf_node); in spl_fit_get_image_name()
53 node = fdt_next_subnode(fit, node)) { in spl_fit_get_image_name()
54 name = fdt_getprop(fit, node, "description", &len); in spl_fit_get_image_name()
61 name = fdt_getprop(fit, conf_node, type, &len); in spl_fit_get_image_name()
92 static int spl_fit_get_image_node(const void *fit, int images, in spl_fit_get_image_node() argument
99 err = spl_fit_get_image_name(fit, images, type, index, &str); in spl_fit_get_image_node()
105 node = fdt_subnode_offset(fit, images, str); in spl_fit_get_image_node()
153 static int spl_fit_image_uncipher(const void *fit, int noffset, in spl_fit_image_uncipher() argument
167 node_name = fdt_get_name(fit, noffset, NULL); in spl_fit_image_uncipher()
173 cipher_noffset = fdt_subnode_offset(fit, noffset, FIT_CIPHER_NODENAME); in spl_fit_image_uncipher()
180 if (fit_image_cipher_get_algo(fit, cipher_noffset, &algo_name)) { in spl_fit_image_uncipher()
191 iv = fdt_getprop(fit, cipher_noffset, "iv", &iv_len); in spl_fit_image_uncipher()
250 void *fit, ulong base_offset, int node, in spl_load_fit_image() argument
267 if (fit_image_get_comp(fit, node, &image_comp)) in spl_load_fit_image()
272 if (fit_image_get_type(fit, node, &type)) in spl_load_fit_image()
277 fit_image_get_comp(fit, node, &image_comp); in spl_load_fit_image()
280 if (fit_image_get_load(fit, node, &load_addr)) in spl_load_fit_image()
285 if (fit_image_get_comp_addr(fit, node, &comp_addr)) in spl_load_fit_image()
294 if (fit_image_get_cipher_addr(fit, node, &cipher_addr)) in spl_load_fit_image()
298 if (!fit_image_get_data_position(fit, node, &offset)) { in spl_load_fit_image()
300 } else if (!fit_image_get_data_offset(fit, node, &offset)) { in spl_load_fit_image()
307 if (fit_image_get_data_size(fit, node, &len)) in spl_load_fit_image()
331 if (fit_image_get_data(fit, node, &data, &length)) { in spl_load_fit_image()
343 fit_get_name(fit, node, NULL), load_addr, in spl_load_fit_image()
344 (char *)fdt_getprop(fit, node, FIT_COMP_PROP, NULL), in spl_load_fit_image()
348 fit_get_name(fit, node, NULL), load_addr); in spl_load_fit_image()
352 fit_image_print(fit, node, ""); in spl_load_fit_image()
354 if (!fit_image_verify_with_data(fit, node, in spl_load_fit_image()
359 if (fdt_subnode_offset(fit, node, FIT_CIPHER_NODENAME) > 0) { in spl_load_fit_image()
362 if (spl_fit_image_uncipher(fit, node, cipher_addr, length, (ulong)src)) in spl_load_fit_image()
369 if (board_fit_image_post_process(fit, node, (ulong *)&load_addr, in spl_load_fit_image()
393 image_info->entry_point = fdt_getprop_u32(fit, node, "entry"); in spl_load_fit_image()
401 void *fit, int images, ulong base_offset) in spl_fit_append_fdt() argument
407 node = spl_fit_get_image_node(fit, images, FIT_FDT_PROP, 0); in spl_fit_append_fdt()
418 ret = spl_load_fit_image(info, sector, fit, base_offset, node, in spl_fit_append_fdt()
437 node = spl_fit_get_image_node(fit, images, FIT_FDT_PROP, 1); in spl_fit_append_fdt()
446 ret = spl_load_fit_image(info, sector, fit, base_offset, node, in spl_fit_append_fdt()
452 static int spl_fit_record_loadable(const void *fit, int images, int index, in spl_fit_record_loadable() argument
460 ret = spl_fit_get_image_name(fit, images, "loadables", in spl_fit_record_loadable()
465 node = spl_fit_get_image_node(fit, images, "loadables", index); in spl_fit_record_loadable()
469 fdt_getprop(fit, node, "type", NULL), in spl_fit_record_loadable()
470 fdt_getprop(fit, node, "os", NULL)); in spl_fit_record_loadable()
475 static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os) in spl_fit_image_get_os() argument
480 return fit_image_get_os(fit, noffset, os); in spl_fit_image_get_os()
497 void *fit; in spl_fit_load_blob() local
525 fit = (void *)((CONFIG_SYS_TEXT_BASE - size - info->bl_len - in spl_fit_load_blob()
528 count = info->read(info, sector, sectors, fit); in spl_fit_load_blob()
530 mtd_blk_map_fit(info->dev, sector, fit); in spl_fit_load_blob()
533 sector, sectors, fit, count); in spl_fit_load_blob()
537 return fit; in spl_fit_load_blob()
549 static int spl_fit_get_kernel_dtb(const void *fit, int images_noffset) in spl_fit_get_kernel_dtb() argument
555 node = spl_fit_get_image_node(fit, images_noffset, in spl_fit_get_kernel_dtb()
559 name = fdt_get_name(fit, node, NULL); in spl_fit_get_kernel_dtb()
592 void *fit; in spl_load_kernel_fit() local
622 fit = spl_fit_load_blob(info, sector, fit_header, &base_offset); in spl_load_kernel_fit()
623 if (!fit) { in spl_load_kernel_fit()
632 conf_noffset = fit_conf_get_node(fit, NULL); in spl_load_kernel_fit()
638 ret = fit_config_verify(fit, conf_noffset); in spl_load_kernel_fit()
645 images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); in spl_load_kernel_fit()
654 node = spl_fit_get_kernel_dtb(fit, images_noffset); in spl_load_kernel_fit()
656 node = spl_fit_get_image_node(fit, images_noffset, in spl_load_kernel_fit()
663 ret = spl_load_fit_image(info, sector, fit, base_offset, in spl_load_kernel_fit()
715 void *fit; in spl_internal_load_simple_fit() local
717 fit = spl_fit_load_blob(info, sector, fit_header, &base_offset); in spl_internal_load_simple_fit()
718 if (!fit) { in spl_internal_load_simple_fit()
724 images = fdt_path_offset(fit, FIT_IMAGES_PATH); in spl_internal_load_simple_fit()
741 conf_noffset = fit_conf_get_node(fit, NULL); in spl_internal_load_simple_fit()
747 ret = fit_config_verify(fit, conf_noffset); in spl_internal_load_simple_fit()
757 ret = fit_rollback_index_verify(fit, FIT_ROLLBACK_INDEX_SPL, in spl_internal_load_simple_fit()
780 node = spl_fit_get_image_node(fit, images, in spl_internal_load_simple_fit()
785 ret = spl_load_fit_image(info, sector, fit, base_offset, in spl_internal_load_simple_fit()
790 ret = fit_get_desc(fit, node, &desc); in spl_internal_load_simple_fit()
815 node = spl_fit_get_image_node(fit, images, FIT_FIRMWARE_PROP, in spl_internal_load_simple_fit()
819 node = spl_fit_get_image_node(fit, images, FIT_KERNEL_PROP, 0); in spl_internal_load_simple_fit()
823 node = spl_fit_get_image_node(fit, images, "loadables", 0); in spl_internal_load_simple_fit()
837 ret = spl_load_fit_image(info, sector, fit, base_offset, node, in spl_internal_load_simple_fit()
846 if (!spl_fit_image_get_os(fit, node, &spl_image->os)) in spl_internal_load_simple_fit()
855 ret = spl_fit_append_fdt(spl_image, info, sector, fit, in spl_internal_load_simple_fit()
865 node = spl_fit_get_image_node(fit, images, "loadables", index); in spl_internal_load_simple_fit()
869 if (!spl_fit_image_get_os(fit, node, &os_type)) in spl_internal_load_simple_fit()
877 ret = spl_load_fit_image(info, sector, fit, base_offset, node, in spl_internal_load_simple_fit()
884 fit_image_get_arch(fit, node, &ih_arch); in spl_internal_load_simple_fit()
893 fit, images, base_offset); in spl_internal_load_simple_fit()
909 spl_fit_record_loadable(fit, images, index, in spl_internal_load_simple_fit()
930 struct spl_load_info *info, ulong sector, void *fit) in spl_load_simple_fit() argument
946 if (info->read(info, sector_offs, 1, fit) != 1) { in spl_load_simple_fit()
952 if (image_get_magic(fit) != FDT_MAGIC) { in spl_load_simple_fit()
958 sector_offs, fit); in spl_load_simple_fit()