summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/include/arm/arch/io.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/payloads/libpayload/include/arm/arch/io.h b/payloads/libpayload/include/arm/arch/io.h
index 8948e133ef..5cb66dcd69 100644
--- a/payloads/libpayload/include/arm/arch/io.h
+++ b/payloads/libpayload/include/arm/arch/io.h
@@ -73,4 +73,17 @@ static inline void writel(uint32_t _v, volatile void *_a)
dmb();
}
+/*
+ * Handy bit manipulation macros, BE version will have to be added when/if
+ * needed.
+ */
+
+#ifdef CONFIG_LP_LITTLE_ENDIAN
+#define clrsetbits_le32(addr, clear, set) writel((readl(addr) & ~(clear)) |\
+ (set), (addr))
+#define setbits_le32(addr, set) writel(readl(addr) | (set), (addr))
+#define clrbits_le32(addr, clear) writel(readl(addr) & ~(clear), (addr))
#endif
+
+#endif
+