Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21966
b: refs/heads/master
c: 37caa93
h: refs/heads/master
v: v3
  • Loading branch information
Atsushi Nemoto authored and Ralf Baechle committed Mar 21, 2006
1 parent b8d0935 commit 930049d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbad8123f3a40a7b262e8e52d0bc10da67d719bb
refs/heads/master: 37caa934af02bc01d0e1366a49e1c89360fa0f29
25 changes: 9 additions & 16 deletions trunk/arch/mips/mm/sc-rm7k.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/bitops.h>

#include <asm/addrspace.h>
#include <asm/bcache.h>
Expand Down Expand Up @@ -43,14 +44,7 @@ static void rm7k_sc_wback_inv(unsigned long addr, unsigned long size)
/* Catch bad driver code */
BUG_ON(size == 0);

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;
}
blast_scache_range(addr, addr + size);

if (!rm7k_tcache_enabled)
return;
Expand All @@ -74,14 +68,7 @@ static void rm7k_sc_inv(unsigned long addr, unsigned long size)
/* Catch bad driver code */
BUG_ON(size == 0);

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;
}
blast_inv_scache_range(addr, addr + size);

if (!rm7k_tcache_enabled)
return;
Expand Down Expand Up @@ -143,11 +130,17 @@ struct bcache_ops rm7k_sc_ops = {

void __init rm7k_sc_init(void)
{
struct cpuinfo_mips *c = &current_cpu_data;
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) - 1;
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);

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-mips/r4kcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,5 +303,6 @@ __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, )
__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, )
/* blast_inv_dcache_range */
__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, )
__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, )

#endif /* _ASM_R4KCACHE_H */

0 comments on commit 930049d

Please sign in to comment.