devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 1/2] m32r: Fix ioread8 definition
@ 2014-11-27 18:16 Kevin Cernekee
  2014-11-27 18:16 ` [PATCH V2 2/2] m32r: Add missing big-endian I/O accessors Kevin Cernekee
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Cernekee @ 2014-11-27 18:16 UTC (permalink / raw)
  To: grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	fengguang.wu-ral2JQCrhuEAvxtiuMwx3w
  Cc: kbuild-all-JC7UmRfGjtg, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4

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

Signed-off-by: Kevin Cernekee <cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 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

--
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 related	[flat|nested] 5+ messages in thread

* [PATCH V2 2/2] m32r: Add missing big-endian I/O accessors
  2014-11-27 18:16 [PATCH V2 1/2] m32r: Fix ioread8 definition Kevin Cernekee
@ 2014-11-27 18:16 ` Kevin Cernekee
       [not found]   ` <1417112193-14400-2-git-send-email-cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2014-11-27 22:20   ` Fengguang Wu
  0 siblings, 2 replies; 5+ messages in thread
From: Kevin Cernekee @ 2014-11-27 18:16 UTC (permalink / raw)
  To: grant.likely, fengguang.wu
  Cc: kbuild-all, gregkh, devicetree, linux-kernel, arnd

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(+)


V1->V2:

Use an unconditional swap, per Arnd:

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

Disclaimer: I don't claim to understand why this is correct, but I've
never even looked at m32r before so I will defer to the experts...

Side note for Fengguang: both with and without my patches, m32r modules
fail to link using the make.cross script on Ubuntu 14.10:

  CC      init/version.o
  LD      init/built-in.o
  KSYM    .tmp_kallsyms1.o
  KSYM    .tmp_kallsyms2.o
  LD      vmlinux
  SYSMAP  System.map
  Building modules, stage 2.
  OBJCOPY arch/m32r/boot/compressed/vmlinux.bin
  MODPOST 96 modules
  GZIP    arch/m32r/boot/compressed/vmlinux.bin.gz
ERROR: "memory_start" [fs/udf/udf.ko] undefined!
ERROR: "memory_end" [fs/udf/udf.ko] undefined!
ERROR: "memory_end" [drivers/scsi/sg.ko] undefined!
ERROR: "memory_start" [drivers/scsi/sg.ko] undefined!
ERROR: "memory_end" [drivers/i2c/i2c-dev.ko] undefined!
ERROR: "memory_start" [drivers/i2c/i2c-dev.ko] undefined!
scripts/Makefile.modpost:90: recipe for target '__modpost' failed
make[1]: *** [__modpost] Error 1
Makefile:1098: recipe for target 'modules' failed
make: *** [modules] Error 2
make: *** Waiting for unfinished jobs....
  LD      arch/m32r/boot/compressed/piggy.o
/usr/local/gcc-4.9.0-nolibc/m32r-linux/bin/m32r-linux-ld: target elf32-m32r not found
arch/m32r/boot/compressed/Makefile:51: recipe for target 'arch/m32r/boot/compressed/piggy.o' failed
make[2]: *** [arch/m32r/boot/compressed/piggy.o] Error 1
arch/m32r/boot/Makefile:18: recipe for target 'arch/m32r/boot/compressed/vmlinux' failed
make[1]: *** [arch/m32r/boot/compressed/vmlinux] Error 2
arch/m32r/Makefile:53: recipe for target 'zImage' failed
make: *** [zImage] Error 2



diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h
index 343ae4c..f76999c 100644
--- a/arch/m32r/include/asm/io.h
+++ b/arch/m32r/include/asm/io.h
@@ -3,6 +3,7 @@
 
 #include <linux/string.h>
 #include <linux/compiler.h>
+#include <linux/swab.h>
 #include <asm/page.h>  /* __va */
 
 #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)	swab16(readw(addr))
+#define ioread32be(addr)	swab32(readl(addr))
+#define iowrite16be(val, addr)	writew(swab16(val), addr)
+#define iowrite32be(val, addr)	writel(swab32(val), addr)
+
 #define mmiowb()
 
 #define flush_write_buffers() do { } while (0)  /* M32R_FIXME */
-- 
2.1.0

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

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

On Thursday 27 November 2014 10:16:33 Kevin Cernekee wrote:
> 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 

Both patches

Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
--
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] 5+ messages in thread

* Re: [PATCH V2 2/2] m32r: Add missing big-endian I/O accessors
  2014-11-27 18:16 ` [PATCH V2 2/2] m32r: Add missing big-endian I/O accessors Kevin Cernekee
       [not found]   ` <1417112193-14400-2-git-send-email-cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-11-27 22:20   ` Fengguang Wu
       [not found]     ` <20141127222034.GB16647-q6ZYBFIlbFFi0tQiZxhdj1DQ4js95KgL@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Fengguang Wu @ 2014-11-27 22:20 UTC (permalink / raw)
  To: Kevin Cernekee
  Cc: grant.likely, kbuild-all, gregkh, devicetree, linux-kernel, arnd,
	Hirokazu Takata

Add CC to Hirokazu.

> Side note for Fengguang: both with and without my patches, m32r modules
> fail to link using the make.cross script on Ubuntu 14.10:
 
Yes, the memory_start/memory_end link errors are really old m32r
specific errors. The config file that can trigger this error is
m32r-m32104ut_defconfig.

>   CC      init/version.o
>   LD      init/built-in.o
>   KSYM    .tmp_kallsyms1.o
>   KSYM    .tmp_kallsyms2.o
>   LD      vmlinux
>   SYSMAP  System.map
>   Building modules, stage 2.
>   OBJCOPY arch/m32r/boot/compressed/vmlinux.bin
>   MODPOST 96 modules
>   GZIP    arch/m32r/boot/compressed/vmlinux.bin.gz
> ERROR: "memory_start" [fs/udf/udf.ko] undefined!
> ERROR: "memory_end" [fs/udf/udf.ko] undefined!
> ERROR: "memory_end" [drivers/scsi/sg.ko] undefined!
> ERROR: "memory_start" [drivers/scsi/sg.ko] undefined!
> ERROR: "memory_end" [drivers/i2c/i2c-dev.ko] undefined!
> ERROR: "memory_start" [drivers/i2c/i2c-dev.ko] undefined!
> scripts/Makefile.modpost:90: recipe for target '__modpost' failed
> make[1]: *** [__modpost] Error 1
> Makefile:1098: recipe for target 'modules' failed
> make: *** [modules] Error 2
> make: *** Waiting for unfinished jobs....
>   LD      arch/m32r/boot/compressed/piggy.o
> /usr/local/gcc-4.9.0-nolibc/m32r-linux/bin/m32r-linux-ld: target elf32-m32r not found
> arch/m32r/boot/compressed/Makefile:51: recipe for target 'arch/m32r/boot/compressed/piggy.o' failed
> make[2]: *** [arch/m32r/boot/compressed/piggy.o] Error 1
> arch/m32r/boot/Makefile:18: recipe for target 'arch/m32r/boot/compressed/vmlinux' failed
> make[1]: *** [arch/m32r/boot/compressed/vmlinux] Error 2
> arch/m32r/Makefile:53: recipe for target 'zImage' failed
> make: *** [zImage] Error 2

Thanks,
Fengguang

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

* Re: [PATCH V2 2/2] m32r: Add missing big-endian I/O accessors
       [not found]     ` <20141127222034.GB16647-q6ZYBFIlbFFi0tQiZxhdj1DQ4js95KgL@public.gmane.org>
@ 2014-11-27 23:15       ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2014-11-27 23:15 UTC (permalink / raw)
  To: Fengguang Wu
  Cc: Kevin Cernekee, grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	kbuild-all-JC7UmRfGjtg, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Hirokazu Takata

On Thursday 27 November 2014 14:20:34 Fengguang Wu wrote:
> Add CC to Hirokazu.
> 
> > Side note for Fengguang: both with and without my patches, m32r modules
> > fail to link using the make.cross script on Ubuntu 14.10:
>  
> Yes, the memory_start/memory_end link errors are really old m32r
> specific errors. The config file that can trigger this error is
> m32r-m32104ut_defconfig.

These should be trivial to fix:

diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 0392112a5d70..a5ecef7188ba 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -81,7 +81,10 @@ static struct resource code_resource = {
 };
 
 unsigned long memory_start;
+EXPORT_SYMBOL(memory_start);
+
 unsigned long memory_end;
+EXPORT_SYMBOL(memory_end);
 
 void __init setup_arch(char **);
 int get_cpuinfo(char *);

	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 related	[flat|nested] 5+ messages in thread

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-27 18:16 [PATCH V2 1/2] m32r: Fix ioread8 definition Kevin Cernekee
2014-11-27 18:16 ` [PATCH V2 2/2] m32r: Add missing big-endian I/O accessors Kevin Cernekee
     [not found]   ` <1417112193-14400-2-git-send-email-cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-27 21:48     ` Arnd Bergmann
2014-11-27 22:20   ` Fengguang Wu
     [not found]     ` <20141127222034.GB16647-q6ZYBFIlbFFi0tQiZxhdj1DQ4js95KgL@public.gmane.org>
2014-11-27 23:15       ` 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).