From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frans Meulenbroeks Date: Sun, 11 Jan 2009 05:26:12 -0800 (PST) Subject: [U-Boot] NAND bad environment block handling In-Reply-To: <1231672254.3130.29.camel@mobil.alm.archives.at> Message-ID: <382183.1535.qm@web33608.mail.mud.yahoo.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Manfred, Thanks for your suggestions. Did you modify u-boot to search from the last block of the device backwards? I feel putting the env at the end is quite a good idea. Unfortunately in our system we need to modify the env at runtime. For software upgrade we aim to go for a ping pong strategy (so having two kernels and two rfs-es in flash, and upgrade the non active kernel, then modify u-boot env so the next time we boot from the upgraded kernel). Unless of course there is a better strategy for this. Best regards, Frans. --- On Sun, 1/11/09, Schlaegl Manfred jun. wrote: > From: Schlaegl Manfred jun. > Subject: Re: [U-Boot] NAND bad environment block handling > To: fransmeulenbroeks at yahoo.com > Cc: u-boot at lists.denx.de > Date: Sunday, January 11, 2009, 12:10 PM > Hi! > Am Donnerstag, den 08.01.2009, 07:19 -0800 schrieb Frans > Meulenbroeks: > > > > Has someone experience in this area? Ideas? > Suggestions? > > 1. For our systems we assume, that the env-block never gets > bad in > productive use, because the env-block is never written > again. So we > reduced the problem to number of initial/factory bad > blocks. > 2. the partitioning and environment-saving is done at > production-time. > 3. we put the environment in the last good block of the > device. The > search starts at the end of device and ends at the last > block of the > last data-partition with an error. > > > Example-Partition-Table on an 32MB-NAND, with blocksize > 16kb and max. 45 > factory bad-blocks: > * the part-size means the possible data size (without > bad-blocks). > * the real partition-size on device depends on the > bad-blocks in this > the partition and is calculated automatically at > production-time > (partition generation). > > part-size partition > 200kb: uboot > 1000kb: kernel > 15000kb: rootfs > 15832kb: datafs > rest of device: rest (maximal 45*16kb (max bad blocks) + > 16bk (envblock) > = 736kb > > with an increasing number of initial/factory bad-blocks the > rest-partition shrinks. So the env-block can be written on > any > nand-device without less than 45 (initial/factory) > bad-blocks. > > > > > > Thanks alot! > > Frans Meulenbroeks > > > > - Manfred