From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus =?utf-8?Q?Klotzb=C3=BCcher?= Date: Sun, 06 Apr 2008 19:37:32 +0200 Subject: [U-Boot-Users] make env In-Reply-To: <47F36B7A.9080104@feig.de> (Manuel Sahm's message of "Wed\, 02 Apr 2008 13\:18\:18 +0200") References: <20080402103950.98436243AB@gemini.denx.de> <47F36B7A.9080104@feig.de> Message-ID: <87od8mvq8z.fsf@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Manuel Sahm writes: > how does uboot handle this flag byte ? (i I use redundant nand) As you can't invalidate the old NAND environment as you can with NOR flash, counters are used instead. So for NAND, the flag byte is a counter which gets incremented for each write. This means the environment with the flag containing the larger value is the valid one, except for the case when the counter overflows and the valid environment flag holds the value 0 and the former one 255. Actually it would make sense to use this technique for NOR flash identically, as it would avoid one write access to the flash. Check out common/env_nand.c for details. Best regards Markus Klotzbuecher -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de