Merge git://www.denx.de/git/u-boot
[platform/kernel/u-boot.git] / include / asm-arm / io.h
index 122419f..47c18e7 100644 (file)
 #ifndef __ASM_ARM_IO_H
 #define __ASM_ARM_IO_H
 
+#ifdef __KERNEL__
+
 #include <linux/types.h>
 #include <asm/byteorder.h>
 #include <asm/memory.h>
+#if 0  /* XXX###XXX */
 #include <asm/arch/hardware.h>
+#endif /* XXX###XXX */
+
+static inline void sync(void)
+{
+}
 
 /*
  * Generic virtual read/write.  Note that we don't support half-word
  * to the architecture specific code.
  */
 #define __arch_getb(a)                 (*(volatile unsigned char *)(a))
-#define __arch_getl(a)                 (*(volatile unsigned int  *)(a))
+#define __arch_getw(a)                 (*(volatile unsigned short *)(a))
+#define __arch_getl(a)                 (*(volatile unsigned int *)(a))
 
 #define __arch_putb(v,a)               (*(volatile unsigned char *)(a) = (v))
-#define __arch_putl(v,a)               (*(volatile unsigned int  *)(a) = (v))
+#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);
@@ -52,6 +62,14 @@ extern void __raw_readsl(unsigned int addr, void *data, int longlen);
 #define __raw_readw(a)                 __arch_getw(a)
 #define __raw_readl(a)                 __arch_getl(a)
 
+#define writeb(v,a)                    __arch_putb(v,a)
+#define writew(v,a)                    __arch_putw(v,a)
+#define writel(v,a)                    __arch_putl(v,a)
+
+#define readb(a)                       __arch_getb(a)
+#define readw(a)                       __arch_getw(a)
+#define readl(a)                       __arch_getl(a)
+
 /*
  * The compiler seems to be incapable of optimising constants
  * properly.  Spell it out to the compiler in some cases.
@@ -68,7 +86,9 @@ extern void __raw_readsl(unsigned int addr, void *data, int longlen);
 /*
  * Now, pick up the machine-defined IO definitions
  */
+#if 0  /* XXX###XXX */
 #include <asm/arch/io.h>
+#endif /* XXX###XXX */
 
 /*
  *  IO port access primitives
@@ -252,10 +272,6 @@ out:
 #define isa_eth_io_copy_and_sum(a,b,c,d) \
                                eth_copy_and_sum((a),__mem_isa(b),(c),(d))
 
-#ifndef PCI_MEMORY_VADDR       /* XXX problem not understood -- wd */
-#define        PCI_MEMORY_VADDR        0
-#endif /* XXX */
-
 static inline int
 isa_check_signature(unsigned long io_addr, const unsigned char *signature,
                    int length)
@@ -291,5 +307,5 @@ out:
 #define isa_check_signature(io,sig,len)        (0)
 
 #endif /* __mem_isa */
-
+#endif /* __KERNEL__ */
 #endif /* __ASM_ARM_IO_H */