[PATCH] dmaengine: fsldma: Add 64-bit I/O accessors for powerpc64
Peng Ma
peng.ma at nxp.com
Mon Dec 24 14:42:09 AEDT 2018
Hi Scott,
You are right, we should support powerpc64, so could I changed it as fallows:
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h
index 88db939..057babf 100644
--- a/drivers/dma/fsldma.h
+++ b/drivers/dma/fsldma.h
@@ -202,35 +202,10 @@ struct fsldma_chan {
#define fsl_iowrite32(v, p) out_le32(p, v)
#define fsl_iowrite32be(v, p) out_be32(p, v)
-#ifndef __powerpc64__
-static u64 fsl_ioread64(const u64 __iomem *addr)
-{
- u32 fsl_addr = lower_32_bits(addr);
- u64 fsl_addr_hi = (u64)in_le32((u32 *)(fsl_addr + 1)) << 32;
-
- return fsl_addr_hi | in_le32((u32 *)fsl_addr);
-}
-
-static void fsl_iowrite64(u64 val, u64 __iomem *addr)
-{
- out_le32((u32 __iomem *)addr + 1, val >> 32);
- out_le32((u32 __iomem *)addr, (u32)val);
-}
-
-static u64 fsl_ioread64be(const u64 __iomem *addr)
-{
- u32 fsl_addr = lower_32_bits(addr);
- u64 fsl_addr_hi = (u64)in_be32((u32 *)fsl_addr) << 32;
-
- return fsl_addr_hi | in_be32((u32 *)(fsl_addr + 1));
-}
-
-static void fsl_iowrite64be(u64 val, u64 __iomem *addr)
-{
- out_be32((u32 __iomem *)addr, val >> 32);
- out_be32((u32 __iomem *)addr + 1, (u32)val);
-}
-#endif
+#define fsl_ioread64(p) in_le64(p)
+#define fsl_ioread64be(p) in_be64(p)
+#define fsl_iowrite64(v, p) out_le64(p, v)
+#define fsl_iowrite64be(v, p) out_be64(p, v)
#endif
Best Regards,
Peng
>-----Original Message-----
>From: Scott Wood <oss at buserror.net>
>Sent: 2018年12月22日 12:35
>To: Leo Li <leoyang.li at nxp.com>; Zhang Wei <zw at zh-kernel.org>
>Cc: linuxppc-dev at lists.ozlabs.org; dmaengine at vger.kernel.org; Peng Ma
><peng.ma at nxp.com>; Wen He <wen.he_1 at nxp.com>
>Subject: [PATCH] dmaengine: fsldma: Add 64-bit I/O accessors for powerpc64
>
>Otherwise 64-bit PPC builds fail with undefined references to these accessors.
>
>Cc: Peng Ma <peng.ma at nxp.com>
>Cc: Wen He <wen.he_1 at nxp.com>
>Fixes: 68997fff94afa (" dmaengine: fsldma: Adding macro FSL_DMA_IN/OUT
>implement for ARM platform")
>Signed-off-by: Scott Wood <oss at buserror.net>
>---
>Is there any reason why ioreadXXbe() etc can't be used on PPC as well?
>
> drivers/dma/fsldma.h | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h index
>88db939c04a1..a9b12f82b5c3 100644
>--- a/drivers/dma/fsldma.h
>+++ b/drivers/dma/fsldma.h
>@@ -202,7 +202,12 @@ struct fsldma_chan {
> #define fsl_iowrite32(v, p) out_le32(p, v)
> #define fsl_iowrite32be(v, p) out_be32(p, v)
>
>-#ifndef __powerpc64__
>+#ifdef __powerpc64__
>+#define fsl_ioread64(p) in_le64(p)
>+#define fsl_ioread64be(p) in_be64(p)
>+#define fsl_iowrite64(v, p) out_le64(p, v)
>+#define fsl_iowrite64be(v, p) out_be64(p, v)
>+#else
> static u64 fsl_ioread64(const u64 __iomem *addr) {
> u32 fsl_addr = lower_32_bits(addr);
>--
>2.17.1
More information about the Linuxppc-dev
mailing list