public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] CONFIG_DELAY_ENVIRONMENT usage
@ 2013-01-30  3:05 Allen Martin
  2013-01-30  6:08 ` Lucas Stach
  0 siblings, 1 reply; 3+ messages in thread
From: Allen Martin @ 2013-01-30  3:05 UTC (permalink / raw)
  To: u-boot

Simon, I had a question about your CONFIG_DELAY_ENVIRONMENT patch.  In
the commit description it says:

    When CONFIG_DELAY_ENVIRONMENT is defined, it is convenient to have a
    run-time way of enabling loading of the environment. Add this to the
    fdt as /config/delay-environment.

In the code, it's actually reading /config/load-environment, and it
defaults to prevent loading environment regardless if
CONFIG_DELAY_ENVIRONMENT is set or not:

static int should_load_env(void)
{
#ifdef CONFIG_OF_CONTROL
       return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 0);
#elif defined CONFIG_DELAY_ENVIRONMENT
       return 0;
#else
       return 1;
#endif
}


The problem I'm seeing is that this regressed environment loading on
all boards that use fdt, because none of them have
/config/load-environment defined.  If I read the commit message
correctly, I think the actual intention is:

static int should_load_env(void)
{
#ifdef CONFIG_DELAY_ENVIRONMENT
#ifdef CONFIG_OF_CONTROL
        return fdtdec_get_config_int(gd->fdt_blob, "load-environment",
	0);
#else
        return 0;
#endif
#else
        return 1;
#endif
}


Is my understanding correct?

-Allen
-- 
nvpublic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] CONFIG_DELAY_ENVIRONMENT usage
  2013-01-30  3:05 [U-Boot] CONFIG_DELAY_ENVIRONMENT usage Allen Martin
@ 2013-01-30  6:08 ` Lucas Stach
  2013-01-30 17:37   ` Allen Martin
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas Stach @ 2013-01-30  6:08 UTC (permalink / raw)
  To: u-boot

Hi Allen,

Am Dienstag, den 29.01.2013, 19:05 -0800 schrieb Allen Martin:

> The problem I'm seeing is that this regressed environment loading on
> all boards that use fdt, because none of them have
> /config/load-environment defined.  If I read the commit message
> correctly, I think the actual intention is:
> 
> static int should_load_env(void)
> {
> #ifdef CONFIG_DELAY_ENVIRONMENT
> #ifdef CONFIG_OF_CONTROL
>         return fdtdec_get_config_int(gd->fdt_blob, "load-environment",
> 	0);
> #else
>         return 0;
> #endif
> #else
>         return 1;
> #endif
> }
> 
There is already a patch for that on the mailing list. See
http://www.mail-archive.com/u-boot at lists.denx.de/msg103841.html

We agreed that just swapping around the default value for the FDT case
is the right thing to do.

Regards,
Lucas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] CONFIG_DELAY_ENVIRONMENT usage
  2013-01-30  6:08 ` Lucas Stach
@ 2013-01-30 17:37   ` Allen Martin
  0 siblings, 0 replies; 3+ messages in thread
From: Allen Martin @ 2013-01-30 17:37 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 29, 2013 at 10:08:39PM -0800, Lucas Stach wrote:
> Hi Allen,
> 
> Am Dienstag, den 29.01.2013, 19:05 -0800 schrieb Allen Martin:
> 
> > The problem I'm seeing is that this regressed environment loading on
> > all boards that use fdt, because none of them have
> > /config/load-environment defined.  If I read the commit message
> > correctly, I think the actual intention is:
> > 
> > static int should_load_env(void)
> > {
> > #ifdef CONFIG_DELAY_ENVIRONMENT
> > #ifdef CONFIG_OF_CONTROL
> >         return fdtdec_get_config_int(gd->fdt_blob, "load-environment",
> > 	0);
> > #else
> >         return 0;
> > #endif
> > #else
> >         return 1;
> > #endif
> > }
> > 
> There is already a patch for that on the mailing list. See
> http://www.mail-archive.com/u-boot at lists.denx.de/msg103841.html
> 
> We agreed that just swapping around the default value for the FDT case
> is the right thing to do.

Thanks for the pointer Lucas, I didn't notice the previous patch.

-Allen
-- 
nvpublic

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-30 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30  3:05 [U-Boot] CONFIG_DELAY_ENVIRONMENT usage Allen Martin
2013-01-30  6:08 ` Lucas Stach
2013-01-30 17:37   ` Allen Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox