2014-04-29 10:14:00

by Ruchika Gupta

[permalink] [raw]
Subject: [PATCH] crypto:caam - Define setbits32() and clrbits32() for ARM in the Freescale CAAM driver

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


2014-05-01 20:51:55

by Kim Phillips

[permalink] [raw]
Subject: Re: [PATCH] crypto:caam - Define setbits32() and clrbits32() for ARM in the Freescale CAAM driver

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

2014-05-24 17:51:39

by Marek Vasut

[permalink] [raw]
Subject: Re: [PATCH] crypto:caam - Define setbits32() and clrbits32() for ARM in the Freescale CAAM driver

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