[U-Boot] [PATCH 02/12] arc: add mapping between physical and virtual address

Thomas Chou
2015-11-16T14:36:46Z

Add mapping between physical and virtual address.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
arch/arc/include/asm/io.h | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h
index 24b7337..273e9f9 100644
--- a/arch/arc/include/asm/io.h
+++ b/arch/arc/include/asm/io.h
@@ -15,6 +15,34 @@ static inline void sync(void)
/* Not yet implemented */
}

+/*
+ * 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".
+ */
+#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 *)(uintptr_t)paddr;
+}
+
+/*
+ * Take down a mapping set up by map_physmem().
+ */
+static inline void unmap_physmem(void *vaddr, unsigned long flags)
+{
+}
+
+static inline phys_addr_t virt_to_phys(void *vaddr)
+{
+ return (phys_addr_t)(uintptr_t)vaddr;
+}
+
static inline u8 __raw_readb(const volatile void __iomem *addr)
{
u8 b;
--
2.5.0