The kernel defines setbits32() and clrbits32() macros only for
Power-based architectures. This patch modifies the Freescale CAAM
driver to add macros for use on ARM architectures.
Signed-off-by: Victoria Milhoan <[email protected]>
Signed-off-by: Ruchika Gupta <[email protected]>
---
drivers/crypto/caam/regs.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h
index 7bb898d..16a3d2e 100644
--- a/drivers/crypto/caam/regs.h
+++ b/drivers/crypto/caam/regs.h
@@ -83,6 +83,12 @@
#endif
#endif
+#ifdef CONFIG_ARM
+/* These are common macros for Power, put here for ARMs */
+#define setbits32(_addr, _v) writel((readl(_addr) | (_v)), (_addr))
+#define clrbits32(_addr, _v) writel((readl(_addr) & ~(_v)), (_addr))
+#endif
+
#ifndef CONFIG_64BIT
static inline void wr_reg64(u64 __iomem *reg, u64 data)
{
--
1.8.1.4
On Tue, 29 Apr 2014 15:41:39 +0530
Ruchika Gupta <[email protected]> wrote:
> The kernel defines setbits32() and clrbits32() macros only for
> Power-based architectures. This patch modifies the Freescale CAAM
> driver to add macros for use on ARM architectures.
>
> Signed-off-by: Victoria Milhoan <[email protected]>
> Signed-off-by: Ruchika Gupta <[email protected]>
> ---
Add these macros to arch/arm's io.h instead of duplicating their
definitions in drivers such as caam.
Thanks,
Kim
On Thursday, May 01, 2014 at 10:46:50 PM, Kim Phillips wrote:
> On Tue, 29 Apr 2014 15:41:39 +0530
>
> Ruchika Gupta <[email protected]> wrote:
> > The kernel defines setbits32() and clrbits32() macros only for
> > Power-based architectures. This patch modifies the Freescale CAAM
> > driver to add macros for use on ARM architectures.
> >
> > Signed-off-by: Victoria Milhoan <[email protected]>
> > Signed-off-by: Ruchika Gupta <[email protected]>
> > ---
>
> Add these macros to arch/arm's io.h instead of duplicating their
> definitions in drivers such as caam.
I'd rather see the driver not using such ad-hoc stuff at all. Instead, it should
just implement the r-m-w itself.
Best regards,
Marek Vasut