public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: Hirokazu Takata <takata@linux-m32r.org>
Cc: linux-m32r@ml.linux-m32r.org, linux-m32r-ja@ml.linux-m32r.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>
Subject: Re: [PATCH] arch: m32r: include: asm: add ioread*_rep() and iowrite*_rep()
Date: Thu, 27 Jun 2013 12:42:09 +0800	[thread overview]
Message-ID: <51CBC2A1.6070204@asianux.com> (raw)
In-Reply-To: <51CBC186.3080401@asianux.com>

Hello Maintainers:

If the related 4 patches for io.h pass your checking, it seems OK to
merge them into one patch, the diff like below:

--------------------------------diff begin------------------------------

diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h
index 4010f1f..5506d86 100644
--- a/arch/m32r/include/asm/io.h
+++ b/arch/m32r/include/asm/io.h
@@ -67,6 +67,7 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
 
 extern void iounmap(volatile void __iomem *addr);
 #define ioremap_nocache(off,size) ioremap(off,size)
+#define ioremap_wc ioremap_nocache
 
 /*
  * IO bus memory addresses are also 1:1 with the physical address
@@ -162,12 +163,30 @@ 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 ioread16be(addr)        __be16_to_cpu(__raw_readw(addr))
 #define ioread32 readl
+#define ioread32be(addr)        __be32_to_cpu(__raw_readl(addr))
 #define iowrite8 writeb
 #define iowrite16 writew
+#define iowrite16be(v, addr)    __raw_writew(__cpu_to_be16(v), addr)
 #define iowrite32 writel
+#define iowrite32be(v, addr)    __raw_writel(__cpu_to_be32(v), addr)
+
+#define ioread8_rep(p, dst, count) \
+	insb((unsigned long) (p), (dst), (count))
+#define ioread16_rep(p, dst, count) \
+	insw((unsigned long) (p), (dst), (count))
+#define ioread32_rep(p, dst, count) \
+	insl((unsigned long) (p), (dst), (count))
+
+#define iowrite8_rep(p, src, count) \
+	outsb((unsigned long) (p), (src), (count))
+#define iowrite16_rep(p, src, count) \
+	outsw((unsigned long) (p), (src), (count))
+#define iowrite32_rep(p, src, count) \
+	outsl((unsigned long) (p), (src), (count))
 
 #define mmiowb()

--------------------------------diff end--------------------------------

Thanks.

On 06/27/2013 12:37 PM, Chen Gang wrote:
> add generic ioread*_rep() and iowrite*_rep(), or compiling failed.
> 
> The related error (with allmodconfig):
> 
>     CC [M]  drivers/mtd/nand/nand_base.o
>   drivers/mtd/nand/nand_base.c: In function ‘nand_write_buf’:
>   drivers/mtd/nand/nand_base.c:216:2: error: implicit declaration of function ‘iowrite8_rep’ [-Werror=implicit-function-declaration]
>   drivers/mtd/nand/nand_base.c: In function ‘nand_read_buf’:
>   drivers/mtd/nand/nand_base.c:231:2: error: implicit declaration of function ‘ioread8_rep’ [-Werror=implicit-function-declaration]
>   drivers/mtd/nand/nand_base.c: In function ‘nand_write_buf16’:
>   drivers/mtd/nand/nand_base.c:247:2: error: implicit declaration of function ‘iowrite16_rep’ [-Werror=implicit-function-declaration]
>   drivers/mtd/nand/nand_base.c: In function ‘nand_read_buf16’:
>   drivers/mtd/nand/nand_base.c:263:2: error: implicit declaration of function ‘ioread16_rep’ [-Werror=implicit-function-declaration]
> 
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  arch/m32r/include/asm/io.h |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h
> index 4010f1f..167d6ed 100644
> --- a/arch/m32r/include/asm/io.h
> +++ b/arch/m32r/include/asm/io.h
> @@ -169,6 +169,20 @@ static inline void _writel(unsigned long l, unsigned long addr)
>  #define iowrite16 writew
>  #define iowrite32 writel
>  
> +#define ioread8_rep(p, dst, count) \
> +	insb((unsigned long) (p), (dst), (count))
> +#define ioread16_rep(p, dst, count) \
> +	insw((unsigned long) (p), (dst), (count))
> +#define ioread32_rep(p, dst, count) \
> +	insl((unsigned long) (p), (dst), (count))
> +
> +#define iowrite8_rep(p, src, count) \
> +	outsb((unsigned long) (p), (src), (count))
> +#define iowrite16_rep(p, src, count) \
> +	outsw((unsigned long) (p), (src), (count))
> +#define iowrite32_rep(p, src, count) \
> +	outsl((unsigned long) (p), (src), (count))
> +
>  #define mmiowb()
>  
>  #define flush_write_buffers() do { } while (0)  /* M32R_FIXME */
> 


-- 
Chen Gang

  reply	other threads:[~2013-06-27  4:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27  2:32 [PATCH] arch: m32r: include: asm: add generic ioremap_wc() definition Chen Gang
2013-06-27  2:57 ` [PATCH] arch: m32r: include: asm: use 'readb' instead of 'read' Chen Gang
2013-06-27  3:29   ` [PATCH] arch: m32r: include: asm: add ioread*be() and iowrite*be() Chen Gang
2013-06-27  4:37     ` [PATCH] arch: m32r: include: asm: add ioread*_rep() and iowrite*_rep() Chen Gang
2013-06-27  4:42       ` Chen Gang [this message]
2013-06-27  7:07       ` Geert Uytterhoeven
2013-06-27  8:25         ` Arnd Bergmann
2013-06-27  8:43           ` Geert Uytterhoeven
2013-06-28  2:19           ` Chen Gang
2013-06-27  8:55         ` Chen Gang
2013-06-27  9:28           ` Geert Uytterhoeven
2013-06-27  9:32             ` Chen Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51CBC2A1.6070204@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m32r-ja@ml.linux-m32r.org \
    --cc=linux-m32r@ml.linux-m32r.org \
    --cc=takata@linux-m32r.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox