summaryrefslogtreecommitdiff
path: root/arch/nios2/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/nios2/include/asm')
-rw-r--r--arch/nios2/include/asm/io.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h
index d0adf08..e7da35b 100644
--- a/arch/nios2/include/asm/io.h
+++ b/arch/nios2/include/asm/io.h
@@ -39,7 +39,11 @@ static inline void unmap_physmem(void *vaddr, unsigned long flags)
static inline phys_addr_t virt_to_phys(void * vaddr)
{
- return (phys_addr_t)(vaddr);
+ DECLARE_GLOBAL_DATA_PTR;
+ if (gd->arch.has_mmu)
+ return (phys_addr_t)vaddr & 0x1fffffff;
+ else
+ return (phys_addr_t)vaddr & 0x7fffffff;
}
static inline void *ioremap(unsigned long physaddr, unsigned long size)