diff options
author | Thomas Chou <thomas@wytron.com.tw> | 2015-10-27 09:02:17 +0800 |
---|---|---|
committer | Thomas Chou <thomas@wytron.com.tw> | 2015-11-06 09:14:11 +0800 |
commit | 2de4823dc0424923a6d6070a7378a7bf6ee67556 (patch) | |
tree | d1f7dd706b76f4897b83f7a5de32b6e27f766962 /arch/nios2/include | |
parent | 1cda48f333acd0f822720275730de0e6a6591a75 (diff) | |
download | u-boot-imx-2de4823dc0424923a6d6070a7378a7bf6ee67556.zip u-boot-imx-2de4823dc0424923a6d6070a7378a7bf6ee67556.tar.gz u-boot-imx-2de4823dc0424923a6d6070a7378a7bf6ee67556.tar.bz2 |
nios2: change virt_to_phys to use physaddr_mask in global data
As virt_to_phys() is used a lot in DMA transfer, change it
to use physaddr_mask in global data. This will save an "if"
statement and get a little faster.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'arch/nios2/include')
-rw-r--r-- | arch/nios2/include/asm/global_data.h | 1 | ||||
-rw-r--r-- | arch/nios2/include/asm/io.h | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/arch/nios2/include/asm/global_data.h b/arch/nios2/include/asm/global_data.h index 9f3bd00..9863fd9 100644 --- a/arch/nios2/include/asm/global_data.h +++ b/arch/nios2/include/asm/global_data.h @@ -19,6 +19,7 @@ struct arch_global_data { int has_mmu; u32 io_region_base; u32 mem_region_base; + u32 physaddr_mask; }; #include <asm-generic/global_data.h> diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index e04050f..03a3418 100644 --- a/arch/nios2/include/asm/io.h +++ b/arch/nios2/include/asm/io.h @@ -44,10 +44,7 @@ static inline void unmap_physmem(void *vaddr, unsigned long flags) static inline phys_addr_t virt_to_phys(void * vaddr) { DECLARE_GLOBAL_DATA_PTR; - if (gd->arch.has_mmu) - return (phys_addr_t)vaddr & 0x1fffffff; - else - return (phys_addr_t)vaddr & 0x7fffffff; + return (phys_addr_t)vaddr & gd->arch.physaddr_mask; } static inline void *ioremap(unsigned long physaddr, unsigned long size) |