git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
arch
/
mips
/
mm
/
sc-rm7k.c
diff --git
a/arch/mips/mm/sc-rm7k.c
b/arch/mips/mm/sc-rm7k.c
index
31ec730
..
9e8ff8b
100644
(file)
--- a/
arch/mips/mm/sc-rm7k.c
+++ b/
arch/mips/mm/sc-rm7k.c
@@
-9,7
+9,6
@@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mm.h>
-#include <linux/bitops.h>
#include <asm/addrspace.h>
#include <asm/bcache.h>
#include <asm/addrspace.h>
#include <asm/bcache.h>
@@
-44,7
+43,14
@@
static void rm7k_sc_wback_inv(unsigned long addr, unsigned long size)
/* Catch bad driver code */
BUG_ON(size == 0);
/* Catch bad driver code */
BUG_ON(size == 0);
- blast_scache_range(addr, addr + size);
+ a = addr & ~(sc_lsize - 1);
+ end = (addr + size - 1) & ~(sc_lsize - 1);
+ while (1) {
+ flush_scache_line(a); /* Hit_Writeback_Inv_SD */
+ if (a == end)
+ break;
+ a += sc_lsize;
+ }
if (!rm7k_tcache_enabled)
return;
if (!rm7k_tcache_enabled)
return;
@@
-68,7
+74,14
@@
static void rm7k_sc_inv(unsigned long addr, unsigned long size)
/* Catch bad driver code */
BUG_ON(size == 0);
/* Catch bad driver code */
BUG_ON(size == 0);
- blast_inv_scache_range(addr, addr + size);
+ a = addr & ~(sc_lsize - 1);
+ end = (addr + size - 1) & ~(sc_lsize - 1);
+ while (1) {
+ invalidate_scache_line(a); /* Hit_Invalidate_SD */
+ if (a == end)
+ break;
+ a += sc_lsize;
+ }
if (!rm7k_tcache_enabled)
return;
if (!rm7k_tcache_enabled)
return;
@@
-130,17
+143,11
@@
struct bcache_ops rm7k_sc_ops = {
void __init rm7k_sc_init(void)
{
void __init rm7k_sc_init(void)
{
- struct cpuinfo_mips *c = ¤t_cpu_data;
unsigned int config = read_c0_config();
if ((config & RM7K_CONF_SC))
return;
unsigned int config = read_c0_config();
if ((config & RM7K_CONF_SC))
return;
- c->scache.linesz = sc_lsize;
- c->scache.ways = 4;
- c->scache.waybit= __ffs(scache_size / c->scache.ways);
- c->scache.waysize = scache_size / c->scache.ways;
- c->scache.sets = scache_size / (c->scache.linesz * c->scache.ways);
printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n",
(scache_size >> 10), sc_lsize);
printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n",
(scache_size >> 10), sc_lsize);