diff options
-rw-r--r-- | arch/mips/mm/sc-mips.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c index d3f92a9e8310..42b50964c644 100644 --- a/arch/mips/mm/sc-mips.c +++ b/arch/mips/mm/sc-mips.c | |||
@@ -24,22 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | static void mips_sc_wback_inv(unsigned long addr, unsigned long size) | 25 | static void mips_sc_wback_inv(unsigned long addr, unsigned long size) |
26 | { | 26 | { |
27 | unsigned long sc_lsize = cpu_scache_line_size(); | 27 | blast_scache_range(addr, addr + size); |
28 | unsigned long end, a; | ||
29 | |||
30 | pr_debug("mips_sc_wback_inv[%08lx,%08lx]", addr, size); | ||
31 | |||
32 | /* Catch bad driver code */ | ||
33 | BUG_ON(size == 0); | ||
34 | |||
35 | a = addr & ~(sc_lsize - 1); | ||
36 | end = (addr + size - 1) & ~(sc_lsize - 1); | ||
37 | while (1) { | ||
38 | flush_scache_line(a); /* Hit_Writeback_Inv_SD */ | ||
39 | if (a == end) | ||
40 | break; | ||
41 | a += sc_lsize; | ||
42 | } | ||
43 | } | 28 | } |
44 | 29 | ||
45 | /* | 30 | /* |
@@ -47,22 +32,7 @@ static void mips_sc_wback_inv(unsigned long addr, unsigned long size) | |||
47 | */ | 32 | */ |
48 | static void mips_sc_inv(unsigned long addr, unsigned long size) | 33 | static void mips_sc_inv(unsigned long addr, unsigned long size) |
49 | { | 34 | { |
50 | unsigned long sc_lsize = cpu_scache_line_size(); | 35 | blast_inv_scache_range(addr, addr + size); |
51 | unsigned long end, a; | ||
52 | |||
53 | pr_debug("mips_sc_inv[%08lx,%08lx]", addr, size); | ||
54 | |||
55 | /* Catch bad driver code */ | ||
56 | BUG_ON(size == 0); | ||
57 | |||
58 | a = addr & ~(sc_lsize - 1); | ||
59 | end = (addr + size - 1) & ~(sc_lsize - 1); | ||
60 | while (1) { | ||
61 | invalidate_scache_line(a); /* Hit_Invalidate_SD */ | ||
62 | if (a == end) | ||
63 | break; | ||
64 | a += sc_lsize; | ||
65 | } | ||
66 | } | 36 | } |
67 | 37 | ||
68 | static void mips_sc_enable(void) | 38 | static void mips_sc_enable(void) |
@@ -123,6 +93,7 @@ static inline int __init mips_sc_probe(void) | |||
123 | return 0; | 93 | return 0; |
124 | 94 | ||
125 | c->scache.waysize = c->scache.sets * c->scache.linesz; | 95 | c->scache.waysize = c->scache.sets * c->scache.linesz; |
96 | c->scache.waybit = __ffs(c->scache.waysize); | ||
126 | 97 | ||
127 | c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; | 98 | c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; |
128 | 99 | ||