From 27e1924ffaa9361542d4cf75a9b73613fa45d007 Mon Sep 17 00:00:00 2001 From: Niko Mauno Date: Wed, 4 Feb 2026 15:17:35 +0200 Subject: 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 Reviewed-by: Tom Rini --- include/bootcount.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/bootcount.h b/include/bootcount.h index 847c0f02d98..86474569d36 100644 --- a/include/bootcount.h +++ b/include/bootcount.h @@ -10,6 +10,7 @@ #include #include #include +#include #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); -- cgit v1.2.3