[U-Boot] [RFC] FIT: use default configuration, if given configuration is not found

Joe Hershberger joe.hershberger at gmail.com
Mon May 4 20:16:34 CEST 2015


Hi Yegor,

On Mon, May 4, 2015 at 2:53 AM,  <yegorslists at googlemail.com> wrote:
> From: Yegor Yefremov <yegorslists at googlemail.com>
>
> Signed-off-by: Yegor Yefremov <yegorslists at googlemail.com>
> ---
>  common/image-fit.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index c61be65..b892d06 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
>                 } else {
>                         cfg_noffset = fit_conf_get_node(fit,
>                                                         fit_uname_config);
> +
> +                       if (cfg_noffset < 0) {
> +                               cfg_noffset = fit_conf_get_node(fit, NULL);
> +                       }

It seems if you ask for a specific configuration that is not
available, you should get an error.

You can accomplish similar behavior you are implementing here by using
the shell to try the default if the specified one returns an error.

>                 }
>                 if (cfg_noffset < 0) {
>                         puts("Could not find configuration node\n");

Cheers,
-Joe


More information about the U-Boot mailing list