From: Marcel Ziswiler Date: Fri, 30 Sep 2016 11:44:33 +0000 Subject: [U-Boot] [PATCH v2 5/6] apalis/colibri_t30: move environment location In-Reply-To: <3b964c7d-2767-2297-c4b9-2ec2fdc10b32@wwwdotorg.org> References: <1475055308-24080-1-git-send-email-marcel.ziswiler@toradex.com> <1475055308-24080-6-git-send-email-marcel.ziswiler@toradex.com> <3b964c7d-2767-2297-c4b9-2ec2fdc10b32@wwwdotorg.org> Message-ID: <1475235873.3788.20.camel@toradex.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, 2016-09-28 at 12:11 -0600, Stephen Warren wrote: > On 09/28/2016 03:35 AM, Marcel Ziswiler wrote: > > > > Now with the config block handling in place move the U-Boot > > environment > > location before the config block at the end of 1st "boot sector" as > > deployed during production using our downstream BSP. > > > > diff --git a/include/configs/apalis_t30.h > > b/include/configs/apalis_t30.h > > > > -/* Environment in eMMC, at the end of 2nd "boot sector" */ > > +/* Environment in eMMC, before config block at the end of 1st > > "boot sector" */ > > ?#define CONFIG_ENV_IS_IN_MMC > > -#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE) > > +#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \ > > + ?CONFIG_TDX_CFG_BLOCK_OFFS > > ET) > I'm not convinced that ENV_OFFSET actually points where the > description? > says it does. (-CONFIG_ENV_SIZE + CONFIG_TDX_CFG_BLOCK_OFFSET) is (- > 8192? > + -512). The original comment states that an ENV_OFFSET of -8192 > locates? > the environment at the end of a sector, so shifting it 512 bytes > earlier? > in the flash can't possible now align it with a different sector? Why not? > Should? > ENV_OFFSET be shifted down by a whole sector size by this patch, > i.e.? > should +CONFIG_TXT_CFG_BLOCK_OFFSET be rounded up to a sector size > to? > match the comment? Yes, a block, sector or whatever you wana call it is actually 512 bytes in size on all eMMCs or even MMC/SD cards that I have seen so far. I guess while it would be kind of nice having this enforced to some intrinsic size in software ultimately this is a board configuration option concerning our Toradex factory configuration block as programmed during production. We just want to make sure that one is preserved and the environment is stored right before.