[U-Boot] nand spl build with wrong CONFIG_SYS_TEXT_BASE

Wolfgang Denk wd at denx.de
Tue Nov 9 00:36:26 CET 2010


Dear Haiying Wang,

In message <1289240747.1900.58.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

Yes. But there is also MPC8536DS and MPC8536DS_36BIT and
MPC8536DS_SDCARD and MPC8536DS_SPIFLASH which do NOT define
CONFIG_NAND, but they too need a definition of CONFIG_SYS_TEXT_BASE.

> > 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.

You did not answer my question. The error message shows _where_ the
previous definition came from. Please check this.

> I think the previous uboot(before your commit to change CONFIG_MK to
> CONFIG_), CONFIG_MK_NAND was used for NAND_booting board configuration,

Correct.

> 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. 

Right. Why would we need two different defines for the same thing?

> > 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. 

Sorry, but this makes no sense. If the code looks as above, there is
always at most one define of CONFIG_SYS_TEXT_BASE in the board config
file (actually it's missing for boards that don't define CONFIG_NAND).

> 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.

It seems your actual code looks different from what you showed us
above.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In Nature there are neither rewards nor punishments, there are conse-
quences.                                            -- R.G. Ingersoll


More information about the U-Boot mailing list