Re: [U-Boot-Users] [PATCH]env_nand.c Added bad block management for environment variables

2008-06-02 Thread Scott Wood
On Fri, May 30, 2008 at 04:05:28PM -0400, Stuart Wood wrote: Scott, I this this one is it, and thnaks for pointing out the nand_erase_opts() function. Stuart --- Modified to check for bad blocks and to skipping over them when CFG_ENV_RANGE has been defined. CFG_ENV_RANGE must be larger

Re: [U-Boot-Users] [PATCH]env_nand.c Added bad block management for environment variables

2008-05-30 Thread Stuart Wood
Scott, I this this one is it, and thnaks for pointing out the nand_erase_opts() function. Stuart --- Modified to check for bad blocks and to skipping over them when CFG_ENV_RANGE has been defined. CFG_ENV_RANGE must be larger than CFG_ENV_SIZE and aligned to the NAND flash block size. signed

Re: [U-Boot-Users] [PATCH]env_nand.c Added bad block management for environment variables

2008-05-29 Thread Stuart Wood
Scott, Here is a new version of my patch to env_nand.c. Thanks for the good comments. Fixed a problem with the new code that allowed it to read a environment area even if it contained a bad block after the good environment data. diff --git a/common/env_nand.c b/common/env_nand.c index

Re: [U-Boot-Users] [PATCH]env_nand.c Added bad block management for environment variables

2008-05-29 Thread Scott Wood
Scott Wood wrote: +size_t end; +int ret_val = 0; +end = offset + CFG_ENV_SIZE; + +for (; offset end; offset += nand_info[0].erasesize) { +if (nand_block_isbad(nand_info[0],offset)) +ret_val = 1; +} + +return ret_val; size_t end

Re: [U-Boot-Users] [PATCH]env_nand.c Added bad block management for environment variables

2008-05-28 Thread Scott Wood
On Tue, May 27, 2008 at 10:01:14AM -0400, Stuart Wood wrote: Hi All, This is my first attempt at submitting a change so please be patient and kind. This change allows for the environment variables to be stored in a rand of nand flash. If the first block is bad then the environment is stored in