[U-Boot] ENV_IS_EMBEDDED vs CONFIG_ENV_IS_EMBEDDED

Mike Frysinger vapier at gentoo.org
Fri Jun 19 11:48:37 CEST 2009


On Monday 15 June 2009 05:02:42 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > is there a reason to keep ENV_IS_EMBEDDED around ?  i see a few places
> > that use CONFIG_ENV_IS_EMBEDDED, but it seems to be largely useless at
> > the moment as the define doesn't really do anything without
> > ENV_IS_EMBEDDED.
>
> I'm not sure where CONFIG_ENV_IS_EMBEDDED (resp. CFG_ENV_IS_EMBEDDED)
> coming from. I guess from some comments ("short-cut compile-time
> test") that it was intended to enable using something like
>
> 	COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
>
> Unfortunately it was not even documented in the README so we can only
> guess what it is supposed to mean  :-(  From  original  the  software
> design  point  of  view, CONFIG_ENV_IS_EMBEDDED is redundant at best,
> and usally just bogus, as the  actual  location  of  the  environment
> sectors   (as  determined  by  CONFIG_ENV_OFFSET  or  CONFIG_ENV_ADDR
> combined with CONFIG_ENV_SECT_SIZE, plus eventually the definition of
> the corresponding "*_REDUND" settings) automatically determine if the
> environment is embedded or  not  -  there  is  no  need  for  such  a
> variable.

i would actually prefer CONFIG_ENV_IS_EMBEDDED.  otherwise we have to write 
the makefiles to account for all CONFIG_ENV_IS_IN_XXX variants.  you can see 
the common/Makefile and tools/Makefile already suffer from this, and the 
recent patch i had to post to add missing config lines for some env sources.

so it would make life easier if these things bubbled up into just one config 
value -- easier for existing maintenance and easier for people adding new 
environment sources (like the newly added "mgdisk", whatever that is).

> > in other words, i'd like to just do a sed on the tree to convert all
> > ENV_IS_EMBEDDED instances to CONFIG_ENV_IS_EMBEDDED.
>
> That whould IMHO be wrong. We should rather check if there was a way
> to get rid of CONFIG_ENV_IS_EMBEDDED (which is probably hard because
> of it's use in the Makefile).

well, is there a downside from moving from ENV_IS_EMBEDDED to 
CONFIG_ENV_IS_EMBEDDED ?  we could at least make sure it is kept in sync in 
common headers by doing something like:
#if defined(CONFIG_ENV_IS_EMBEDDED) && !defined(ENV_IS_EMBEDDED)
# error you should not define CONFIG_ENV_IS_EMBEDDED yourself
#endif
#ifdef ENV_IS_EMBEDDED
# define CONFIG_ENV_IS_EMBEDDED
#endif
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090619/474ade8c/attachment.pgp 


More information about the U-Boot mailing list