diff options
author | Steven J. Hill <Steven.Hill@imgtec.com> | 2013-03-25 14:47:29 -0400 |
---|---|---|
committer | Steven J. Hill <Steven.Hill@imgtec.com> | 2013-05-01 17:32:49 -0400 |
commit | b6d92b4a6bdb880b39789c677b952c53a437028d (patch) | |
tree | f14d30f02314d75860aa1ed12449410e6659513b /arch/mips/mm/c-r4k.c | |
parent | c34c09c81d659e13e15947580198fa652af3ca1a (diff) |
MIPS: Add option to disable software I/O coherency.
Some MIPS controllers have hardware I/O coherency. This patch
detects those and turns off software coherency. A new kernel
command line option also allows the user to manually turn
software coherency on or off.
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Diffstat (limited to 'arch/mips/mm/c-r4k.c')
-rw-r--r-- | arch/mips/mm/c-r4k.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 2078915eacb9..f5943ab44987 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/war.h> | 33 | #include <asm/war.h> |
34 | #include <asm/cacheflush.h> /* for run_uncached() */ | 34 | #include <asm/cacheflush.h> /* for run_uncached() */ |
35 | #include <asm/traps.h> | 35 | #include <asm/traps.h> |
36 | #include <asm/dma-coherence.h> | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * Special Variant of smp_call_function for use by cache functions: | 39 | * Special Variant of smp_call_function for use by cache functions: |
@@ -1377,20 +1378,6 @@ static void __cpuinit coherency_setup(void) | |||
1377 | } | 1378 | } |
1378 | } | 1379 | } |
1379 | 1380 | ||
1380 | #if defined(CONFIG_DMA_NONCOHERENT) | ||
1381 | |||
1382 | static int __cpuinitdata coherentio; | ||
1383 | |||
1384 | static int __init setcoherentio(char *str) | ||
1385 | { | ||
1386 | coherentio = 1; | ||
1387 | |||
1388 | return 0; | ||
1389 | } | ||
1390 | |||
1391 | early_param("coherentio", setcoherentio); | ||
1392 | #endif | ||
1393 | |||
1394 | static void __cpuinit r4k_cache_error_setup(void) | 1381 | static void __cpuinit r4k_cache_error_setup(void) |
1395 | { | 1382 | { |
1396 | extern char __weak except_vec2_generic; | 1383 | extern char __weak except_vec2_generic; |
@@ -1472,9 +1459,14 @@ void __cpuinit r4k_cache_init(void) | |||
1472 | 1459 | ||
1473 | build_clear_page(); | 1460 | build_clear_page(); |
1474 | build_copy_page(); | 1461 | build_copy_page(); |
1475 | #if !defined(CONFIG_MIPS_CMP) | 1462 | |
1463 | /* | ||
1464 | * We want to run CMP kernels on core with and without coherent | ||
1465 | * caches. Therefore, do not use CONFIG_MIPS_CMP to decide whether | ||
1466 | * or not to flush caches. | ||
1467 | */ | ||
1476 | local_r4k___flush_cache_all(NULL); | 1468 | local_r4k___flush_cache_all(NULL); |
1477 | #endif | 1469 | |
1478 | coherency_setup(); | 1470 | coherency_setup(); |
1479 | board_cache_error_setup = r4k_cache_error_setup; | 1471 | board_cache_error_setup = r4k_cache_error_setup; |
1480 | } | 1472 | } |