public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/9] ARM: Define __raw_readX and __raw_writeX
Date: Tue, 10 Aug 2010 06:50:02 +0200	[thread overview]
Message-ID: <1281415810-31363-1-git-send-email-marek.vasut@gmail.com> (raw)

These functions are undefined on ARM when using __io. These are the commonly
used versions and can be redefined.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/include/asm/io.h |   46 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index e8f3eb1..ff1518e 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -75,13 +75,47 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 #define __arch_putw(v,a)		(*(volatile unsigned short *)(a) = (v))
 #define __arch_putl(v,a)		(*(volatile unsigned int *)(a) = (v))
 
-extern void __raw_writesb(unsigned int addr, const void *data, int bytelen);
-extern void __raw_writesw(unsigned int addr, const void *data, int wordlen);
-extern void __raw_writesl(unsigned int addr, const void *data, int longlen);
+extern inline void __raw_writesb(unsigned int addr, const void *data, int bytelen)
+{
+	uint8_t *buf = (uint8_t *)data;
+	while(bytelen--)
+		__arch_putb(*buf++, addr);
+}
+
+extern inline void __raw_writesw(unsigned int addr, const void *data, int wordlen)
+{
+	uint16_t *buf = (uint16_t *)data;
+	while(wordlen--)
+		__arch_putw(*buf++, addr);
+}
+
+extern inline void __raw_writesl(unsigned int addr, const void *data, int longlen)
+{
+	uint32_t *buf = (uint32_t *)data;
+	while(longlen--)
+		__arch_putl(*buf++, addr);
+}
 
-extern void __raw_readsb(unsigned int addr, void *data, int bytelen);
-extern void __raw_readsw(unsigned int addr, void *data, int wordlen);
-extern void __raw_readsl(unsigned int addr, void *data, int longlen);
+extern inline void __raw_readsb(unsigned int addr, void *data, int bytelen)
+{
+	uint8_t *buf = (uint8_t *)data;
+	while(bytelen--)
+		*buf++ = __arch_getb(addr);
+}
+
+extern inline void __raw_readsw(unsigned int addr, void *data, int wordlen)
+{
+	uint16_t *buf = (uint16_t *)data;
+	while(wordlen--)
+		*buf++ = __arch_getw(addr);
+}
+
+extern inline void __raw_readsl(unsigned int addr, void *data, int longlen)
+{
+	uint32_t *buf = (uint32_t *)data;
+	while(longlen--)
+		*buf++ = __arch_getl(addr);
+}
 
 #define __raw_writeb(v,a)		__arch_putb(v,a)
 #define __raw_writew(v,a)		__arch_putw(v,a)
-- 
1.7.1

             reply	other threads:[~2010-08-10  4:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10  4:50 Marek Vasut [this message]
2010-08-10  4:50 ` [U-Boot] [PATCH 2/9] PXA: pxafb: Add ACX517AKN support Marek Vasut
2010-08-10 21:45   ` Wolfgang Denk
2010-08-10 23:56     ` Marek Vasut
2010-08-20  9:31   ` [U-Boot] [PATCH 1/8] " Marek Vasut
2010-08-20  9:31   ` [U-Boot] [PATCH 2/8] common: Enable serial for PXA250 Marek Vasut
2010-08-20  9:31   ` [U-Boot] [PATCH 3/8 v2] PXA: Palm Tungsten|C Support Marek Vasut
2010-08-20  9:31   ` [U-Boot] [PATCH 4/8] PXA: pxafb: Add support for Sharp LQ038J7DH53 Marek Vasut
2010-08-20  9:31   ` [U-Boot] [PATCH 5/8] PXA: Add initial Palm LifeDrive support Marek Vasut
2010-08-20  9:31   ` [U-Boot] [PATCH 6/8] PXA: Voipac270 improvements Marek Vasut
2010-09-07 21:13     ` Wolfgang Denk
2010-09-07 21:30       ` Marek Vasut
2010-09-07 22:34         ` Marek Vasut
2010-08-20  9:31   ` [U-Boot] [PATCH 7/8] PXA: Balloon3 board support Marek Vasut
2010-09-07 21:17     ` Wolfgang Denk
2010-09-07 21:27       ` Marek Vasut
2010-08-20  9:31   ` [U-Boot] [PATCH 8/8] PXA: Add missing MAINTAINERS entries Marek Vasut
2010-08-10  4:50 ` [U-Boot] [PATCH 3/9] common: Enable serial for PXA250 Marek Vasut
2010-08-10  4:50 ` [U-Boot] [PATCH 4/9] PXA: Palm Tungsten|C Support Marek Vasut
2010-08-10  4:50 ` [U-Boot] [PATCH 5/9] PXA: pxafb: Add support for Sharp LQ038J7DH53 Marek Vasut
2010-08-10  4:50 ` [U-Boot] [PATCH 6/9] PXA: Add initial Palm LifeDrive support Marek Vasut
2010-08-10  4:50 ` [U-Boot] [PATCH 7/9] PXA: Voipac270 improvements Marek Vasut
2010-08-10  4:50 ` [U-Boot] [PATCH 8/9] PXA: Balloon3 board support Marek Vasut
2010-08-10 21:52   ` Wolfgang Denk
2010-08-10  4:50 ` [U-Boot] [PATCH 9/9] PXA: Add missing MAINTAINERS entries Marek Vasut
2010-08-10 21:48   ` Wolfgang Denk
2010-08-10 21:38 ` [U-Boot] [PATCH 1/9] ARM: Define __raw_readX and __raw_writeX Wolfgang Denk
2010-08-10 23:52   ` Marek Vasut

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=1281415810-31363-1-git-send-email-marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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