diff options
author | Chris Dearman <chris@mips.com> | 2007-09-18 19:58:24 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-04-28 12:14:25 -0400 |
commit | 351336929ccf222ae38ff0cb7a8dd5fd5c6236a0 (patch) | |
tree | d9e9253bd30cf011d248ad3b63761a9a725e5cb0 /arch/mips/mm/c-r4k.c | |
parent | bec5052743ec8ae4c5669918cf9b130bf15709a2 (diff) |
[MIPS] Allow setting of the cache attribute at run time.
Slightly tacky, but there is a precedent in the sparc archirecture code.
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/c-r4k.c')
-rw-r--r-- | arch/mips/mm/c-r4k.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 77aefb4ebedd..3d3e53651341 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <linux/module.h> | ||
17 | #include <linux/bitops.h> | 18 | #include <linux/bitops.h> |
18 | 19 | ||
19 | #include <asm/bcache.h> | 20 | #include <asm/bcache.h> |
@@ -1216,9 +1217,25 @@ void au1x00_fixup_config_od(void) | |||
1216 | } | 1217 | } |
1217 | } | 1218 | } |
1218 | 1219 | ||
1220 | static int __cpuinitdata cca = -1; | ||
1221 | |||
1222 | static int __init cca_setup(char *str) | ||
1223 | { | ||
1224 | get_option(&str, &cca); | ||
1225 | |||
1226 | return 1; | ||
1227 | } | ||
1228 | |||
1229 | __setup("cca=", cca_setup); | ||
1230 | |||
1219 | static void __cpuinit coherency_setup(void) | 1231 | static void __cpuinit coherency_setup(void) |
1220 | { | 1232 | { |
1221 | change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT); | 1233 | if (cca < 0 || cca > 7) |
1234 | cca = read_c0_config() & CONF_CM_CMASK; | ||
1235 | _page_cachable_default = cca << _CACHE_SHIFT; | ||
1236 | |||
1237 | pr_debug("Using cache attribute %d\n", cca); | ||
1238 | change_c0_config(CONF_CM_CMASK, cca); | ||
1222 | 1239 | ||
1223 | /* | 1240 | /* |
1224 | * c0_status.cu=0 specifies that updates by the sc instruction use | 1241 | * c0_status.cu=0 specifies that updates by the sc instruction use |