From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 17 Nov 2015 12:33:47 -0600 Subject: [U-Boot] how to load u-boot environment from nand while spl is loading In-Reply-To: <201511111638.22946.marex@denx.de> References: <56435EDE.9070807@aethra.com> <201511111638.22946.marex@denx.de> Message-ID: <1447785227.27264.20.camel@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 On Wed, 2015-11-11 at 16:38 +0100, Marek Vasut wrote: > On Wednesday, November 11, 2015 at 04:29:34 PM, Francesco Lucconi wrote: > > Hi, > > > I'm working with imx28evk reference board with u-boot 2011.12 and for my > > specific purposes I have to load u-boot nand environment during spl > > binary is loading. I'm working with a static environment but this is not > > so useful because I need to initialize some drivers (such as serial > > console) with the current values stored within nand flash environment > > (such as baudrate variable). > > Comparing my u-boot version with more recent ones (u-boot 2015.10) I've > > found out that the enviroment loading has been applied during ram > > bootstrapping...can't we do this operation before u-boot.bin has been > > loaded in ddr memory? > > Could you send me any tips to solve this issue? > > I think that the latest mainline already configures the serial console from > the environment or at least it sets up the environment to be complete enough > for getenv() to work. I'd suggest you give that a spin. getenv() will work but that doesn't answer the question of which environment it's accessing. Typically in NAND SPL it will access a hard-coded default environment, with the on-flash environment only being accessed from the main U -Boot. If CONFIG_NAND_ENV_DST is used, the SPL can load the real environment, but there are no longer any boards that use CONFIG_NAND_ENV_DST (smdk6400 did but it was removed due to lack of maintenance). -Scott