[U-Boot] nand spl build with wrong CONFIG_SYS_TEXT_BASE

Haiying Wang Haiying.Wang at freescale.com
Mon Nov 8 19:25:47 CET 2010


On Mon, 2010-11-08 at 09:30 -0700, Wolfgang Denk wrote:
> Dear Haiying Wang,
> 
> In message <1289230710.1900.27.camel at haiying-laptop> you wrote:
> >
> > Before sending last email, I modified the CONFIG_SYS_TEXT_BASE in
> 8536DS
> > header file like this:
> >       #ifdef CONFIG_NAND
> >       #ifdef CONFIG_NAND_SPL
> >       #define CONFIG_SYS_TEXT_BASE 0xfff00000
> >       #else
> >       #define CONFIG_SYS_TEXT_BASE 0xf8f82000
> >       #endif
> >       #endif
> 
> This looks broken to me. If you have CONFIG_NAND not defined you have
> no CONFIG_SYS_TEXT_BASE definition at all.
Why it looks broken? I do need CONFIG_NAND defined for 8536DS nand
build. For building nand uboot, 2 images are needed, one is 4K nand_spl
which should have CONFIG_SYS_TEXT_BASE at 0xfff00000, the other is the
final uboot image which has CONFIG_SYS_TEXT_BASE at 0xf8f82000. Both
CONFIG_SYS_TEXT_BASE are now under the define of CONFIG_NAND.


> > but still get 0xf8f82000 for NAND SPL image, which should have
> > 0xfff00000 as its CONFIG_SYS_TEXT_BASE. And build log showed me
> > "warning: "CONFIG_SYS_TEXT_BASE" redefined"
> 
> Well, I guess it also showed where the previous definition came from?
Yes, it showed the first definition of CONFIG_SYS_TEXT_BASE in my
example code which is 0xfff00000 in MPC8536DS.h was redefined. But in
fact, I need that value instead of 0xf8f82000 for nand spl.

> > In fact, your change above seems no meaning for NAND _SPL because
> > NAND_SPL also has CONFIG_NAND defined.
> 
> Well, then your bord entry in boards.cfg makes no sense. The
> NAND-booting board configurations auto-define "CONFIG_NAND". If this
> is not what you want then please feel free to change it.
Yes, 8356DS's board entry in boards.cfg does make sense. It has
CONFIG_NAND defined for MPC8536DS_NAND_config. Again, CONFIG_NAND means
two stage uboot image needs to be generated, each of them has different
CONFIG_SYS_TEXT_BASE. 

I think the previous uboot(before your commit to change CONFIG_MK to
CONFIG_), CONFIG_MK_NAND was used for NAND_booting board configuration,
CONFIG_NAND was used for the final uboot image, and CONFIG_NAND_SPL was
used for nand_spl image. However, after that commit, the CONFIG_NAND
combined the usage of CONFIG_MK_NAND and CONFIG_NAND. 


> > > Please remove any such defines from Makefiles.
> > You meant the CONFIG_SYS_TEXT_BASE can only be defined in board
> header
> > files? But you change all the TEXT_BASE to CONFIG_SYS_TEXT_BASE in
> the
> > Makefile or config.mk for almost all boards under nand_spl, which I
> > guess you were OK with it.:)
> 
> If there is any such code left, it should be cleaned up.
Yes, there is such code. 

> > I did not understand why old way to define TEXT_BASE in Makefile
> worked
> > but changing it to CONFIG_SYS_TEXT_BASE doesn't work any more. And
> as
> > you pointed out, defining CONFIG_SYS_TEXT_BASE in header file is the
> > right way, but it did not work for nans_spl for now.
> 
> Try to find out where that redefine is coming from, and fix that. And
> fix the ",NAND" flag in boards.cfg if this is not what you want.
The redefine came from the define of CONFIG_SYS_TEXT_BASE for nand_spl. 

In summary, the problem is how the 2 uboot images(nand_spl and final
uboot image) can get different CONFIG_SYS_TEXT_BASE under the "shared"
CONFIG_NAND.

Haiying








More information about the U-Boot mailing list