• Home
  • Raw
  • Download

Lines Matching refs:fit

112 static void fit_get_debug(const void *fit, int noffset,  in fit_get_debug()  argument
116 prop_name, (ulong)fit, noffset, fit_get_name(fit, noffset, NULL), in fit_get_debug()
128 int fit_get_subimage_count(const void *fit, int images_noffset) in fit_get_subimage_count() argument
136 noffset = fdt_next_node(fit, images_noffset, &ndepth); in fit_get_subimage_count()
138 noffset = fdt_next_node(fit, noffset, &ndepth)) { in fit_get_subimage_count()
163 static void fit_image_print_data(const void *fit, int noffset, const char *p, in fit_image_print_data() argument
175 fit_get_name(fit, noffset, NULL)); in fit_image_print_data()
177 if (fit_image_hash_get_algo(fit, noffset, &algo)) { in fit_image_print_data()
182 keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL); in fit_image_print_data()
183 required = fdt_getprop(fit, noffset, "required", NULL) != NULL; in fit_image_print_data()
190 padding = fdt_getprop(fit, noffset, "padding", NULL); in fit_image_print_data()
194 ret = fit_image_hash_get_value(fit, noffset, &value, in fit_image_print_data()
212 if (fit_get_timestamp(fit, noffset, &timestamp)) in fit_image_print_data()
230 static void fit_image_print_verification_data(const void *fit, int noffset, in fit_image_print_verification_data() argument
240 name = fit_get_name(fit, noffset, NULL); in fit_image_print_verification_data()
242 fit_image_print_data(fit, noffset, p, "Hash"); in fit_image_print_verification_data()
245 fit_image_print_data(fit, noffset, p, "Sign"); in fit_image_print_verification_data()
261 static void fit_conf_print(const void *fit, int noffset, const char *p) in fit_conf_print() argument
270 ret = fit_get_desc(fit, noffset, &desc); in fit_conf_print()
277 uname = fdt_getprop(fit, noffset, FIT_KERNEL_PROP, NULL); in fit_conf_print()
285 uname = fdt_getprop(fit, noffset, FIT_RAMDISK_PROP, NULL); in fit_conf_print()
289 uname = fdt_getprop(fit, noffset, FIT_FIRMWARE_PROP, NULL); in fit_conf_print()
294 uname = fdt_stringlist_get(fit, noffset, FIT_FDT_PROP, in fit_conf_print()
304 uname = fdt_getprop(fit, noffset, FIT_FPGA_PROP, NULL); in fit_conf_print()
310 uname = fdt_stringlist_get(fit, noffset, FIT_LOADABLE_PROP, in fit_conf_print()
322 for (ndepth = 0, noffset = fdt_next_node(fit, noffset, &ndepth); in fit_conf_print()
324 noffset = fdt_next_node(fit, noffset, &ndepth)) { in fit_conf_print()
327 fit_image_print_verification_data(fit, noffset, p); in fit_conf_print()
344 void fit_print_contents(const void *fit) in fit_print_contents() argument
361 ret = fit_get_desc(fit, 0, &desc); in fit_print_contents()
369 ret = fit_get_timestamp(fit, 0, &timestamp); in fit_print_contents()
378 images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); in fit_print_contents()
387 noffset = fdt_next_node(fit, images_noffset, &ndepth); in fit_print_contents()
389 noffset = fdt_next_node(fit, noffset, &ndepth)) { in fit_print_contents()
396 fit_get_name(fit, noffset, NULL)); in fit_print_contents()
398 fit_image_print(fit, noffset, p); in fit_print_contents()
403 confs_noffset = fdt_path_offset(fit, FIT_CONFS_PATH); in fit_print_contents()
411 uname = (char *)fdt_getprop(fit, noffset, FIT_DEFAULT_PROP, NULL); in fit_print_contents()
417 noffset = fdt_next_node(fit, confs_noffset, &ndepth); in fit_print_contents()
419 noffset = fdt_next_node(fit, noffset, &ndepth)) { in fit_print_contents()
426 fit_get_name(fit, noffset, NULL)); in fit_print_contents()
428 fit_conf_print(fit, noffset, p); in fit_print_contents()
448 void fit_image_print(const void *fit, int image_noffset, const char *p) in fit_image_print() argument
460 ret = fit_get_desc(fit, image_noffset, &desc); in fit_image_print()
470 ret = fit_get_timestamp(fit, 0, &timestamp); in fit_image_print()
478 fit_image_get_type(fit, image_noffset, &type); in fit_image_print()
481 fit_image_get_comp(fit, image_noffset, &comp); in fit_image_print()
484 ret = fit_image_get_data_and_size(fit, image_noffset, &data, &size); in fit_image_print()
507 fit_image_get_arch(fit, image_noffset, &arch); in fit_image_print()
513 fit_image_get_os(fit, image_noffset, &os); in fit_image_print()
520 ret = fit_image_get_load(fit, image_noffset, &load); in fit_image_print()
529 if (type == IH_TYPE_FLATDT && !fit_image_get_load(fit, image_noffset, &load)) in fit_image_print()
534 ret = fit_image_get_entry(fit, image_noffset, &entry); in fit_image_print()
543 for (ndepth = 0, noffset = fdt_next_node(fit, image_noffset, &ndepth); in fit_image_print()
545 noffset = fdt_next_node(fit, noffset, &ndepth)) { in fit_image_print()
548 fit_image_print_verification_data(fit, noffset, p); in fit_image_print()
553 void fit_print_contents(const void *fit) { } in fit_print_contents() argument
554 void fit_image_print(const void *fit, int image_noffset, const char *p) { } in fit_image_print() argument
570 int fit_get_desc(const void *fit, int noffset, char **desc) in fit_get_desc() argument
574 *desc = (char *)fdt_getprop(fit, noffset, FIT_DESC_PROP, &len); in fit_get_desc()
576 fit_get_debug(fit, noffset, FIT_DESC_PROP, len); in fit_get_desc()
598 int fit_get_timestamp(const void *fit, int noffset, time_t *timestamp) in fit_get_timestamp() argument
603 data = fdt_getprop(fit, noffset, FIT_TIMESTAMP_PROP, &len); in fit_get_timestamp()
605 fit_get_debug(fit, noffset, FIT_TIMESTAMP_PROP, len); in fit_get_timestamp()
630 int fit_image_get_node(const void *fit, const char *image_uname) in fit_image_get_node() argument
634 images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); in fit_image_get_node()
641 noffset = fdt_subnode_offset(fit, images_noffset, image_uname); in fit_image_get_node()
664 int fit_image_get_os(const void *fit, int noffset, uint8_t *os) in fit_image_get_os() argument
670 data = fdt_getprop(fit, noffset, FIT_OS_PROP, &len); in fit_image_get_os()
672 fit_get_debug(fit, noffset, FIT_OS_PROP, len); in fit_image_get_os()
696 int fit_image_get_arch(const void *fit, int noffset, uint8_t *arch) in fit_image_get_arch() argument
702 data = fdt_getprop(fit, noffset, FIT_ARCH_PROP, &len); in fit_image_get_arch()
704 fit_get_debug(fit, noffset, FIT_ARCH_PROP, len); in fit_image_get_arch()
728 int fit_image_get_type(const void *fit, int noffset, uint8_t *type) in fit_image_get_type() argument
734 data = fdt_getprop(fit, noffset, FIT_TYPE_PROP, &len); in fit_image_get_type()
736 fit_get_debug(fit, noffset, FIT_TYPE_PROP, len); in fit_image_get_type()
760 int fit_image_get_comp(const void *fit, int noffset, uint8_t *comp) in fit_image_get_comp() argument
766 data = fdt_getprop(fit, noffset, FIT_COMP_PROP, &len); in fit_image_get_comp()
768 fit_get_debug(fit, noffset, FIT_COMP_PROP, len); in fit_image_get_comp()
778 static int fit_image_get_address(const void *fit, int noffset, char *name, in fit_image_get_address() argument
785 cell = fdt_getprop(fit, noffset, name, &len); in fit_image_get_address()
787 fit_get_debug(fit, noffset, name, len); in fit_image_get_address()
819 int fit_image_get_load(const void *fit, int noffset, ulong *load) in fit_image_get_load() argument
821 return fit_image_get_address(fit, noffset, FIT_LOAD_PROP, load); in fit_image_get_load()
841 int fit_image_get_entry(const void *fit, int noffset, ulong *entry) in fit_image_get_entry() argument
843 return fit_image_get_address(fit, noffset, FIT_ENTRY_PROP, entry); in fit_image_get_entry()
861 int fit_image_get_data(const void *fit, int noffset, in fit_image_get_data() argument
866 *data = fdt_getprop(fit, noffset, FIT_DATA_PROP, &len); in fit_image_get_data()
868 fit_get_debug(fit, noffset, FIT_DATA_PROP, len); in fit_image_get_data()
888 int fit_image_get_data_offset(const void *fit, int noffset, int *data_offset) in fit_image_get_data_offset() argument
892 val = fdt_getprop(fit, noffset, FIT_DATA_OFFSET_PROP, NULL); in fit_image_get_data_offset()
912 int fit_image_get_data_position(const void *fit, int noffset, in fit_image_get_data_position() argument
917 val = fdt_getprop(fit, noffset, FIT_DATA_POSITION_PROP, NULL); in fit_image_get_data_position()
937 int fit_image_get_data_size(const void *fit, int noffset, int *data_size) in fit_image_get_data_size() argument
941 val = fdt_getprop(fit, noffset, FIT_DATA_SIZE_PROP, NULL); in fit_image_get_data_size()
966 int fit_image_get_data_and_size(const void *fit, int noffset, in fit_image_get_data_and_size() argument
974 if (!fit_image_get_data_position(fit, noffset, &offset)) { in fit_image_get_data_and_size()
976 } else if (!fit_image_get_data_offset(fit, noffset, &offset)) { in fit_image_get_data_and_size()
983 offset += ((fdt_totalsize(fit) + 3) & ~3); in fit_image_get_data_and_size()
988 ret = fit_image_get_data_size(fit, noffset, &len); in fit_image_get_data_and_size()
989 *data = fit + offset; in fit_image_get_data_and_size()
992 ret = fit_image_get_data(fit, noffset, data, size); in fit_image_get_data_and_size()
1011 int fit_image_hash_get_algo(const void *fit, int noffset, char **algo) in fit_image_hash_get_algo() argument
1015 *algo = (char *)fdt_getprop(fit, noffset, FIT_ALGO_PROP, &len); in fit_image_hash_get_algo()
1017 fit_get_debug(fit, noffset, FIT_ALGO_PROP, len); in fit_image_hash_get_algo()
1039 int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value, in fit_image_hash_get_value() argument
1044 *value = (uint8_t *)fdt_getprop(fit, noffset, FIT_VALUE_PROP, &len); in fit_image_hash_get_value()
1046 fit_get_debug(fit, noffset, FIT_VALUE_PROP, len); in fit_image_hash_get_value()
1069 static int fit_image_hash_get_ignore(const void *fit, int noffset, int *ignore) in fit_image_hash_get_ignore() argument
1074 value = (int *)fdt_getprop(fit, noffset, FIT_IGNORE_PROP, &len); in fit_image_hash_get_ignore()
1083 ulong fit_get_end(const void *fit) in fit_get_end() argument
1085 return map_to_sysmem((void *)(fit + fdt_totalsize(fit))); in fit_get_end()
1101 int fit_set_timestamp(void *fit, int noffset, time_t timestamp) in fit_set_timestamp() argument
1107 ret = fdt_setprop(fit, noffset, FIT_TIMESTAMP_PROP, &t, in fit_set_timestamp()
1111 FIT_TIMESTAMP_PROP, fit_get_name(fit, noffset, NULL), in fit_set_timestamp()
1163 static int fit_image_check_hash(const void *fit, int noffset, const void *data, in fit_image_check_hash() argument
1175 if (fit_image_hash_get_algo(fit, noffset, &algo)) { in fit_image_check_hash()
1182 fit_image_hash_get_ignore(fit, noffset, &ignore); in fit_image_check_hash()
1189 if (fit_image_hash_get_value(fit, noffset, &fit_value, in fit_image_check_hash()
1211 int fit_image_verify_with_data(const void *fit, int image_noffset, in fit_image_verify_with_data() argument
1221 fit_image_verify_required_sigs(fit, image_noffset, data, size, in fit_image_verify_with_data()
1228 fdt_for_each_subnode(noffset, fit, image_noffset) { in fit_image_verify_with_data()
1229 const char *name = fit_get_name(fit, noffset, NULL); in fit_image_verify_with_data()
1238 if (fit_image_check_hash(fit, noffset, data, size, in fit_image_verify_with_data()
1245 ret = fit_image_check_sig(fit, noffset, data, in fit_image_verify_with_data()
1270 err_msg, fit_get_name(fit, noffset, NULL), in fit_image_verify_with_data()
1271 fit_get_name(fit, image_noffset, NULL)); in fit_image_verify_with_data()
1288 int fit_image_verify(const void *fit, int image_noffset) in fit_image_verify() argument
1296 if (fit_image_get_data_and_size(fit, image_noffset, &data, &size)) { in fit_image_verify()
1299 err_msg, fit_get_name(fit, noffset, NULL), in fit_image_verify()
1300 fit_get_name(fit, image_noffset, NULL)); in fit_image_verify()
1304 return fit_image_verify_with_data(fit, image_noffset, data, size); in fit_image_verify()
1318 int fit_all_image_verify(const void *fit) in fit_all_image_verify() argument
1326 images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); in fit_all_image_verify()
1335 (ulong)fit); in fit_all_image_verify()
1337 noffset = fdt_next_node(fit, images_noffset, &ndepth); in fit_all_image_verify()
1339 noffset = fdt_next_node(fit, noffset, &ndepth)) { in fit_all_image_verify()
1346 fit_get_name(fit, noffset, NULL)); in fit_all_image_verify()
1349 if (!fit_image_verify(fit, noffset)) in fit_all_image_verify()
1370 int fit_image_check_os(const void *fit, int noffset, uint8_t os) in fit_image_check_os() argument
1374 if (fit_image_get_os(fit, noffset, &image_os)) in fit_image_check_os()
1392 int fit_image_check_arch(const void *fit, int noffset, uint8_t arch) in fit_image_check_arch() argument
1401 if (fit_image_get_arch(fit, noffset, &image_arch)) in fit_image_check_arch()
1422 int fit_image_check_type(const void *fit, int noffset, uint8_t type) in fit_image_check_type() argument
1426 if (fit_image_get_type(fit, noffset, &image_type)) in fit_image_check_type()
1445 int fit_image_check_comp(const void *fit, int noffset, uint8_t comp) in fit_image_check_comp() argument
1449 if (fit_image_get_comp(fit, noffset, &image_comp)) in fit_image_check_comp()
1465 int fit_check_format(const void *fit) in fit_check_format() argument
1468 if (fdt_getprop(fit, 0, FIT_DESC_PROP, NULL) == NULL) { in fit_check_format()
1475 if (fdt_getprop(fit, 0, FIT_TIMESTAMP_PROP, NULL) == NULL) { in fit_check_format()
1482 if (fdt_path_offset(fit, FIT_IMAGES_PATH) < 0) { in fit_check_format()
1534 int fit_conf_find_compat(const void *fit, const void *fdt) in fit_conf_find_compat() argument
1543 confs_noffset = fdt_path_offset(fit, FIT_CONFS_PATH); in fit_conf_find_compat()
1544 images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); in fit_conf_find_compat()
1559 for (noffset = fdt_next_node(fit, confs_noffset, &ndepth); in fit_conf_find_compat()
1561 noffset = fdt_next_node(fit, noffset, &ndepth)) { in fit_conf_find_compat()
1574 if (fdt_getprop(fit, noffset, "compatible", NULL)) { in fit_conf_find_compat()
1575 fdt = fit; /* search in FIT image */ in fit_conf_find_compat()
1578 kfdt_name = fdt_getprop(fit, noffset, "fdt", &len); in fit_conf_find_compat()
1583 kfdt_noffset = fdt_subnode_offset(fit, images_noffset, in fit_conf_find_compat()
1591 if (!fit_image_check_comp(fit, kfdt_noffset, in fit_conf_find_compat()
1599 if (fit_image_get_data(fit, kfdt_noffset, &fdt, &sz)) { in fit_conf_find_compat()
1653 int fit_conf_get_node(const void *fit, const char *conf_uname) in fit_conf_get_node() argument
1660 confs_noffset = fdt_path_offset(fit, FIT_CONFS_PATH); in fit_conf_get_node()
1670 conf_uname = (char *)fdt_getprop(fit, confs_noffset, in fit_conf_get_node()
1673 fit_get_debug(fit, confs_noffset, FIT_DEFAULT_PROP, in fit_conf_get_node()
1694 noffset = fdt_subnode_offset(fit, confs_noffset, conf_uname); in fit_conf_get_node()
1706 int fit_conf_get_prop_node_count(const void *fit, int noffset, in fit_conf_get_prop_node_count() argument
1709 return fdt_stringlist_count(fit, noffset, prop_name); in fit_conf_get_prop_node_count()
1712 int fit_conf_get_prop_node_index(const void *fit, int noffset, in fit_conf_get_prop_node_index() argument
1719 uname = fdt_stringlist_get(fit, noffset, prop_name, index, &len); in fit_conf_get_prop_node_index()
1723 return fit_image_get_node(fit, uname); in fit_conf_get_prop_node_index()
1726 int fit_conf_get_prop_node(const void *fit, int noffset, in fit_conf_get_prop_node() argument
1729 return fit_conf_get_prop_node_index(fit, noffset, prop_name, 0); in fit_conf_get_prop_node()
1732 static int fit_image_select(const void *fit, int rd_noffset, int verify) in fit_image_select() argument
1734 fit_image_print(fit, rd_noffset, " "); in fit_image_select()
1738 if (!fit_image_verify(fit, rd_noffset)) { in fit_image_select()
1817 const void *fit; in fit_image_load() local
1830 fit = map_sysmem(addr, 0); in fit_image_load()
1838 if (!fit_check_format(fit)) { in fit_image_load()
1847 noffset = fit_image_get_node(fit, fit_uname); in fit_image_load()
1856 cfg_noffset = fit_conf_find_compat(fit, gd_fdt_blob()); in fit_image_load()
1858 cfg_noffset = fit_conf_get_node(fit, in fit_image_load()
1868 fit_base_uname_config = fdt_get_name(fit, cfg_noffset, NULL); in fit_image_load()
1876 if (fit_config_verify(fit, cfg_noffset)) { in fit_image_load()
1887 noffset = fit_conf_get_prop_node(fit, cfg_noffset, in fit_image_load()
1889 fit_uname = fit_get_name(fit, noffset, NULL); in fit_image_load()
1899 ret = fit_image_select(fit, noffset, images->verify); in fit_image_load()
1907 if (!fit_image_check_target_arch(fit, noffset)) { in fit_image_load()
1915 fit_image_get_arch(fit, noffset, &os_arch); in fit_image_load()
1920 type_ok = fit_image_check_type(fit, noffset, image_type) || in fit_image_load()
1921 fit_image_check_type(fit, noffset, IH_TYPE_FIRMWARE) || in fit_image_load()
1923 fit_image_check_type(fit, noffset, IH_TYPE_KERNEL_NOLOAD)); in fit_image_load()
1927 fit_image_check_os(fit, noffset, IH_OS_LINUX) || in fit_image_load()
1928 fit_image_check_os(fit, noffset, IH_OS_U_BOOT) || in fit_image_load()
1929 fit_image_check_os(fit, noffset, IH_OS_OPENRTOS); in fit_image_load()
1937 fit_image_get_os(fit, noffset, &os); in fit_image_load()
1949 if (fit_image_get_data_and_size(fit, noffset, in fit_image_load()
1969 } else if (fit_image_get_load(fit, noffset, &load)) { in fit_image_load()
1984 image_end = addr + fit_get_size(fit); in fit_image_load()
2002 if (!fit_image_get_comp(fit, noffset, &comp) && in fit_image_load()
2075 const void *fit; in boot_get_fdt_fit() local
2117 fit = map_sysmem(addr, 0); in boot_get_fdt_fit()
2119 cfg_noffset = fit_conf_get_node(fit, fit_uname_config); in boot_get_fdt_fit()
2122 count = fit_conf_get_prop_node_count(fit, cfg_noffset, FIT_FDT_PROP); in boot_get_fdt_fit()
2130 image_end = addr + fit_get_size(fit); in boot_get_fdt_fit()
2144 noffset = fit_conf_get_prop_node_index(fit, cfg_noffset, in boot_get_fdt_fit()
2146 uname = fit_get_name(fit, noffset, NULL); in boot_get_fdt_fit()
2163 cfg_noffset = fit_conf_get_node(fit, uconfig); in boot_get_fdt_fit()
2166 count = fit_conf_get_prop_node_count(fit, cfg_noffset, in boot_get_fdt_fit()