summaryrefslogtreecommitdiff
path: root/arch/nios2/cpu
diff options
context:
space:
mode:
authorThomas Chou <thomas@wytron.com.tw>2015-10-27 01:02:17 (GMT)
committerThomas Chou <thomas@wytron.com.tw>2015-11-06 01:14:11 (GMT)
commit2de4823dc0424923a6d6070a7378a7bf6ee67556 (patch)
treed1f7dd706b76f4897b83f7a5de32b6e27f766962 /arch/nios2/cpu
parent1cda48f333acd0f822720275730de0e6a6591a75 (diff)
downloadu-boot-2de4823dc0424923a6d6070a7378a7bf6ee67556.tar.xz
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/cpu')
-rw-r--r--arch/nios2/cpu/cpu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index 88c4e18..f6d5cd3 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -119,6 +119,7 @@ static int altera_nios2_probe(struct udevice *dev)
"altr,has-mmu", 0);
gd->arch.io_region_base = gd->arch.has_mmu ? 0xe0000000 : 0x80000000;
gd->arch.mem_region_base = gd->arch.has_mmu ? 0xc0000000 : 0x00000000;
+ gd->arch.physaddr_mask = gd->arch.has_mmu ? 0x1fffffff : 0x7fffffff;
return 0;
}