Introduce map_physmem() and unmap_physmem()
[oweals/u-boot.git] / include / asm-arm / io.h
index 0f38e10d2d80895b048b4a4c8dce0ea700229dec..029b7f9eeb41de1431927e00a26e2aea980e7eef 100644 (file)
 #include <asm/arch/hardware.h>
 #endif /* XXX###XXX */
 
+static inline void sync(void)
+{
+}
+
+/*
+ * Given a physical address and a length, return a virtual address
+ * that can be used to access the memory range with the caching
+ * properties specified by "flags".
+ */
+typedef unsigned long phys_addr_t;
+
+#define MAP_NOCACHE    (0)
+#define MAP_WRCOMBINE  (0)
+#define MAP_WRBACK     (0)
+#define MAP_WRTHROUGH  (0)
+
+static inline void *
+map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
+{
+       return (void *)paddr;
+}
+
+/*
+ * Take down a mapping set up by map_physmem().
+ */
+static inline void unmap_physmem(void *vaddr, unsigned long flags)
+{
+
+}
+
 /*
  * Generic virtual read/write.  Note that we don't support half-word
  * read/writes.  We define __arch_*[bl] here, and leave __arch_*w
  * 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);
@@ -56,6 +88,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.