"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

boot: Allow FIT to fall back from best-match option

When the best-match feature fails to find something, use the provided
config name as a fallback. The allows SPL to select a suitable config
when best-match is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>

authored by

Simon Glass and committed by
Tom Rini
771f0e98 9922227a

+13 -10
+10 -9
boot/image-fit.c
··· 1729 1729 images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); 1730 1730 if (confs_noffset < 0 || images_noffset < 0) { 1731 1731 debug("Can't find configurations or images nodes.\n"); 1732 - return -1; 1732 + return -EINVAL; 1733 1733 } 1734 1734 1735 1735 fdt_compat = fdt_getprop(fdt, 0, "compatible", &fdt_compat_len); 1736 1736 if (!fdt_compat) { 1737 1737 debug("Fdt for comparison has no \"compatible\" property.\n"); 1738 - return -1; 1738 + return -ENXIO; 1739 1739 } 1740 1740 1741 1741 /* ··· 1812 1812 } 1813 1813 if (!best_match_offset) { 1814 1814 debug("No match found.\n"); 1815 - return -1; 1815 + return -ENOENT; 1816 1816 } 1817 1817 1818 1818 return best_match_offset; ··· 2095 2095 * fit_conf_get_node() will try to find default config node 2096 2096 */ 2097 2097 bootstage_mark(bootstage_id + BOOTSTAGE_SUB_NO_UNIT_NAME); 2098 - if (IS_ENABLED(CONFIG_FIT_BEST_MATCH) && !fit_uname_config) { 2099 - cfg_noffset = fit_conf_find_compat(fit, gd_fdt_blob()); 2100 - } else { 2101 - cfg_noffset = fit_conf_get_node(fit, fit_uname_config); 2102 - } 2103 - if (cfg_noffset < 0) { 2098 + ret = -ENXIO; 2099 + if (IS_ENABLED(CONFIG_FIT_BEST_MATCH) && !fit_uname_config) 2100 + ret = fit_conf_find_compat(fit, gd_fdt_blob()); 2101 + if (ret < 0 && ret != -EINVAL) 2102 + ret = fit_conf_get_node(fit, fit_uname_config); 2103 + if (ret < 0) { 2104 2104 puts("Could not find configuration node\n"); 2105 2105 bootstage_error(bootstage_id + 2106 2106 BOOTSTAGE_SUB_NO_UNIT_NAME); 2107 2107 return -ENOENT; 2108 2108 } 2109 + cfg_noffset = ret; 2109 2110 2110 2111 fit_base_uname_config = fdt_get_name(fit, cfg_noffset, NULL); 2111 2112 printf(" Using '%s' configuration\n", fit_base_uname_config);
+3 -1
include/image.h
··· 1411 1411 * copied into the configuration node in the FIT image. This is required to 1412 1412 * match configurations with compressed FDTs. 1413 1413 * 1414 - * Returns: offset to the configuration to use if one was found, -1 otherwise 1414 + * Returns: offset to the configuration to use if one was found, -EINVAL if 1415 + * there a /configurations or /images node is missing, -ENOENT if no match was 1416 + * found, -ENXIO if the FDT node has no compatible string 1415 1417 */ 1416 1418 int fit_conf_find_compat(const void *fit, const void *fdt); 1417 1419