summaryrefslogtreecommitdiffstats
path: root/common/cmd_bootm.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2012-10-25 16:31:10 +0000
committerGerald Van Baren <gvb@unssw.com>2012-11-12 23:14:57 -0500
commitd95f6ec7334076a1e4b13f3748ebfd1b58ac90f6 (patch)
treeb45f3e30b135e0af09a7005920205fc8470147f7 /common/cmd_bootm.c
parent67e1ea26e89e19a550d86d6408f39d815eedaa7f (diff)
downloadtalos-obmc-uboot-d95f6ec7334076a1e4b13f3748ebfd1b58ac90f6.tar.gz
talos-obmc-uboot-d95f6ec7334076a1e4b13f3748ebfd1b58ac90f6.zip
fdt: Add option to default to most compatible conf in a fit image
When booting a fit image with multiple configurations, the user either has to specify which configuration to use explicitly, or there has to be a default defined which is chosen automatically. This change adds an option to change that behavior so that a configuration can be selected explicitly, or the configuration which has the device tree that claims to be compatible with the earliest item in U-Boot's device tree. In other words, if U-Boot claimed to be compatible with A, B, and then C, and the configurations claimed to be compatible with A, D and B, D and D, E, the first configuration, A, D, would be chosen. Both the first and second configurations match, but the first one matches a more specific entry in U-Boot's device tree. The order in the kernel's device tree is ignored. Signed-off-by: Gabe Black <gabeblack@google.com> Commit-Ready: Gabe Black <gabeblack@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_bootm.c')
-rw-r--r--common/cmd_bootm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index d256ddfaa6..4dbe952bb0 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -949,8 +949,19 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
* node
*/
bootstage_mark(BOOTSTAGE_ID_FIT_NO_UNIT_NAME);
+#ifdef CONFIG_FIT_BEST_MATCH
+ if (fit_uname_config)
+ cfg_noffset =
+ fit_conf_get_node(fit_hdr,
+ fit_uname_config);
+ else
+ cfg_noffset =
+ fit_conf_find_compat(fit_hdr,
+ gd->fdt_blob);
+#else
cfg_noffset = fit_conf_get_node(fit_hdr,
fit_uname_config);
+#endif
if (cfg_noffset < 0) {
bootstage_error(BOOTSTAGE_ID_FIT_NO_UNIT_NAME);
return NULL;
OpenPOWER on IntegriCloud