diff options
author | Vitaly Andrianov <vitalya@ti.com> | 2012-06-21 07:57:25 -0400 |
---|---|---|
committer | Cyril Chemparathy <cyril@ti.com> | 2012-09-21 10:44:17 -0400 |
commit | 181fa5ccb96b73e5ddaaa622834735a895f3c06a (patch) | |
tree | e61bb3766409df16cdcfab55685cc63c21525df9 | |
parent | 1e1919b34866db079d20474405981d1ece7e04ec (diff) | |
download | linux-keystone-181fa5ccb96b73e5ddaaa622834735a895f3c06a.tar.gz |
ARM: add virt_to_idmap for interconnect aliasing
On some PAE systems (e.g. TI Keystone), memory is above the 32-bit addressible
limit, and the interconnect provides an aliased view of parts of physical
memory in the 32-bit addressible space. This alias is strictly for boot time
usage, and is not otherwise usable because of coherency limitations.
On such systems, the idmap mechanism needs to take this aliased mapping into
account. This patch introduces a virt_to_idmap() macro, which can be used on
such sub-architectures to represent the interconnect supported boot time
alias. Most other systems would leave this macro untouched, i.e., do a simply
virt_to_phys() and nothing more.
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
-rw-r--r-- | arch/arm/include/asm/memory.h | 9 | ||||
-rw-r--r-- | arch/arm/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/arm/mm/idmap.c | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index fb75935daa22c2..f043da5279f1dd 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -280,6 +280,15 @@ static inline void *phys_to_virt(phys_addr_t x) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) /* + * These are for systems that have a hardware interconnect supported alias of + * physical memory for idmap purposes. Most cases should leave these + * untouched. + */ +#ifndef virt_to_idmap +#define virt_to_idmap(x) virt_to_phys(x) +#endif + +/* * Virtual <-> DMA view memory address translations * Again, these are *only* valid on the kernel direct mapped RAM * memory. Use of these is *deprecated* (and that doesn't mean diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 67cf929f082a34..c1efb03e90ffa1 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -63,7 +63,7 @@ static DECLARE_COMPLETION(cpu_running); static unsigned long get_arch_pgd(pgd_t *pgd) { - phys_addr_t pgdir = virt_to_phys(pgd); + phys_addr_t pgdir = virt_to_idmap(pgd); BUG_ON(pgdir & ARCH_PGD_MASK); return pgdir >> ARCH_PGD_SHIFT; } diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c index ab88ed4f8e08f0..919cb6e40215a5 100644 --- a/arch/arm/mm/idmap.c +++ b/arch/arm/mm/idmap.c @@ -85,8 +85,8 @@ static int __init init_static_idmap(void) return -ENOMEM; /* Add an identity mapping for the physical address of the section. */ - idmap_start = virt_to_phys((void *)__idmap_text_start); - idmap_end = virt_to_phys((void *)__idmap_text_end); + idmap_start = virt_to_idmap((void *)__idmap_text_start); + idmap_end = virt_to_idmap((void *)__idmap_text_end); pr_info("Setting up static identity map for 0x%llx - 0x%llx\n", (long long)idmap_start, (long long)idmap_end); |