forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/mips/mm/c-tx39.c
....@@ -17,7 +17,6 @@
1717
1818 #include <asm/cacheops.h>
1919 #include <asm/page.h>
20
-#include <asm/pgtable.h>
2120 #include <asm/mmu_context.h>
2221 #include <asm/isadep.h>
2322 #include <asm/io.h>
....@@ -169,8 +168,6 @@
169168 {
170169 int exec = vma->vm_flags & VM_EXEC;
171170 struct mm_struct *mm = vma->vm_mm;
172
- pgd_t *pgdp;
173
- pud_t *pudp;
174171 pmd_t *pmdp;
175172 pte_t *ptep;
176173
....@@ -182,10 +179,8 @@
182179 return;
183180
184181 page &= PAGE_MASK;
185
- pgdp = pgd_offset(mm, page);
186
- pudp = pud_offset(pgdp, page);
187
- pmdp = pmd_offset(pudp, page);
188
- ptep = pte_offset(pmdp, page);
182
+ pmdp = pmd_off(mm, page);
183
+ ptep = pte_offset_kernel(pmdp, page);
189184
190185 /*
191186 * If the page isn't marked valid, the page cannot possibly be
....@@ -290,25 +285,6 @@
290285 }
291286 }
292287
293
-static void tx39_flush_cache_sigtramp(unsigned long addr)
294
-{
295
- unsigned long ic_lsize = current_cpu_data.icache.linesz;
296
- unsigned long dc_lsize = current_cpu_data.dcache.linesz;
297
- unsigned long config;
298
- unsigned long flags;
299
-
300
- protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
301
-
302
- /* disable icache (set ICE#) */
303
- local_irq_save(flags);
304
- config = read_c0_conf();
305
- write_c0_conf(config & ~TX39_CONF_ICE);
306
- TX39_STOP_STREAMING();
307
- protected_flush_icache_line(addr & ~(ic_lsize - 1));
308
- write_c0_conf(config);
309
- local_irq_restore(flags);
310
-}
311
-
312288 static __init void tx39_probe_cache(void)
313289 {
314290 unsigned long config;
....@@ -368,7 +344,6 @@
368344 flush_icache_range = (void *) tx39h_flush_icache_all;
369345 local_flush_icache_range = (void *) tx39h_flush_icache_all;
370346
371
- flush_cache_sigtramp = (void *) tx39h_flush_icache_all;
372347 local_flush_data_cache_page = (void *) tx39h_flush_icache_all;
373348 flush_data_cache_page = (void *) tx39h_flush_icache_all;
374349
....@@ -397,7 +372,6 @@
397372
398373 __flush_kernel_vmap_range = tx39_flush_kernel_vmap_range;
399374
400
- flush_cache_sigtramp = tx39_flush_cache_sigtramp;
401375 local_flush_data_cache_page = local_tx39_flush_data_cache_page;
402376 flush_data_cache_page = tx39_flush_data_cache_page;
403377
....@@ -429,9 +403,9 @@
429403 current_cpu_data.icache.waybit = 0;
430404 current_cpu_data.dcache.waybit = 0;
431405
432
- printk("Primary instruction cache %ldkB, linesize %d bytes\n",
406
+ pr_info("Primary instruction cache %ldkB, linesize %d bytes\n",
433407 icache_size >> 10, current_cpu_data.icache.linesz);
434
- printk("Primary data cache %ldkB, linesize %d bytes\n",
408
+ pr_info("Primary data cache %ldkB, linesize %d bytes\n",
435409 dcache_size >> 10, current_cpu_data.dcache.linesz);
436410
437411 build_clear_page();