mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
bootcount: Use predefined count/magic bit masks
Use predefined bit masks in operations where only the magic half or only the count half of the 32-bit value are processed. Signed-off-by: Niko Mauno <niko.mauno@vaisala.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <env.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#ifdef CONFIG_DM_BOOTCOUNT
|
||||
|
||||
@@ -59,6 +60,10 @@ int dm_bootcount_set(struct udevice *dev, u32 bootcount);
|
||||
|
||||
#endif
|
||||
|
||||
/* Bit masks for magic and count parts in single word scheme */
|
||||
#define BOOTCOUNT_MAGIC_MASK GENMASK(31, 16)
|
||||
#define BOOTCOUNT_COUNT_MASK GENMASK(15, 0)
|
||||
|
||||
/** bootcount_store() - store the current bootcount */
|
||||
void bootcount_store(ulong);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user