On Thu, May 16, 2013 at 07:17:50AM +0000, Zhang Ying-B40530 wrote:
[snip]
> Oh, there are some confusion. I thought CONFIG_ENV_IS_xxx defined is> consistent for both SPL and non-SPL.> If you want to set CONFIG_ENV_IS_NOWHERE for SPL and CONFIG_ENV_IS_xxx> somewhere-else for non-SPL, so all of lines CONFIG_ENV_IS_... cann't > be moved to the public area, because CONFIG_ENV_IS_NOWHERE has always> been not effective and CONFIG_ENV_IS_... has been effective in > common/Makefile.> > Unless we define some new symbols that for SPL?
OK, you're right, this is a bit more complex than it looks. Today,
a3m071 relies on SPL always building cmd_nvedit.o and env_common.o and
duplicated CONFIG_ENV_IS_IN_FLASH in the SPL section.
CONFIG_SPL_NET_SUPPORT relies on the same always-built ins and adds
env_nowhere.o which works because the regular CONFIG_ENV_IS_IN_...
section is in the non-SPL-only area.
Part of the answer / problem is, wow, OK, we need to re-sort common/ a
bit:
$ ls common/*.c | wc -l
160
$ ls common/cmd*.c | wc -l
106
$ ls common/env*.c | wc -l
17
Now, your end-goal is to have env from, I assume, NAND, also exist on
SPL? I guess for now, lets go ahead and duplicate a few lines of
ENV_IS.. inside the SPL area and when you add NAND env, add ifneq
($(CONFIG_SPL_NET_SUPPORT),y)...endif around it and add to the README
that CONFIG_SPL_NET_SUPPORT conflicts with SPL env from nand.