diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2016-04-13 05:20:02 +0300 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2016-07-24 06:33:58 +0300 |
commit | a9f2fc628e3a26a829fd79aff74eb49839d1e74b (patch) | |
tree | 7dad4e57c917757d39bb3470720392ac2b92b335 /arch/xtensa/include/asm/page.h | |
parent | d39af90265feb40ec198c4ca8268724645b4b50e (diff) |
xtensa: cleanup MMU setup and kernel layout macros
Make kernel load address explicit, independent of the selected MMU
configuration and configurable from Kconfig. Do not restrict it to the
first 512MB of the physical address space.
Cleanup kernel memory layout macros:
- rename VECBASE_RESET_VADDR to VECBASE_VADDR, XC_VADDR to VECTOR_VADDR;
- drop VIRTUAL_MEMORY_ADDRESS and LOAD_MEMORY_ADDRESS;
- introduce PHYS_OFFSET and use it in __va and __pa definitions;
- synchronize MMU/noMMU vectors, drop unused NMI vector;
- replace hardcoded vectors offset of 0x3000 with Kconfig symbol.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/page.h')
-rw-r--r-- | arch/xtensa/include/asm/page.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h index 8a02438232c4..3b5a49dbf8b2 100644 --- a/arch/xtensa/include/asm/page.h +++ b/arch/xtensa/include/asm/page.h @@ -27,10 +27,12 @@ #ifdef CONFIG_MMU #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR +#define PHYS_OFFSET XCHAL_KSEG_PADDR #define MAX_LOW_PFN (PHYS_PFN(XCHAL_KSEG_PADDR) + \ PHYS_PFN(XCHAL_KSEG_SIZE)) #else #define PAGE_OFFSET __XTENSA_UL_CONST(0) +#define PHYS_OFFSET __XTENSA_UL_CONST(0) #define MAX_LOW_PFN (PHYS_PFN(PLATFORM_DEFAULT_MEM_START) + \ PHYS_PFN(PLATFORM_DEFAULT_MEM_SIZE)) #endif @@ -163,8 +165,10 @@ void copy_user_highpage(struct page *to, struct page *from, #define ARCH_PFN_OFFSET (PLATFORM_DEFAULT_MEM_START >> PAGE_SHIFT) -#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) -#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) +#define __pa(x) \ + ((unsigned long) (x) - PAGE_OFFSET + PHYS_OFFSET) +#define __va(x) \ + ((void *)((unsigned long) (x) - PHYS_OFFSET + PAGE_OFFSET)) #define pfn_valid(pfn) \ ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr) |