Skip to contentSkip to conversation

mn10300: add io{read,write}{16,32}be functions

PATCH Applied Guenter Roeck 3 participants 3 messages Apr 20, 2015 – Apr 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mn10300: add io{read,write}{16,32}be functions

These functions are used in various drivers, including the latest version of the 8250 driver. The latter causes the following build failure.

drivers/tty/serial/8250/8250_core.c: In function 'mem32be_serial_out':
drivers/tty/serial/8250/8250_core.c:456:2: error:
implicit declaration of function 'iowrite32be'
drivers/tty/serial/8250/8250_core.c: In function 'mem32be_serial_in':
drivers/tty/serial/8250/8250_core.c:462:2: error:
implicit declaration of function 'ioread32be'

Cc Kevin Cernekee <[email protected]>
Cc Rob Herring <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Fixes c627f2ceb692 ("serial: 8250: Add support for big-endian MMIO

accesses")

---
Build failure seen in next-20150420.

 arch/mn10300/include/asm/io.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/mn10300/include/asm/io.h +5 -0
index 897ba3c..cc4a2ba 100644
@@ -197,6 +197,11 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
 #define iowrite16(v, addr)	writew((v), (addr))
 #define iowrite32(v, addr)	writel((v), (addr))
 
+#define ioread16be(addr)	be16_to_cpu(readw(addr))
+#define ioread32be(addr)	be32_to_cpu(readl(addr))
+#define iowrite16be(v, addr)	writew(cpu_to_be16(v), (addr))
+#define iowrite32be(v, addr)	writel(cpu_to_be32(v), (addr))
+
 #define ioread8_rep(p, dst, count) \
 	insb((unsigned long) (p), (dst), (count))
 #define ioread16_rep(p, dst, count) \
Signature · 1 line
2.1.0
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Guenter Roeck

These functions are used in various drivers, including the latest version of the 8250 driver. The latter causes the following build failure.

drivers/tty/serial/8250/8250_core.c: In function 'mem32be_serial_out':
drivers/tty/serial/8250/8250_core.c:456:2: error:
implicit declaration of function 'iowrite32be'
drivers/tty/serial/8250/8250_core.c: In function 'mem32be_serial_in':
drivers/tty/serial/8250/8250_core.c:462:2: error:
implicit declaration of function 'ioread32be'

Cc Kevin Cernekee <[email protected]>
Cc Rob Herring <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Fixes c627f2ceb692 ("serial: 8250: Add support for big-endian MMIO
Quoted 7 lines

accesses")

---
Build failure seen in next-20150420.

 arch/mn10300/include/asm/io.h | 5 +++++
 1 file changed, 5 insertions(+)
Applied
#2 lore raw
In reply to Guenter Roeck
Quoted 10 lines · Guenter Roeck

These functions are used in various drivers, including the latest version of the 8250 driver. The latter causes the following build failure.

drivers/tty/serial/8250/8250_core.c: In function 'mem32be_serial_out':
drivers/tty/serial/8250/8250_core.c:456:2: error:
implicit declaration of function 'iowrite32be'
drivers/tty/serial/8250/8250_core.c: In function 'mem32be_serial_in':
drivers/tty/serial/8250/8250_core.c:462:2: error:
implicit declaration of function 'ioread32be'

Quoted 8 lines
Cc Kevin Cernekee <[email protected]>
Cc Rob Herring <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Fixes c627f2ceb692 ("serial: 8250: Add support for big-endian MMIO

accesses")

---
Build failure seen in next-20150420.

Applied. Thanks.

Rob

Quoted 23 lines
 arch/mn10300/include/asm/io.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/mn10300/include/asm/io.h +5 -1
index 897ba3c..cc4a2ba 100644
@@ -197,6 +197,11 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
 #define iowrite16(v, addr)     writew((v), (addr))
 #define iowrite32(v, addr)     writel((v), (addr))
 
+#define ioread16be(addr)       be16_to_cpu(readw(addr))
+#define ioread32be(addr)       be32_to_cpu(readl(addr))
+#define iowrite16be(v, addr)   writew(cpu_to_be16(v), (addr))
+#define iowrite32be(v, addr)   writel(cpu_to_be32(v), (addr))
+
 #define ioread8_rep(p, dst, count) \
        insb((unsigned long) (p), (dst), (count))
 #define ioread16_rep(p, dst, count) \
--

2.1.0