diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-16 17:08:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-16 17:08:53 -0500 |
commit | a643fc7253261be2275c02cb33fa7bf4bfc8cdc4 (patch) | |
tree | a1dfb201555dd0082204e8a203e58690f099f501 /arch/xtensa/include | |
parent | 0db2812a5240f2663b92d8d4b761122dd2e0c6c3 (diff) | |
parent | 1f2fdbd0078cb2ad4251768e8c0e0bb652a2cbd6 (diff) |
Merge tag 'xtensa-next-20141215' of git://github.com/czankel/xtensa-linux
Pull Xtensa fixes from Chris Zankel:
- fix nommu support
- remove s6000 variant and s6105 platform
- fix permissions for kmapped pages so that copy_to_user_page works with them
- add power management menu to Kconfig to allow use of runtime PM
- disable linker optimizations because of a linker bug
- fix sparse error
* tag 'xtensa-next-20141215' of git://github.com/czankel/xtensa-linux:
xtensa: disable link optimization
xtensa/uaccess: fix sparse errors
xtensa: fix kmap_prot definition
xtensa: add power management menu to Kconfig
xtensa: remove s6000 variant and s6105 platform
xtensa: make PLATFORM_DEFAULT_MEM parameters configurable
xtensa: nommu: clean up memory map dump
xtensa: nommu: reserve memory below PLATFORM_DEFAULT_MEM_START
xtensa: nommu: set up cache and atomctl in initialize_mmu
xtensa: move vecbase SR initialization to _startup
xtensa: nommu: fix uImage load address
xtensa: nommu: fix load address definitions
xtensa: nommu: fix Image.elf reset code and ld script
xtensa: nommu: add MMU dependency to DEBUG_TLB_SANITY
xtensa: nommu: don't build most of the cache flushing code
xtensa: nommu: don't provide arch_get_unmapped_area
xtensa: nommu: provide MAP_UNINITIALIZED definition
xtensa: nommu: provide _PAGE_CHG_MASK definition
xtensa: nommu: provide __invalidate_dcache_page_alias stub
xtensa: nommu: move init_mmu stub to nommu_context.h
Diffstat (limited to 'arch/xtensa/include')
-rw-r--r-- | arch/xtensa/include/asm/cacheflush.h | 7 | ||||
-rw-r--r-- | arch/xtensa/include/asm/highmem.h | 2 | ||||
-rw-r--r-- | arch/xtensa/include/asm/initialize_mmu.h | 40 | ||||
-rw-r--r-- | arch/xtensa/include/asm/mmu_context.h | 4 | ||||
-rw-r--r-- | arch/xtensa/include/asm/nommu_context.h | 4 | ||||
-rw-r--r-- | arch/xtensa/include/asm/page.h | 12 | ||||
-rw-r--r-- | arch/xtensa/include/asm/pgtable.h | 1 | ||||
-rw-r--r-- | arch/xtensa/include/asm/uaccess.h | 4 | ||||
-rw-r--r-- | arch/xtensa/include/asm/vectors.h | 7 | ||||
-rw-r--r-- | arch/xtensa/include/uapi/asm/mman.h | 6 |
10 files changed, 65 insertions, 22 deletions
diff --git a/arch/xtensa/include/asm/cacheflush.h b/arch/xtensa/include/asm/cacheflush.h index e72aaca7a77f..5f67ace97b32 100644 --- a/arch/xtensa/include/asm/cacheflush.h +++ b/arch/xtensa/include/asm/cacheflush.h | |||
@@ -67,6 +67,8 @@ extern void __invalidate_dcache_page_alias(unsigned long, unsigned long); | |||
67 | #else | 67 | #else |
68 | static inline void __flush_invalidate_dcache_page_alias(unsigned long virt, | 68 | static inline void __flush_invalidate_dcache_page_alias(unsigned long virt, |
69 | unsigned long phys) { } | 69 | unsigned long phys) { } |
70 | static inline void __invalidate_dcache_page_alias(unsigned long virt, | ||
71 | unsigned long phys) { } | ||
70 | #endif | 72 | #endif |
71 | #if defined(CONFIG_MMU) && (ICACHE_WAY_SIZE > PAGE_SIZE) | 73 | #if defined(CONFIG_MMU) && (ICACHE_WAY_SIZE > PAGE_SIZE) |
72 | extern void __invalidate_icache_page_alias(unsigned long, unsigned long); | 74 | extern void __invalidate_icache_page_alias(unsigned long, unsigned long); |
@@ -84,7 +86,8 @@ static inline void __invalidate_icache_page_alias(unsigned long virt, | |||
84 | * (see also Documentation/cachetlb.txt) | 86 | * (see also Documentation/cachetlb.txt) |
85 | */ | 87 | */ |
86 | 88 | ||
87 | #if (DCACHE_WAY_SIZE > PAGE_SIZE) || defined(CONFIG_SMP) | 89 | #if defined(CONFIG_MMU) && \ |
90 | ((DCACHE_WAY_SIZE > PAGE_SIZE) || defined(CONFIG_SMP)) | ||
88 | 91 | ||
89 | #ifdef CONFIG_SMP | 92 | #ifdef CONFIG_SMP |
90 | void flush_cache_all(void); | 93 | void flush_cache_all(void); |
@@ -150,7 +153,7 @@ void local_flush_cache_page(struct vm_area_struct *vma, | |||
150 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 153 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
151 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 154 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
152 | 155 | ||
153 | #if (DCACHE_WAY_SIZE > PAGE_SIZE) | 156 | #if defined(CONFIG_MMU) && (DCACHE_WAY_SIZE > PAGE_SIZE) |
154 | 157 | ||
155 | extern void copy_to_user_page(struct vm_area_struct*, struct page*, | 158 | extern void copy_to_user_page(struct vm_area_struct*, struct page*, |
156 | unsigned long, void*, const void*, unsigned long); | 159 | unsigned long, void*, const void*, unsigned long); |
diff --git a/arch/xtensa/include/asm/highmem.h b/arch/xtensa/include/asm/highmem.h index 2c7901edffaf..01cef6b40829 100644 --- a/arch/xtensa/include/asm/highmem.h +++ b/arch/xtensa/include/asm/highmem.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT) | 25 | #define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT) |
26 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) | 26 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) |
27 | 27 | ||
28 | #define kmap_prot PAGE_KERNEL | 28 | #define kmap_prot PAGE_KERNEL_EXEC |
29 | 29 | ||
30 | #if DCACHE_WAY_SIZE > PAGE_SIZE | 30 | #if DCACHE_WAY_SIZE > PAGE_SIZE |
31 | #define get_pkmap_color get_pkmap_color | 31 | #define get_pkmap_color get_pkmap_color |
diff --git a/arch/xtensa/include/asm/initialize_mmu.h b/arch/xtensa/include/asm/initialize_mmu.h index 600781edc8a3..e256f2270ec9 100644 --- a/arch/xtensa/include/asm/initialize_mmu.h +++ b/arch/xtensa/include/asm/initialize_mmu.h | |||
@@ -26,8 +26,16 @@ | |||
26 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
27 | #include <asm/vectors.h> | 27 | #include <asm/vectors.h> |
28 | 28 | ||
29 | #if XCHAL_HAVE_PTP_MMU | ||
29 | #define CA_BYPASS (_PAGE_CA_BYPASS | _PAGE_HW_WRITE | _PAGE_HW_EXEC) | 30 | #define CA_BYPASS (_PAGE_CA_BYPASS | _PAGE_HW_WRITE | _PAGE_HW_EXEC) |
30 | #define CA_WRITEBACK (_PAGE_CA_WB | _PAGE_HW_WRITE | _PAGE_HW_EXEC) | 31 | #define CA_WRITEBACK (_PAGE_CA_WB | _PAGE_HW_WRITE | _PAGE_HW_EXEC) |
32 | #else | ||
33 | #define CA_WRITEBACK (0x4) | ||
34 | #endif | ||
35 | |||
36 | #ifndef XCHAL_SPANNING_WAY | ||
37 | #define XCHAL_SPANNING_WAY 0 | ||
38 | #endif | ||
31 | 39 | ||
32 | #ifdef __ASSEMBLY__ | 40 | #ifdef __ASSEMBLY__ |
33 | 41 | ||
@@ -75,7 +83,7 @@ | |||
75 | 83 | ||
76 | /* Step 1: invalidate mapping at 0x40000000..0x5FFFFFFF. */ | 84 | /* Step 1: invalidate mapping at 0x40000000..0x5FFFFFFF. */ |
77 | 85 | ||
78 | movi a2, 0x40000006 | 86 | movi a2, 0x40000000 | XCHAL_SPANNING_WAY |
79 | idtlb a2 | 87 | idtlb a2 |
80 | iitlb a2 | 88 | iitlb a2 |
81 | isync | 89 | isync |
@@ -141,9 +149,6 @@ | |||
141 | jx a4 | 149 | jx a4 |
142 | 150 | ||
143 | 1: | 151 | 1: |
144 | movi a2, VECBASE_RESET_VADDR | ||
145 | wsr a2, vecbase | ||
146 | |||
147 | /* Step 5: remove temporary mapping. */ | 152 | /* Step 5: remove temporary mapping. */ |
148 | idtlb a7 | 153 | idtlb a7 |
149 | iitlb a7 | 154 | iitlb a7 |
@@ -156,6 +161,33 @@ | |||
156 | #endif /* defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && | 161 | #endif /* defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && |
157 | XCHAL_HAVE_SPANNING_WAY */ | 162 | XCHAL_HAVE_SPANNING_WAY */ |
158 | 163 | ||
164 | #if !defined(CONFIG_MMU) && XCHAL_HAVE_TLBS | ||
165 | /* Enable data and instruction cache in the DEFAULT_MEMORY region | ||
166 | * if the processor has DTLB and ITLB. | ||
167 | */ | ||
168 | |||
169 | movi a5, PLATFORM_DEFAULT_MEM_START | XCHAL_SPANNING_WAY | ||
170 | movi a6, ~_PAGE_ATTRIB_MASK | ||
171 | movi a7, CA_WRITEBACK | ||
172 | movi a8, 0x20000000 | ||
173 | movi a9, PLATFORM_DEFAULT_MEM_SIZE | ||
174 | j 2f | ||
175 | 1: | ||
176 | sub a9, a9, a8 | ||
177 | 2: | ||
178 | rdtlb1 a3, a5 | ||
179 | ritlb1 a4, a5 | ||
180 | and a3, a3, a6 | ||
181 | and a4, a4, a6 | ||
182 | or a3, a3, a7 | ||
183 | or a4, a4, a7 | ||
184 | wdtlb a3, a5 | ||
185 | witlb a4, a5 | ||
186 | add a5, a5, a8 | ||
187 | bltu a8, a9, 1b | ||
188 | |||
189 | #endif | ||
190 | |||
159 | .endm | 191 | .endm |
160 | 192 | ||
161 | #endif /*__ASSEMBLY__*/ | 193 | #endif /*__ASSEMBLY__*/ |
diff --git a/arch/xtensa/include/asm/mmu_context.h b/arch/xtensa/include/asm/mmu_context.h index d33c71a8c9ec..04c8ebdc4517 100644 --- a/arch/xtensa/include/asm/mmu_context.h +++ b/arch/xtensa/include/asm/mmu_context.h | |||
@@ -50,11 +50,7 @@ DECLARE_PER_CPU(unsigned long, asid_cache); | |||
50 | #define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1) | 50 | #define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1) |
51 | #define ASID_INSERT(x) (0x03020001 | (((x) & ASID_MASK) << 8)) | 51 | #define ASID_INSERT(x) (0x03020001 | (((x) & ASID_MASK) << 8)) |
52 | 52 | ||
53 | #ifdef CONFIG_MMU | ||
54 | void init_mmu(void); | 53 | void init_mmu(void); |
55 | #else | ||
56 | static inline void init_mmu(void) { } | ||
57 | #endif | ||
58 | 54 | ||
59 | static inline void set_rasid_register (unsigned long val) | 55 | static inline void set_rasid_register (unsigned long val) |
60 | { | 56 | { |
diff --git a/arch/xtensa/include/asm/nommu_context.h b/arch/xtensa/include/asm/nommu_context.h index 3407cf7989b7..22984fd1d846 100644 --- a/arch/xtensa/include/asm/nommu_context.h +++ b/arch/xtensa/include/asm/nommu_context.h | |||
@@ -1,3 +1,7 @@ | |||
1 | static inline void init_mmu(void) | ||
2 | { | ||
3 | } | ||
4 | |||
1 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | 5 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) |
2 | { | 6 | { |
3 | } | 7 | } |
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h index abe24c6f8b2f..ad38500471fa 100644 --- a/arch/xtensa/include/asm/page.h +++ b/arch/xtensa/include/asm/page.h | |||
@@ -20,10 +20,10 @@ | |||
20 | * Fixed TLB translations in the processor. | 20 | * Fixed TLB translations in the processor. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define XCHAL_KSEG_CACHED_VADDR 0xd0000000 | 23 | #define XCHAL_KSEG_CACHED_VADDR __XTENSA_UL_CONST(0xd0000000) |
24 | #define XCHAL_KSEG_BYPASS_VADDR 0xd8000000 | 24 | #define XCHAL_KSEG_BYPASS_VADDR __XTENSA_UL_CONST(0xd8000000) |
25 | #define XCHAL_KSEG_PADDR 0x00000000 | 25 | #define XCHAL_KSEG_PADDR __XTENSA_UL_CONST(0x00000000) |
26 | #define XCHAL_KSEG_SIZE 0x08000000 | 26 | #define XCHAL_KSEG_SIZE __XTENSA_UL_CONST(0x08000000) |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * PAGE_SHIFT determines the page size | 29 | * PAGE_SHIFT determines the page size |
@@ -37,7 +37,7 @@ | |||
37 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR | 37 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR |
38 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE | 38 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE |
39 | #else | 39 | #else |
40 | #define PAGE_OFFSET 0 | 40 | #define PAGE_OFFSET __XTENSA_UL_CONST(0) |
41 | #define MAX_MEM_PFN (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE) | 41 | #define MAX_MEM_PFN (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE) |
42 | #endif | 42 | #endif |
43 | 43 | ||
@@ -145,7 +145,7 @@ extern void copy_page(void *to, void *from); | |||
145 | * some extra work | 145 | * some extra work |
146 | */ | 146 | */ |
147 | 147 | ||
148 | #if DCACHE_WAY_SIZE > PAGE_SIZE | 148 | #if defined(CONFIG_MMU) && DCACHE_WAY_SIZE > PAGE_SIZE |
149 | extern void clear_page_alias(void *vaddr, unsigned long paddr); | 149 | extern void clear_page_alias(void *vaddr, unsigned long paddr); |
150 | extern void copy_page_alias(void *to, void *from, | 150 | extern void copy_page_alias(void *to, void *from, |
151 | unsigned long to_paddr, unsigned long from_paddr); | 151 | unsigned long to_paddr, unsigned long from_paddr); |
diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index 0383aed59121..872bf0194e6d 100644 --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h | |||
@@ -178,6 +178,7 @@ | |||
178 | 178 | ||
179 | #else /* no mmu */ | 179 | #else /* no mmu */ |
180 | 180 | ||
181 | # define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) | ||
181 | # define PAGE_NONE __pgprot(0) | 182 | # define PAGE_NONE __pgprot(0) |
182 | # define PAGE_SHARED __pgprot(0) | 183 | # define PAGE_SHARED __pgprot(0) |
183 | # define PAGE_COPY __pgprot(0) | 184 | # define PAGE_COPY __pgprot(0) |
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index c7211e7e182d..876eb380aa26 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h | |||
@@ -320,7 +320,7 @@ __asm__ __volatile__( \ | |||
320 | ({ \ | 320 | ({ \ |
321 | long __gu_err, __gu_val; \ | 321 | long __gu_err, __gu_val; \ |
322 | __get_user_size(__gu_val,(ptr),(size),__gu_err); \ | 322 | __get_user_size(__gu_val,(ptr),(size),__gu_err); \ |
323 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 323 | (x) = (__force __typeof__(*(ptr)))__gu_val; \ |
324 | __gu_err; \ | 324 | __gu_err; \ |
325 | }) | 325 | }) |
326 | 326 | ||
@@ -330,7 +330,7 @@ __asm__ __volatile__( \ | |||
330 | const __typeof__(*(ptr)) *__gu_addr = (ptr); \ | 330 | const __typeof__(*(ptr)) *__gu_addr = (ptr); \ |
331 | if (access_ok(VERIFY_READ,__gu_addr,size)) \ | 331 | if (access_ok(VERIFY_READ,__gu_addr,size)) \ |
332 | __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \ | 332 | __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \ |
333 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 333 | (x) = (__force __typeof__(*(ptr)))__gu_val; \ |
334 | __gu_err; \ | 334 | __gu_err; \ |
335 | }) | 335 | }) |
336 | 336 | ||
diff --git a/arch/xtensa/include/asm/vectors.h b/arch/xtensa/include/asm/vectors.h index f74ddfbb92ef..a46c53f36113 100644 --- a/arch/xtensa/include/asm/vectors.h +++ b/arch/xtensa/include/asm/vectors.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define _XTENSA_VECTORS_H | 19 | #define _XTENSA_VECTORS_H |
20 | 20 | ||
21 | #include <variant/core.h> | 21 | #include <variant/core.h> |
22 | #include <platform/hardware.h> | ||
22 | 23 | ||
23 | #define XCHAL_KIO_CACHED_VADDR 0xe0000000 | 24 | #define XCHAL_KIO_CACHED_VADDR 0xe0000000 |
24 | #define XCHAL_KIO_BYPASS_VADDR 0xf0000000 | 25 | #define XCHAL_KIO_BYPASS_VADDR 0xf0000000 |
@@ -51,13 +52,13 @@ | |||
51 | /* MMU Not being used - Virtual == Physical */ | 52 | /* MMU Not being used - Virtual == Physical */ |
52 | 53 | ||
53 | /* VECBASE */ | 54 | /* VECBASE */ |
54 | #define VIRTUAL_MEMORY_ADDRESS 0x00002000 | 55 | #define VIRTUAL_MEMORY_ADDRESS (PLATFORM_DEFAULT_MEM_START + 0x2000) |
55 | 56 | ||
56 | /* Location of the start of the kernel text, _start */ | 57 | /* Location of the start of the kernel text, _start */ |
57 | #define KERNELOFFSET 0x00003000 | 58 | #define KERNELOFFSET (PLATFORM_DEFAULT_MEM_START + 0x3000) |
58 | 59 | ||
59 | /* Loaded just above possibly live vectors */ | 60 | /* Loaded just above possibly live vectors */ |
60 | #define LOAD_MEMORY_ADDRESS 0x00003000 | 61 | #define LOAD_MEMORY_ADDRESS (PLATFORM_DEFAULT_MEM_START + 0x3000) |
61 | 62 | ||
62 | #endif /* CONFIG_MMU */ | 63 | #endif /* CONFIG_MMU */ |
63 | 64 | ||
diff --git a/arch/xtensa/include/uapi/asm/mman.h b/arch/xtensa/include/uapi/asm/mman.h index 00eed6786d7e..201aec0e0446 100644 --- a/arch/xtensa/include/uapi/asm/mman.h +++ b/arch/xtensa/include/uapi/asm/mman.h | |||
@@ -55,6 +55,12 @@ | |||
55 | #define MAP_NONBLOCK 0x20000 /* do not block on IO */ | 55 | #define MAP_NONBLOCK 0x20000 /* do not block on IO */ |
56 | #define MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */ | 56 | #define MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */ |
57 | #define MAP_HUGETLB 0x80000 /* create a huge page mapping */ | 57 | #define MAP_HUGETLB 0x80000 /* create a huge page mapping */ |
58 | #ifdef CONFIG_MMAP_ALLOW_UNINITIALIZED | ||
59 | # define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be | ||
60 | * uninitialized */ | ||
61 | #else | ||
62 | # define MAP_UNINITIALIZED 0x0 /* Don't support this flag */ | ||
63 | #endif | ||
58 | 64 | ||
59 | /* | 65 | /* |
60 | * Flags for msync | 66 | * Flags for msync |