linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be)
@ 2013-01-29 16:02 Alexey Brodkin
  2013-01-29 16:27 ` Arnd Bergmann
  0 siblings, 1 reply; 86+ messages in thread
From: Alexey Brodkin @ 2013-01-29 16:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: grant.likely, arnd.bergmann, Vineet.Gupta1, Alexey Brodkin

in(out)_8/in(out)_be16/in(out)_le16 are very powerpc/microblaze
specific. To enable use of Xilinx System ACE driver build for other
architectures (for example it's possible to use it on Xilinx ml-509
board with ARC700 in FPGA) we need to use generic implementation of
accessors.

Current implementation was successfully built with Sourcery G++ Lite
2011.03-39 for Power EABI (ppc44x_defconfig).

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
---
 drivers/block/xsysace.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 1f38643..64fd3c0 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -232,14 +232,14 @@ struct ace_reg_ops {
 static u16 ace_in_8(struct ace_device *ace, int reg)
 {
 	void __iomem *r = ace->baseaddr + reg;
-	return in_8(r) | (in_8(r + 1) << 8);
+	return ioread8(r) | (ioread8(r + 1) << 8);
 }
 
 static void ace_out_8(struct ace_device *ace, int reg, u16 val)
 {
 	void __iomem *r = ace->baseaddr + reg;
-	out_8(r, val);
-	out_8(r + 1, val >> 8);
+	iowrite8(val, r);
+	iowrite8(val >> 8, r + 1);
 }
 
 static void ace_datain_8(struct ace_device *ace)
@@ -248,7 +248,7 @@ static void ace_datain_8(struct ace_device *ace)
 	u8 *dst = ace->data_ptr;
 	int i = ACE_FIFO_SIZE;
 	while (i--)
-		*dst++ = in_8(r++);
+		*dst++ = ioread8(r++);
 	ace->data_ptr = dst;
 }
 
@@ -258,7 +258,7 @@ static void ace_dataout_8(struct ace_device *ace)
 	u8 *src = ace->data_ptr;
 	int i = ACE_FIFO_SIZE;
 	while (i--)
-		out_8(r++, *src++);
+		iowrite8(*src++, r++);
 	ace->data_ptr = src;
 }
 
@@ -272,12 +272,12 @@ static struct ace_reg_ops ace_reg_8_ops = {
 /* 16 bit big endian bus attachment */
 static u16 ace_in_be16(struct ace_device *ace, int reg)
 {
-	return in_be16(ace->baseaddr + reg);
+	return ioread16be(ace->baseaddr + reg);
 }
 
 static void ace_out_be16(struct ace_device *ace, int reg, u16 val)
 {
-	out_be16(ace->baseaddr + reg, val);
+	iowrite16be(val, ace->baseaddr + reg);
 }
 
 static void ace_datain_be16(struct ace_device *ace)
@@ -285,7 +285,7 @@ static void ace_datain_be16(struct ace_device *ace)
 	int i = ACE_FIFO_SIZE / 2;
 	u16 *dst = ace->data_ptr;
 	while (i--)
-		*dst++ = in_le16(ace->baseaddr + 0x40);
+		*dst++ = ioread16(ace->baseaddr + 0x40);
 	ace->data_ptr = dst;
 }
 
@@ -294,19 +294,19 @@ static void ace_dataout_be16(struct ace_device *ace)
 	int i = ACE_FIFO_SIZE / 2;
 	u16 *src = ace->data_ptr;
 	while (i--)
-		out_le16(ace->baseaddr + 0x40, *src++);
+		iowrite16(*src++, ace->baseaddr + 0x40);
 	ace->data_ptr = src;
 }
 
 /* 16 bit little endian bus attachment */
 static u16 ace_in_le16(struct ace_device *ace, int reg)
 {
-	return in_le16(ace->baseaddr + reg);
+	return ioread16(ace->baseaddr + reg);
 }
 
 static void ace_out_le16(struct ace_device *ace, int reg, u16 val)
 {
-	out_le16(ace->baseaddr + reg, val);
+	iowrite16(val, ace->baseaddr + reg);
 }
 
 static void ace_datain_le16(struct ace_device *ace)
@@ -314,7 +314,7 @@ static void ace_datain_le16(struct ace_device *ace)
 	int i = ACE_FIFO_SIZE / 2;
 	u16 *dst = ace->data_ptr;
 	while (i--)
-		*dst++ = in_be16(ace->baseaddr + 0x40);
+		*dst++ = ioread16be(ace->baseaddr + 0x40);
 	ace->data_ptr = dst;
 }
 
@@ -323,7 +323,7 @@ static void ace_dataout_le16(struct ace_device *ace)
 	int i = ACE_FIFO_SIZE / 2;
 	u16 *src = ace->data_ptr;
 	while (i--)
-		out_be16(ace->baseaddr + 0x40, *src++);
+		iowrite16be(*src++, ace->baseaddr + 0x40);
 	ace->data_ptr = src;
 }
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 86+ messages in thread

end of thread, other threads:[~2013-06-19 14:51 UTC | newest]

Thread overview: 86+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-29 16:02 [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be) Alexey Brodkin
2013-01-29 16:27 ` Arnd Bergmann
2013-01-30 11:03   ` Alexey Brodkin
2013-01-30 11:13     ` Michal Simek
2013-01-30 12:10       ` Vineet Gupta
2013-01-30 12:31         ` Michal Simek
2013-01-30 14:36           ` Arnd Bergmann
2013-02-04  9:26             ` Michal Simek
2013-02-04 17:24               ` Arnd Bergmann
2013-02-05  2:29                 ` Benjamin Herrenschmidt
2013-02-05 10:54                   ` Michal Simek
2013-02-05 12:09                     ` Vineet Gupta
2013-02-05 12:29                       ` Benjamin Herrenschmidt
2013-02-05 12:19                     ` Benjamin Herrenschmidt
2013-02-05 12:38                       ` Michal Simek
2013-02-05 14:03                         ` Alexey Brodkin
2013-02-05 15:12                           ` Arnd Bergmann
2013-02-05 21:01                             ` Benjamin Herrenschmidt
2013-02-06 10:03                             ` Grant Likely
2013-02-06 16:20                               ` Arnd Bergmann
2013-02-06 16:21                               ` Michal Simek
2013-02-07  0:34                                 ` Arnd Bergmann
2013-02-06 17:40                                   ` Michal Simek
2013-02-06 19:51                                     ` Geert Uytterhoeven
2013-02-07  7:23                                       ` Michal Simek
2013-02-07  7:38                                         ` Geert Uytterhoeven
2013-02-07  8:01                                           ` Michal Simek
2013-02-07  8:20                                             ` Geert Uytterhoeven
2013-02-07  8:33                                               ` Arnd Bergmann
2013-02-07 14:19                                                 ` Michal Simek
2013-02-07 23:12                                                   ` Arnd Bergmann
2013-02-11 10:38                                                     ` Michal Simek
2013-02-11 15:26                                                       ` Arnd Bergmann
2013-02-11 15:36                                                         ` Michal Simek
2013-02-11 15:43                                                           ` Arnd Bergmann
2013-02-11 15:57                                                             ` Michal Simek
2013-02-11 16:08                                                               ` Arnd Bergmann
2013-02-12  0:29                                                                 ` Benjamin Herrenschmidt
2013-02-12 11:29                                                                   ` Arnd Bergmann
2013-02-12 10:11                                                                 ` Michal Simek
2013-02-12 11:26                                                                   ` Arnd Bergmann
2013-02-12 12:14                                                                     ` Michal Simek
2013-02-12 13:55                                                                       ` Arnd Bergmann
2013-02-12 12:30                                                                   ` Benjamin Herrenschmidt
2013-02-12  0:25                                                               ` Benjamin Herrenschmidt
2013-02-12 10:03                                                                 ` Michal Simek
2013-02-05 21:00                           ` Benjamin Herrenschmidt
2013-02-05 21:25                             ` Alexey Brodkin
2013-02-05 23:07                               ` Benjamin Herrenschmidt
2013-02-06 10:14                                 ` Grant Likely
2013-02-06 16:27                                   ` Arnd Bergmann
2013-02-06 21:35                                   ` Benjamin Herrenschmidt
2013-02-07 12:09                                     ` Alexey Brodkin
2013-02-07 12:20                                       ` Benjamin Herrenschmidt
2013-02-07 12:23                                         ` Benjamin Herrenschmidt
2013-02-07 14:31                                       ` Michal Simek
2013-02-07 14:35                                         ` Alexey Brodkin
2013-02-07 14:39                                     ` Grant Likely
2013-02-07 14:51                                       ` Grant Likely
2013-02-07 15:12                                         ` Alexey Brodkin
2013-02-07 15:23                                           ` Grant Likely
2013-02-07 15:28                                             ` Alexey Brodkin
2013-02-07 16:44                                               ` Grant Likely
2013-02-07 16:56                                                 ` Alexey Brodkin
2013-02-07 17:16                                                   ` Grant Likely
2013-02-07 17:22                                                     ` Alexey Brodkin
2013-02-08  7:45                                                       ` Grant Likely
2013-02-07 21:18                                                   ` Benjamin Herrenschmidt
2013-02-07 21:15                                                 ` Benjamin Herrenschmidt
2013-02-07 23:05                                                 ` Arnd Bergmann
2013-02-08  6:19                                                   ` Geert Uytterhoeven
2013-02-08  7:14                                                   ` Grant Likely
2013-02-07 21:09                                             ` Benjamin Herrenschmidt
2013-02-12 17:02                                             ` Michal Simek
2013-02-12 17:25                                               ` Arnd Bergmann
2013-03-21 17:01                                                 ` Alexey Brodkin
2013-06-19  8:56                                                 ` xsysace driver support on arches other than PPC/Microblaze Alexey Brodkin
2013-06-19  9:09                                                   ` Alexey Brodkin
2013-06-19 12:13                                                   ` Andy Shevchenko
2013-06-19 12:56                                                     ` Alexey Brodkin
2013-06-19 14:51                                                       ` Arnd Bergmann
2013-02-07 21:06                                           ` [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be) Benjamin Herrenschmidt
2013-02-05 23:03                         ` Arnd Bergmann
2013-02-06  8:59                           ` Geert Uytterhoeven
2013-02-06 16:18                             ` Arnd Bergmann
2013-02-05 10:45                 ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).