From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Wed, 23 May 2007 12:48:05 -0500 Subject: [U-Boot-Users] [PATCH] fix compilation problem for mpc8349itx CFG_RAMBOOT In-Reply-To: <200705231245.24522@sercond.localdomain> References: <200705231245.24522@sercond.localdomain> Message-ID: <46547E55.3020608@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Nikita V. Youshchenko wrote: > Current include/configs/MPC8349ITX.h does contain some support for building > image that will be started from memory (without putting in into flash). > It could be triggered by building with TEXT_BASE set to a low value. > > However, this support is incomplete: using of low TEXT_BASE causes > defining configuration macros in inconsistent way, which later leads > to compilation errors. In particular. flash support is being disabled, > but then flash structures get referenced. > > This patch fixes this, making it possible to build with low TEXT_BASE. > > Signed-Off-By: Nikita Youshchenko > > --- a/include/configs/MPC8349ITX.h > +++ b/include/configs/MPC8349ITX.h > @@ -408,6 +409,7 @@ boards, we say we have two, but don't di > #define CFG_ENV_SIZE 0x2000 > #else > #define CFG_NO_FLASH /* Flash is not usable now */ > + #undef CFG_FLASH_CFI_DRIVER I'm not crazy about this. Basically, we define CFG_FLASH_CFI_DRIVER (and a bunch of other flash stuff) at the top of the file, and then here we undefine only one of those macros to get the code to compile. The better approach would be to move this code to the top, and define CFG_FLASH_CFI_DRIVER only if CFG_NO_FLASH is not defined. > -#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \ > +#ifdef CFG_NO_FLASH > +#define CONFIG_COMMANDS_DEFAULT (CONFIG_CMD_DFL & ~(CFG_CMD_FLASH | \ > + CFG_CMD_IMLS)) > +#else > +#define CONFIG_COMMANDS_DEFAULT CONFIG_CMD_DFL > +#endif > + > +#define CONFIG_COMMANDS (CONFIG_COMMANDS_DEFAULT | \ > CONFIG_COMMANDS_CF | \ > CFG_CMD_NET | \ > CFG_CMD_PING | \ How about this approach instead: #ifdef CFG_NO_FLASH #define CONFIG_COMMANDS_FLASH ~(CFG_CMD_FLASH | CFG_CMD_IMLS) #else #define CONFIG_COMMANDS_FLASH ~0 #endif #define CONFIG_COMMANDS (CONFIG_CMD_DFL | \ CONFIG_COMMANDS_CF | \ CFG_CMD_NET | \ CFG_CMD_PING | \ CONFIG_COMMANDS_I2C | \ CONFIG_COMMANDS_PCI | \ CFG_CMD_SDRAM | \ CFG_CMD_DATE | \ CFG_CMD_CACHE | \ CFG_CMD_IRQ) & \ CONFIG_COMMANDS_FLASH -- Timur Tabi Linux Kernel Developer @ Freescale