From: Wolfgang Denk Date: Tue, 09 Nov 2010 22:11:41 +0100 Subject: [U-Boot] nand spl build with wrong CONFIG_SYS_TEXT_BASE In-Reply-To: <20101109143747.685f973f@udp111988uds.am.freescale.net> References: <1288970062.1855.44.camel@haiying-laptop> <20101107213129.CA432220@gemini.denx.de> <1289230710.1900.27.camel@haiying-laptop> <20101108163053.E973613077C4@gemini.denx.de> <1289240747.1900.58.camel@haiying-laptop> <20101108233626.82904D48956@gemini.denx.de> <1289314359.2168.20.camel@haiying-laptop> <20101109162343.31A76D314CE@gemini.denx.de> <20101109102643.45d7f398@udp111988uds.am.freescale.net> <20101109171853.8ADBAD0D220@gemini.denx.de> <20101109122218.13f168dd@udp111988uds.am.freescale.net> <20101109185947.76137EA443@gemini.denx.de> <20101109130427.5e918954@udp111988uds.am.freescale.net> <20101109201300.531344F4@gemini.denx.de> <20101109143747.685f973f@udp111988uds.am.freescale.net> Message-ID: <20101109211141.D9A2D4F4@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Scott Wood, In message <20101109143747.685f973f@udp111988uds.am.freescale.net> you wrote: > > I don't see how > > #ifdef NAND_SPL > #define CONFIG_SYS_TEXT_BASE xxx > #else > #define CONFIG_SYS_TEXT_BASE yyy > #endif > > is more of a maintenance problem than > > #define CONFIG_SYS_TEXT_BASE_SPL xxx > #define CONFIG_SYS_TEXT_BASE yyy > > followed by multiple instances of > > #ifdef NAND_SPL > do something with CONFIG_SYS_TEXT_BASE_SPL > #else > do something with CONFIG_SYS_TEXT_BASE > #endif Assuming that your code really needs to know the start address of the image, it should probably do something like this instead: #ifdef NAND_SPL #define CONFIG_SYS_TEXT_BASE xxx #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #else #define CONFIG_SYS_TEXT_BASE yyy #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #endif followed by multiple instances of do something with CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE is a symbos primarily intended for the linker call, i. e. for Makefile context. This is a pretty special situation, that does not apply to "normal" CONFIG_* settings. > And as I've pointed out, this gets to be an even bigger mess with > larger SPLs that want to pull in bigger chunks of U-Boot based on > CONFIG_ symbols. Are we going to have to create an SPL version of each > of them, too? And a third version of each symbol, for a three-stage > boot? I don't see why that should be the case? AFAICT so far CONFIG_SYS_TEXT_BASE is one of a very small number of highly special variable definitions that need to be exported to the Makefile context. > Are you going to insist that we rip out all the other CONFIG_ symbols > that are conditional on NAND_SPL (but happen to not be referred to in > makefiles -- is that really the meaningful semantic difference here)? > CONFIG_SYS_HRCW_HIGH versus CONFIG_SYS_HRCW_HIGH_SPL? > CONFIG_DEFAULT_IMMR versus CONFIG_DEFAULT_IMMR_SPL? Why should I? None of these are needed anywhere in the Makefiles, are they? > Should we replace CONFIG_NS16550_MIN_FUNCTIONS with directly ifdeffing > NAND_SPL in the serial code? I think you misinterpret the situation. > It is the same purpose. The problem is treating separate, only > somewhat related image builds as being the same build and requiring > that they have the same config. They have separate makefiles, separate > linker scripts, separate everything except some shared code... and > autoconf.mk. Just because we got away with it until now does not make > it the right thing to do. Right - "separate makefiles, separate linker scripts, separate everything" _and_ separate text base addresses. 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 "I didn't know it was impossible when I did it."