forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/arch/mips/mm/page.c
....@@ -20,7 +20,6 @@
2020 #include <asm/inst.h>
2121 #include <asm/io.h>
2222 #include <asm/page.h>
23
-#include <asm/pgtable.h>
2423 #include <asm/prefetch.h>
2524 #include <asm/bootinfo.h>
2625 #include <asm/mipsregs.h>
....@@ -187,7 +186,7 @@
187186 }
188187 break;
189188
190
- case CPU_LOONGSON3:
189
+ case CPU_LOONGSON64:
191190 /* Loongson-3 only support the Pref_Load/Pref_Store. */
192191 pref_bias_clear_store = 128;
193192 pref_bias_copy_load = 128;
....@@ -251,14 +250,16 @@
251250 if (cpu_has_cache_cdex_s) {
252251 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0);
253252 } else if (cpu_has_cache_cdex_p) {
254
- if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) {
253
+ if (IS_ENABLED(CONFIG_WAR_R4600_V1_HIT_CACHEOP) &&
254
+ cpu_is_r4600_v1_x()) {
255255 uasm_i_nop(buf);
256256 uasm_i_nop(buf);
257257 uasm_i_nop(buf);
258258 uasm_i_nop(buf);
259259 }
260260
261
- if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
261
+ if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) &&
262
+ cpu_is_r4600_v2_x())
262263 uasm_i_lw(buf, ZERO, ZERO, AT);
263264
264265 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0);
....@@ -303,7 +304,7 @@
303304 else
304305 uasm_i_ori(&buf, A2, A0, off);
305306
306
- if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
307
+ if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) && cpu_is_r4600_v2_x())
307308 uasm_i_lui(&buf, AT, uasm_rel_hi(0xa0000000));
308309
309310 off = cache_line_size ? min(8, pref_bias_clear_store / cache_line_size)
....@@ -403,14 +404,16 @@
403404 if (cpu_has_cache_cdex_s) {
404405 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0);
405406 } else if (cpu_has_cache_cdex_p) {
406
- if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) {
407
+ if (IS_ENABLED(CONFIG_WAR_R4600_V1_HIT_CACHEOP) &&
408
+ cpu_is_r4600_v1_x()) {
407409 uasm_i_nop(buf);
408410 uasm_i_nop(buf);
409411 uasm_i_nop(buf);
410412 uasm_i_nop(buf);
411413 }
412414
413
- if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
415
+ if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) &&
416
+ cpu_is_r4600_v2_x())
414417 uasm_i_lw(buf, ZERO, ZERO, AT);
415418
416419 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0);
....@@ -454,7 +457,7 @@
454457 else
455458 uasm_i_ori(&buf, A2, A0, off);
456459
457
- if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
460
+ if (IS_ENABLED(CONFIG_WAR_R4600_V2_HIT_CACHEOP) && cpu_is_r4600_v2_x())
458461 uasm_i_lui(&buf, AT, uasm_rel_hi(0xa0000000));
459462
460463 off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) *