diff options
Diffstat (limited to 'arch/xtensa/include/asm/page.h')
-rw-r--r-- | arch/xtensa/include/asm/page.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h index 11f7dc2dbec7..17e0c5383b10 100644 --- a/arch/xtensa/include/asm/page.h +++ b/arch/xtensa/include/asm/page.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/types.h> | 15 | #include <asm/types.h> |
16 | #include <asm/cache.h> | 16 | #include <asm/cache.h> |
17 | #include <platform/hardware.h> | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * Fixed TLB translations in the processor. | 20 | * Fixed TLB translations in the processor. |
@@ -32,8 +33,14 @@ | |||
32 | #define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT) | 33 | #define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT) |
33 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 34 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
34 | 35 | ||
36 | #ifdef CONFIG_MMU | ||
35 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR | 37 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR |
36 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE | 38 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE |
39 | #else | ||
40 | #define PAGE_OFFSET 0 | ||
41 | #define MAX_MEM_PFN (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE) | ||
42 | #endif | ||
43 | |||
37 | #define PGTABLE_START 0x80000000 | 44 | #define PGTABLE_START 0x80000000 |
38 | 45 | ||
39 | /* | 46 | /* |
@@ -150,9 +157,11 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*); | |||
150 | * addresses. | 157 | * addresses. |
151 | */ | 158 | */ |
152 | 159 | ||
160 | #define ARCH_PFN_OFFSET (PLATFORM_DEFAULT_MEM_START >> PAGE_SHIFT) | ||
161 | |||
153 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) | 162 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) |
154 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) | 163 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) |
155 | #define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr) | 164 | #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr) |
156 | #ifdef CONFIG_DISCONTIGMEM | 165 | #ifdef CONFIG_DISCONTIGMEM |
157 | # error CONFIG_DISCONTIGMEM not supported | 166 | # error CONFIG_DISCONTIGMEM not supported |
158 | #endif | 167 | #endif |
@@ -162,8 +171,9 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*); | |||
162 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 171 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
163 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 172 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
164 | 173 | ||
174 | #ifdef CONFIG_MMU | ||
165 | #define WANT_PAGE_VIRTUAL | 175 | #define WANT_PAGE_VIRTUAL |
166 | 176 | #endif | |
167 | 177 | ||
168 | #endif /* __ASSEMBLY__ */ | 178 | #endif /* __ASSEMBLY__ */ |
169 | 179 | ||