From: Scott Wood Date: Tue, 8 Apr 2014 18:00:04 -0500 Subject: [U-Boot] [PATCH 5/10] common/env: Point default environment for GD In-Reply-To: <53424855.3070705@freescale.com> References: <1396260268-2615-1-git-send-email-prabhakar@freescale.com> <1396389865.32034.22.camel@snotra.buserror.net> <533B8723.9030206@freescale.com> <1396655479.32034.133.camel@snotra.buserror.net> <53424855.3070705@freescale.com> Message-ID: <1396998004.32034.316.camel@snotra.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 2014-04-07 at 12:10 +0530, Prabhakar Kushwaha wrote: > On 4/5/2014 5:21 AM, Scott Wood wrote: > > That doesn't really answer my question of how it gets initialized for > > NOR flash. What line in what file does the initialization? It looks > > like the answer is env_init() -- so it doesn't "always" hold the > > address. Why can't env_init() do this on NAND, SPI, etc, provided you > > actually have the environment available before relocation[1]? > > > > I'm also not sure what it has to do with SPL as opposed to non-XIP. > > Doesn't this also apply for non-SPL PBL boot, etc? Why wouldn't you do > > this in env_relocate_spec()? > > > > BTW, I notice a few Freescale boards initialize this in their spl.c > > file. > > > > Also, you don't mention what the actual bug is you see. What uses > > gd->env_addr after relocation, other than api/? I'm not saying that > > api/ isn't important, but I'm wondering if you saw an effect elsewhere. > > > > -Scott > > > > [1] I realize that in many cases we don't, but that's something we need > > to fix, since it's important to how DDR gets set up among other things. > > > > I analyzed further with P5020_NAND boot. i found following observation: > 1. env_init happens in board_init_f > 2. DDR always initialized with default_environment > 3. env_relocate happens in board_init_r > > Looks like, during non-XIP & non - SPL boot, ddr can only be initialized > with fixed settings. > is it a accepted behavior? if Yes, DDR init parameters cannot be changed > like ECC on/off. It is the current behavior on many boards, but it needs to be fixed (as I noted above). -Scott