devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] m32r: Fix ioread8 definition
@ 2014-11-27 17:46 Kevin Cernekee
  2014-11-27 17:46 ` [PATCH 2/2] m32r: Add missing big-endian I/O accessors Kevin Cernekee
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Cernekee @ 2014-11-27 17:46 UTC (permalink / raw)
  To: grant.likely; +Cc: kbuild-all, gregkh, devicetree, linux-kernel

This should be readb(), not read().

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 arch/m32r/include/asm/io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h
index 4010f1f..343ae4c 100644
--- a/arch/m32r/include/asm/io.h
+++ b/arch/m32r/include/asm/io.h
@@ -162,7 +162,7 @@ static inline void _writel(unsigned long l, unsigned long addr)
 #define __raw_writew writew
 #define __raw_writel writel
 
-#define ioread8 read
+#define ioread8 readb
 #define ioread16 readw
 #define ioread32 readl
 #define iowrite8 writeb
-- 
2.1.0

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

* [PATCH 2/2] m32r: Add missing big-endian I/O accessors
  2014-11-27 17:46 [PATCH 1/2] m32r: Fix ioread8 definition Kevin Cernekee
@ 2014-11-27 17:46 ` Kevin Cernekee
       [not found]   ` <1417110404-13297-2-git-send-email-cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Cernekee @ 2014-11-27 17:46 UTC (permalink / raw)
  To: grant.likely; +Cc: kbuild-all, gregkh, devicetree, linux-kernel

m32r doesn't use GENERIC_IOMAP, and it doesn't currently implement e.g.
ioread32be() on its own.  Add definitions to <asm/io.h> to fix build
failures in common drivers that use these functions.

   drivers/tty/serial/8250/8250_core.c: In function 'mem32be_serial_out':
>> drivers/tty/serial/8250/8250_core.c:434:2: error: implicit declaration of function 'iowrite32be' [-Werror=implicit-function-declaration]
     iowrite32be(value, p->membase + offset);
     ^
   drivers/tty/serial/8250/8250_core.c: In function 'mem32be_serial_in':
>> drivers/tty/serial/8250/8250_core.c:440:2: error: implicit declaration of function 'ioread32be' [-Werror=implicit-function-declaration]
     return ioread32be(p->membase + offset);
     ^
   cc1: some warnings being treated as errors

Compile-tested only.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 arch/m32r/include/asm/io.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h
index 343ae4c..5fb2ad8 100644
--- a/arch/m32r/include/asm/io.h
+++ b/arch/m32r/include/asm/io.h
@@ -4,6 +4,7 @@
 #include <linux/string.h>
 #include <linux/compiler.h>
 #include <asm/page.h>  /* __va */
+#include <asm/byteorder.h>
 
 #ifdef __KERNEL__
 
@@ -169,6 +170,11 @@ static inline void _writel(unsigned long l, unsigned long addr)
 #define iowrite16 writew
 #define iowrite32 writel
 
+#define ioread16be(addr)	be16_to_cpu(readw(addr))
+#define ioread32be(addr)	be32_to_cpu(readl(addr))
+#define iowrite16be(val, addr)	writew(cpu_to_be16(val), addr)
+#define iowrite32be(val, addr)	writel(cpu_to_be32(val), addr)
+
 #define mmiowb()
 
 #define flush_write_buffers() do { } while (0)  /* M32R_FIXME */
-- 
2.1.0

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

* Re: [PATCH 2/2] m32r: Add missing big-endian I/O accessors
       [not found]   ` <1417110404-13297-2-git-send-email-cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-11-27 17:52     ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2014-11-27 17:52 UTC (permalink / raw)
  To: Kevin Cernekee
  Cc: grant.likely-QSEj5FYQhm4dnm+yROfE0A, kbuild-all-JC7UmRfGjtg,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Thursday 27 November 2014 09:46:44 Kevin Cernekee wrote:
>  #define iowrite32 writel
>  
> +#define ioread16be(addr)       be16_to_cpu(readw(addr))
> +#define ioread32be(addr)       be32_to_cpu(readl(addr))
> +#define iowrite16be(val, addr) writew(cpu_to_be16(val), addr)
> +#define iowrite32be(val, addr) writel(cpu_to_be32(val), addr)
> +
> 

m32r can be either little-endian or big-endian, so these need to
unconditionally swap instead.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-11-27 17:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-27 17:46 [PATCH 1/2] m32r: Fix ioread8 definition Kevin Cernekee
2014-11-27 17:46 ` [PATCH 2/2] m32r: Add missing big-endian I/O accessors Kevin Cernekee
     [not found]   ` <1417110404-13297-2-git-send-email-cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-27 17:52     ` Arnd Bergmann

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).