File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,27 @@ static void flush_cache_leaf(unsigned int leaf)
63
63
} while (-- nr_nodes > 0 );
64
64
}
65
65
66
+ static void flush_cache_last_level (unsigned int leaf )
67
+ {
68
+ u64 addr ;
69
+ int i , j , nr_nodes ;
70
+ struct cache_desc * cdesc = current_cpu_data .cache_leaves + leaf ;
71
+
72
+ nr_nodes = loongson_sysconf .nr_nodes ;
73
+
74
+ addr = CSR_DMW1_BASE ;
75
+ iocsr_write32 (0x1 , 0x280 );
76
+ do {
77
+ for (i = 0 ; i < (cdesc -> ways * 3 ); i ++ ) {
78
+ for (j = 0 ; j < (cdesc -> sets ); j ++ ) {
79
+ * (volatile u32 * )addr ;
80
+ addr += cdesc -> linesz ;
81
+ }
82
+ }
83
+ addr += 0x100000000000 ;
84
+ } while (-- nr_nodes > 0 );
85
+ }
86
+
66
87
asmlinkage __visible void __flush_cache_all (void )
67
88
{
68
89
int leaf ;
@@ -71,7 +92,7 @@ asmlinkage __visible void __flush_cache_all(void)
71
92
72
93
leaf = cache_present - 1 ;
73
94
if (cache_inclusive (cdesc + leaf )) {
74
- flush_cache_leaf (leaf );
95
+ flush_cache_last_level (leaf );
75
96
return ;
76
97
}
77
98
You can’t perform that action at this time.
0 commit comments