aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/mm')
-rw-r--r--arch/xtensa/mm/cache.c27
-rw-r--r--arch/xtensa/mm/fault.c1
-rw-r--r--arch/xtensa/mm/init.c16
-rw-r--r--arch/xtensa/mm/misc.S2
-rw-r--r--arch/xtensa/mm/tlb.c7
5 files changed, 25 insertions, 28 deletions
diff --git a/arch/xtensa/mm/cache.c b/arch/xtensa/mm/cache.c
index 85df4655d326..81edeab82d17 100644
--- a/arch/xtensa/mm/cache.c
+++ b/arch/xtensa/mm/cache.c
@@ -118,7 +118,7 @@ void flush_dcache_page(struct page *page)
118 * For now, flush the whole cache. FIXME?? 118 * For now, flush the whole cache. FIXME??
119 */ 119 */
120 120
121void flush_cache_range(struct vm_area_struct* vma, 121void flush_cache_range(struct vm_area_struct* vma,
122 unsigned long start, unsigned long end) 122 unsigned long start, unsigned long end)
123{ 123{
124 __flush_invalidate_dcache_all(); 124 __flush_invalidate_dcache_all();
@@ -133,7 +133,7 @@ void flush_cache_range(struct vm_area_struct* vma,
133 */ 133 */
134 134
135void flush_cache_page(struct vm_area_struct* vma, unsigned long address, 135void flush_cache_page(struct vm_area_struct* vma, unsigned long address,
136 unsigned long pfn) 136 unsigned long pfn)
137{ 137{
138 /* Note that we have to use the 'alias' address to avoid multi-hit */ 138 /* Note that we have to use the 'alias' address to avoid multi-hit */
139 139
@@ -166,14 +166,14 @@ update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t *ptep)
166 166
167 if (!PageReserved(page) && test_bit(PG_arch_1, &page->flags)) { 167 if (!PageReserved(page) && test_bit(PG_arch_1, &page->flags)) {
168 168
169 unsigned long vaddr = TLBTEMP_BASE_1 + (addr & DCACHE_ALIAS_MASK);
170 unsigned long paddr = (unsigned long) page_address(page); 169 unsigned long paddr = (unsigned long) page_address(page);
171 unsigned long phys = page_to_phys(page); 170 unsigned long phys = page_to_phys(page);
171 unsigned long tmp = TLBTEMP_BASE_1 + (addr & DCACHE_ALIAS_MASK);
172 172
173 __flush_invalidate_dcache_page(paddr); 173 __flush_invalidate_dcache_page(paddr);
174 174
175 __flush_invalidate_dcache_page_alias(vaddr, phys); 175 __flush_invalidate_dcache_page_alias(tmp, phys);
176 __invalidate_icache_page_alias(vaddr, phys); 176 __invalidate_icache_page_alias(tmp, phys);
177 177
178 clear_bit(PG_arch_1, &page->flags); 178 clear_bit(PG_arch_1, &page->flags);
179 } 179 }
@@ -195,7 +195,7 @@ update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t *ptep)
195 195
196#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK 196#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
197 197
198void copy_to_user_page(struct vm_area_struct *vma, struct page *page, 198void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
199 unsigned long vaddr, void *dst, const void *src, 199 unsigned long vaddr, void *dst, const void *src,
200 unsigned long len) 200 unsigned long len)
201{ 201{
@@ -205,8 +205,8 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
205 /* Flush and invalidate user page if aliased. */ 205 /* Flush and invalidate user page if aliased. */
206 206
207 if (alias) { 207 if (alias) {
208 unsigned long temp = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); 208 unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK);
209 __flush_invalidate_dcache_page_alias(temp, phys); 209 __flush_invalidate_dcache_page_alias(t, phys);
210 } 210 }
211 211
212 /* Copy data */ 212 /* Copy data */
@@ -219,12 +219,11 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
219 */ 219 */
220 220
221 if (alias) { 221 if (alias) {
222 unsigned long temp = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); 222 unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK);
223 223
224 __flush_invalidate_dcache_range((unsigned long) dst, len); 224 __flush_invalidate_dcache_range((unsigned long) dst, len);
225 if ((vma->vm_flags & VM_EXEC) != 0) { 225 if ((vma->vm_flags & VM_EXEC) != 0)
226 __invalidate_icache_page_alias(temp, phys); 226 __invalidate_icache_page_alias(t, phys);
227 }
228 227
229 } else if ((vma->vm_flags & VM_EXEC) != 0) { 228 } else if ((vma->vm_flags & VM_EXEC) != 0) {
230 __flush_dcache_range((unsigned long)dst,len); 229 __flush_dcache_range((unsigned long)dst,len);
@@ -245,8 +244,8 @@ extern void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
245 */ 244 */
246 245
247 if (alias) { 246 if (alias) {
248 unsigned long temp = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); 247 unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK);
249 __flush_invalidate_dcache_page_alias(temp, phys); 248 __flush_invalidate_dcache_page_alias(t, phys);
250 } 249 }
251 250
252 memcpy(dst, src, len); 251 memcpy(dst, src, len);
diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c
index 245b08f7eaf4..4b7bc8db170f 100644
--- a/arch/xtensa/mm/fault.c
+++ b/arch/xtensa/mm/fault.c
@@ -254,4 +254,3 @@ bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
254 die("Oops", regs, sig); 254 die("Oops", regs, sig);
255 do_exit(sig); 255 do_exit(sig);
256} 256}
257
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index db955179da2d..7a5156ffebb6 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -75,15 +75,15 @@ int __init mem_reserve(unsigned long start, unsigned long end, int must_exist)
75 sysmem.nr_banks++; 75 sysmem.nr_banks++;
76 } 76 }
77 sysmem.bank[i].end = start; 77 sysmem.bank[i].end = start;
78
79 } else if (end < sysmem.bank[i].end) {
80 sysmem.bank[i].start = end;
81
78 } else { 82 } else {
79 if (end < sysmem.bank[i].end) 83 /* remove entry */
80 sysmem.bank[i].start = end; 84 sysmem.nr_banks--;
81 else { 85 sysmem.bank[i].start = sysmem.bank[sysmem.nr_banks].start;
82 /* remove entry */ 86 sysmem.bank[i].end = sysmem.bank[sysmem.nr_banks].end;
83 sysmem.nr_banks--;
84 sysmem.bank[i].start = sysmem.bank[sysmem.nr_banks].start;
85 sysmem.bank[i].end = sysmem.bank[sysmem.nr_banks].end;
86 }
87 } 87 }
88 return -1; 88 return -1;
89} 89}
diff --git a/arch/xtensa/mm/misc.S b/arch/xtensa/mm/misc.S
index 7f7078f57c41..d97ed1ba7b0a 100644
--- a/arch/xtensa/mm/misc.S
+++ b/arch/xtensa/mm/misc.S
@@ -180,7 +180,7 @@ ENDPROC(clear_user_page)
180 180
181ENTRY(copy_user_page) 181ENTRY(copy_user_page)
182 182
183 entry a1, 32 183 entry a1, 32
184 184
185 /* Mark page dirty and determine alias for destination. */ 185 /* Mark page dirty and determine alias for destination. */
186 186
diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c
index 070fb7a25231..5411aa67c68e 100644
--- a/arch/xtensa/mm/tlb.c
+++ b/arch/xtensa/mm/tlb.c
@@ -82,7 +82,7 @@ void flush_tlb_mm(struct mm_struct *mm)
82#endif 82#endif
83 83
84void flush_tlb_range (struct vm_area_struct *vma, 84void flush_tlb_range (struct vm_area_struct *vma,
85 unsigned long start, unsigned long end) 85 unsigned long start, unsigned long end)
86{ 86{
87 struct mm_struct *mm = vma->vm_mm; 87 struct mm_struct *mm = vma->vm_mm;
88 unsigned long flags; 88 unsigned long flags;
@@ -100,7 +100,7 @@ void flush_tlb_range (struct vm_area_struct *vma,
100 int oldpid = get_rasid_register(); 100 int oldpid = get_rasid_register();
101 set_rasid_register (ASID_INSERT(mm->context)); 101 set_rasid_register (ASID_INSERT(mm->context));
102 start &= PAGE_MASK; 102 start &= PAGE_MASK;
103 if (vma->vm_flags & VM_EXEC) 103 if (vma->vm_flags & VM_EXEC)
104 while(start < end) { 104 while(start < end) {
105 invalidate_itlb_mapping(start); 105 invalidate_itlb_mapping(start);
106 invalidate_dtlb_mapping(start); 106 invalidate_dtlb_mapping(start);
@@ -130,7 +130,7 @@ void flush_tlb_page (struct vm_area_struct *vma, unsigned long page)
130 130
131 local_save_flags(flags); 131 local_save_flags(flags);
132 132
133 oldpid = get_rasid_register(); 133 oldpid = get_rasid_register();
134 134
135 if (vma->vm_flags & VM_EXEC) 135 if (vma->vm_flags & VM_EXEC)
136 invalidate_itlb_mapping(page); 136 invalidate_itlb_mapping(page);
@@ -140,4 +140,3 @@ void flush_tlb_page (struct vm_area_struct *vma, unsigned long page)
140 140
141 local_irq_restore(flags); 141 local_irq_restore(flags);
142} 142}
143