aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-10-27 12:28:42 -0400
committerDavid Howells <dhowells@redhat.com>2010-10-27 12:28:42 -0400
commit344af921e6f23ea82487d76918d2643fcc88c311 (patch)
tree28d3416e73616163bd82261d18606c7157190a9f /arch/mn10300
parent0bc42d7fcb0acaab4202db97ff2de475424bf9b4 (diff)
MN10300: Provide a MN10300_CACHE_ENABLED config option
Provide a MN10300_CACHE_ENABLED config option as inverted logic of MN10300_CACHE_DISABLED to make things simpler. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300')
-rw-r--r--arch/mn10300/include/asm/cacheflush.h6
-rw-r--r--arch/mn10300/include/asm/gdb-stub.h2
-rw-r--r--arch/mn10300/include/asm/processor.h4
-rw-r--r--arch/mn10300/kernel/Makefile2
-rw-r--r--arch/mn10300/kernel/head.S6
-rw-r--r--arch/mn10300/mm/Kconfig.cache3
6 files changed, 13 insertions, 10 deletions
diff --git a/arch/mn10300/include/asm/cacheflush.h b/arch/mn10300/include/asm/cacheflush.h
index 29e692f7f03..b85be1d2fd3 100644
--- a/arch/mn10300/include/asm/cacheflush.h
+++ b/arch/mn10300/include/asm/cacheflush.h
@@ -34,7 +34,7 @@
34/* 34/*
35 * physically-indexed cache management 35 * physically-indexed cache management
36 */ 36 */
37#ifndef CONFIG_MN10300_CACHE_DISABLED 37#ifdef CONFIG_MN10300_CACHE_ENABLED
38 38
39extern void flush_icache_range(unsigned long start, unsigned long end); 39extern void flush_icache_range(unsigned long start, unsigned long end);
40extern void flush_icache_page(struct vm_area_struct *vma, struct page *pg); 40extern void flush_icache_page(struct vm_area_struct *vma, struct page *pg);
@@ -61,7 +61,7 @@ extern void flush_icache_page(struct vm_area_struct *vma, struct page *pg);
61/* 61/*
62 * primitive routines 62 * primitive routines
63 */ 63 */
64#ifndef CONFIG_MN10300_CACHE_DISABLED 64#ifdef CONFIG_MN10300_CACHE_ENABLED
65extern void mn10300_icache_inv(void); 65extern void mn10300_icache_inv(void);
66extern void mn10300_dcache_inv(void); 66extern void mn10300_dcache_inv(void);
67extern void mn10300_dcache_inv_page(unsigned start); 67extern void mn10300_dcache_inv_page(unsigned start);
@@ -103,7 +103,7 @@ extern void mn10300_dcache_flush_inv_range2(unsigned start, unsigned size);
103#define mn10300_dcache_flush_page(start) do {} while (0) 103#define mn10300_dcache_flush_page(start) do {} while (0)
104#define mn10300_dcache_flush_range(start, end) do {} while (0) 104#define mn10300_dcache_flush_range(start, end) do {} while (0)
105#define mn10300_dcache_flush_range2(start, size) do {} while (0) 105#define mn10300_dcache_flush_range2(start, size) do {} while (0)
106#endif /* CONFIG_MN10300_CACHE_DISABLED */ 106#endif /* CONFIG_MN10300_CACHE_ENABLED */
107 107
108/* 108/*
109 * internal debugging function 109 * internal debugging function
diff --git a/arch/mn10300/include/asm/gdb-stub.h b/arch/mn10300/include/asm/gdb-stub.h
index 41ed2676396..f5495ad82b7 100644
--- a/arch/mn10300/include/asm/gdb-stub.h
+++ b/arch/mn10300/include/asm/gdb-stub.h
@@ -110,7 +110,7 @@ extern asmlinkage void gdbstub_exception(struct pt_regs *, enum exception_code);
110extern asmlinkage void __gdbstub_bug_trap(void); 110extern asmlinkage void __gdbstub_bug_trap(void);
111extern asmlinkage void __gdbstub_pause(void); 111extern asmlinkage void __gdbstub_pause(void);
112 112
113#ifndef CONFIG_MN10300_CACHE_DISABLED 113#ifdef CONFIG_MN10300_CACHE_ENABLED
114extern asmlinkage void gdbstub_purge_cache(void); 114extern asmlinkage void gdbstub_purge_cache(void);
115#else 115#else
116#define gdbstub_purge_cache() do {} while (0) 116#define gdbstub_purge_cache() do {} while (0)
diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h
index f7d4b0d285e..fd96c180e64 100644
--- a/arch/mn10300/include/asm/processor.h
+++ b/arch/mn10300/include/asm/processor.h
@@ -157,7 +157,7 @@ unsigned long get_wchan(struct task_struct *p);
157 157
158static inline void prefetch(const void *x) 158static inline void prefetch(const void *x)
159{ 159{
160#ifndef CONFIG_MN10300_CACHE_DISABLED 160#ifdef CONFIG_MN10300_CACHE_ENABLED
161#ifdef CONFIG_MN10300_PROC_MN103E010 161#ifdef CONFIG_MN10300_PROC_MN103E010
162 asm volatile ("nop; nop; dcpf (%0)" : : "r"(x)); 162 asm volatile ("nop; nop; dcpf (%0)" : : "r"(x));
163#else 163#else
@@ -168,7 +168,7 @@ static inline void prefetch(const void *x)
168 168
169static inline void prefetchw(const void *x) 169static inline void prefetchw(const void *x)
170{ 170{
171#ifndef CONFIG_MN10300_CACHE_DISABLED 171#ifdef CONFIG_MN10300_CACHE_ENABLED
172#ifdef CONFIG_MN10300_PROC_MN103E010 172#ifdef CONFIG_MN10300_PROC_MN103E010
173 asm volatile ("nop; nop; dcpf (%0)" : : "r"(x)); 173 asm volatile ("nop; nop; dcpf (%0)" : : "r"(x));
174#else 174#else
diff --git a/arch/mn10300/kernel/Makefile b/arch/mn10300/kernel/Makefile
index 23f2ab67574..c4289e38807 100644
--- a/arch/mn10300/kernel/Makefile
+++ b/arch/mn10300/kernel/Makefile
@@ -17,7 +17,7 @@ obj-$(CONFIG_GDBSTUB) += gdb-stub.o gdb-low.o
17obj-$(CONFIG_GDBSTUB_ON_TTYSx) += gdb-io-serial.o gdb-io-serial-low.o 17obj-$(CONFIG_GDBSTUB_ON_TTYSx) += gdb-io-serial.o gdb-io-serial-low.o
18obj-$(CONFIG_GDBSTUB_ON_TTYSMx) += gdb-io-ttysm.o gdb-io-ttysm-low.o 18obj-$(CONFIG_GDBSTUB_ON_TTYSMx) += gdb-io-ttysm.o gdb-io-ttysm-low.o
19 19
20ifneq ($(CONFIG_MN10300_CACHE_DISABLED),y) 20ifeq ($(CONFIG_MN10300_CACHE_ENABLED),y)
21obj-$(CONFIG_GDBSTUB) += gdb-cache.o 21obj-$(CONFIG_GDBSTUB) += gdb-cache.o
22endif 22endif
23 23
diff --git a/arch/mn10300/kernel/head.S b/arch/mn10300/kernel/head.S
index 14f27f3bfaf..a81e34fba65 100644
--- a/arch/mn10300/kernel/head.S
+++ b/arch/mn10300/kernel/head.S
@@ -61,18 +61,18 @@ _start:
61 btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy 61 btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
62 lne 62 lne
63 63
64#ifndef CONFIG_MN10300_CACHE_DISABLED 64#ifdef CONFIG_MN10300_CACHE_ENABLED
65#ifdef CONFIG_MN10300_CACHE_WBACK 65#ifdef CONFIG_MN10300_CACHE_WBACK
66#ifndef CONFIG_MN10300_CACHE_WBACK_NOWRALLOC 66#ifndef CONFIG_MN10300_CACHE_WBACK_NOWRALLOC
67 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK,d0 67 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK,d0
68#else 68#else
69 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK|CHCTR_DCALMD,d0 69 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK|CHCTR_DCALMD,d0
70#endif /* CACHE_DISABLED */ 70#endif /* NOWRALLOC */
71#else 71#else
72 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRTHROUGH,d0 72 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRTHROUGH,d0
73#endif /* WBACK */ 73#endif /* WBACK */
74 movhu d0,(a0) # enable 74 movhu d0,(a0) # enable
75#endif /* NOWRALLOC */ 75#endif /* ENABLED */
76 76
77 # turn on RTS on the debug serial port if applicable 77 # turn on RTS on the debug serial port if applicable
78#ifdef CONFIG_MN10300_UNIT_ASB2305 78#ifdef CONFIG_MN10300_UNIT_ASB2305
diff --git a/arch/mn10300/mm/Kconfig.cache b/arch/mn10300/mm/Kconfig.cache
index f5599f47ec1..56a88dd9c70 100644
--- a/arch/mn10300/mm/Kconfig.cache
+++ b/arch/mn10300/mm/Kconfig.cache
@@ -30,3 +30,6 @@ config MN10300_CACHE_DISABLED
30 bool "Disabled" 30 bool "Disabled"
31 31
32endchoice 32endchoice
33
34config MN10300_CACHE_ENABLED
35 def_bool y if !MN10300_CACHE_DISABLED