5 #include <linux/kernel.h>
6 #include <linux/sched.h>
13 #include <asm/pgtable.h>
14 #include <asm/mmu_context.h>
24 static void mips_sc_wback_inv(
unsigned long addr,
unsigned long size)
26 blast_scache_range(addr, addr + size);
32 static void mips_sc_inv(
unsigned long addr,
unsigned long size)
35 unsigned long almask = ~(lsize - 1);
39 blast_inv_scache_range(addr, addr + size);
42 static void mips_sc_enable(
void)
47 static void mips_sc_disable(
void)
53 .bc_enable = mips_sc_enable,
54 .bc_disable = mips_sc_disable,
55 .bc_wback_inv = mips_sc_wback_inv,
68 static inline int mips_sc_is_activated(
struct cpuinfo_mips *
c)
79 if (config2 & (1 << 12))
83 tmp = (config2 >> 4) & 0x0f;
84 if (0 < tmp && tmp <= 7)
91 static inline int __init mips_sc_probe(
void)
94 unsigned int config1, config2;
114 if (!mips_sc_is_activated(c))
117 tmp = (config2 >> 8) & 0x0f;
118 if (0 <= tmp && tmp <= 7)
123 tmp = (config2 >> 0) & 0x0f;
124 if (0 <= tmp && tmp <= 7)
139 int found = mips_sc_probe();
142 bcops = &mips_sc_ops;