From: Mike Frysinger Date: Fri, 24 Jul 2009 16:34:32 -0400 Subject: [U-Boot] ENV_IS_EMBEDDED vs CONFIG_ENV_IS_EMBEDDED In-Reply-To: <20090711074728.18587832E416@gemini.denx.de> References: <200906142240.59607.vapier@gentoo.org> <200907102250.57311.vapier@gentoo.org> <20090711074728.18587832E416@gemini.denx.de> Message-ID: <200907241634.33639.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday 11 July 2009 03:47:28 Wolfgang Denk wrote: > Mike Frysinger wrote: > > > Yes. It's IMHO silly to have to configure something manually (and > > > keep it in sync with potential changes of some other defines) when it > > > is as well possible to have that same value computed automatically at > > > build time. > > > > so i should convert ENV_IS_EMBEDDED to CONFIG_ENV_IS_EMBEDDED or i should > > add to common code logic to force CONFIG_ENV_IS_EMBEDDED when > > ENV_IS_EMBEDDED is defined by the board ? > > If it's possible, generating CONFIG_ENV_IS_EMBEDDED when > ENV_IS_EMBEDDED is defined would be much better - however, my > understanding is that CONFIG_ENV_IS_EMBEDDED is needed by the make > proces,,i. e. before actually running any commands, while > ENV_IS_EMBEDDED gets computed by the C preprocessor, i. e. too late > for make decisions (unless you copy the part of code that computes > ENV_IS_EMBEDDED into some special script / file and run it through > the C preprocessor - which is not exactly a leaner design either, it > seems). well, automating for NOR flash and preventing future bleed is easy to do. but there doesnt seem to be a way for automating for nand and onenand types, so board people would still need to opt-in manually for their boards. how does the attached patch look ? i cant test any of these non-Blackfin boards, but the logic should be straight forward ... i guess part of the problem is that the meaning of ENV_IS_EMBEDDED has changed over time. going by environment.h, it would seem that the original point was that the environment is embedded in the runtime address map (between monitor_base and monitor_base+monitor_len), but it has since changed to mean it is embedded in the u-boot blob as stored in flash. but for eeprom, nand, nvram, and onenand, it means the environment is in a sector that is in the middle of the u-boot image stored in flash. i dont know how you want to document this define, but if you want to revert to the original meaning (embedded at runtime), then i dont think it'll be hard for the other types to convert. after all, this should just be a linker script issue (punch a hole in the map for the environment). -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-unify-CONFIG_-ENV_IS_EMBEDDED.patch Type: text/x-patch Size: 9014 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20090724/ab15eb94/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20090724/ab15eb94/attachment.pgp