diff mbox

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

Message ID 1447684616-10297-3-git-send-email-thomas@wytron.com.tw
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Thomas Chou Nov. 16, 2015, 2:36 p.m. UTC
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(+)

Comments

Thomas Chou Nov. 17, 2015, 12:18 a.m. UTC | #1
On 2015年11月16日 22:36, Thomas Chou wrote:
> 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(+)
>

Drop this patch as it is taken cared by Alexey Brodkin.

- Thomas


> 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;
>
diff mbox

Patch

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;