From: Reinhard Meyer Date: Tue, 14 Sep 2010 03:11:50 +0200 Subject: [U-Boot] [PATCH] ARM: Consolidate bootcount_{store|load} In-Reply-To: <1284406319-9032-1-git-send-email-agust@denx.de> References: <1284406319-9032-1-git-send-email-agust@denx.de> Message-ID: <4C8ECBD6.3060004@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Anatolij Gustschin, > This patch consolidates bootcount_{store|load} for ARM by > implementing a common version in arch/arm/lib/bootcount.c. This > code is now used by all ARM variants that currently have these > functions implemented. > > Also supports two different bootcount versions: > > a) Use 2 separate words (2 * 32bit) to store the bootcounter > b) Use only 1 word (2 * 16bit) to store the bootcounter > > The latter was already used by AT91. More specific: only AT91SAM9260. There are many more AT91 SoCs that might want to use bootcount in the future! The more I think about it, the less sense it makes to move bootcount access to arm/lib: Handling bootcount is very SoC (maybe even board, if the SoC has no nonvolatile storage) and definitely not ARM specific. Moving it from ARM-SoC specific files to a common ARM-lib file will cause many conditional compiles there. The arch/powerpc/lib/bootcount.c is an example how the arm/lib/bootcount.c is going to look like in the long run. Reinhard PS: your bootcount.c misses the GPL header...