ce9366a200fec528b8f8c45a832a9f5848b93223
[linux-flexiantxendom0-3.2.10.git] / arch / mips / sni / pcimt_scache.c
1 /* $Id: pcimt_scache.c,v 1.4 1999/01/04 16:03:59 ralf Exp $
2  *
3  * arch/mips/sni/pcimt_scache.c
4  *
5  * This file is subject to the terms and conditions of the GNU General Public
6  * License.  See the file "COPYING" in the main directory of this archive
7  * for more details.
8  *
9  * Copyright (c) 1997, 1998 by Ralf Baechle
10  */
11 #include <linux/init.h>
12 #include <linux/kernel.h>
13 #include <asm/bcache.h>
14 #include <asm/sni.h>
15
16 #define cacheconf (*(volatile unsigned int *)PCIMT_CACHECONF)
17 #define invspace (*(volatile unsigned int *)PCIMT_INVSPACE)
18
19 void __init sni_pcimt_sc_init(void)
20 {
21         unsigned int scsiz, sc_size;
22
23         scsiz = cacheconf & 7;
24         if (scsiz == 0) {
25                 printk("Second level cache is deactived.\n");
26                 return;
27         }
28         if (scsiz >= 6) {
29                 printk("Invalid second level cache size configured, "
30                        "deactivating second level cache.\n");
31                 cacheconf = 0;
32                 return;
33         }
34
35         sc_size = 128 << scsiz;
36         printk("%dkb second level cache detected, deactivating.\n", sc_size);
37         cacheconf = 0;
38 }