diff options
author | David Howells <dhowells@redhat.com> | 2010-10-27 12:28:42 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2010-10-27 12:28:42 -0400 |
commit | 344af921e6f23ea82487d76918d2643fcc88c311 (patch) | |
tree | 28d3416e73616163bd82261d18606c7157190a9f /arch/mn10300 | |
parent | 0bc42d7fcb0acaab4202db97ff2de475424bf9b4 (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.h | 6 | ||||
-rw-r--r-- | arch/mn10300/include/asm/gdb-stub.h | 2 | ||||
-rw-r--r-- | arch/mn10300/include/asm/processor.h | 4 | ||||
-rw-r--r-- | arch/mn10300/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/mn10300/kernel/head.S | 6 | ||||
-rw-r--r-- | arch/mn10300/mm/Kconfig.cache | 3 |
6 files changed, 13 insertions, 10 deletions
diff --git a/arch/mn10300/include/asm/cacheflush.h b/arch/mn10300/include/asm/cacheflush.h index 29e692f7f030..b85be1d2fd32 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 | ||
39 | extern void flush_icache_range(unsigned long start, unsigned long end); | 39 | extern void flush_icache_range(unsigned long start, unsigned long end); |
40 | extern void flush_icache_page(struct vm_area_struct *vma, struct page *pg); | 40 | extern 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 |
65 | extern void mn10300_icache_inv(void); | 65 | extern void mn10300_icache_inv(void); |
66 | extern void mn10300_dcache_inv(void); | 66 | extern void mn10300_dcache_inv(void); |
67 | extern void mn10300_dcache_inv_page(unsigned start); | 67 | extern 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 41ed26763964..f5495ad82b77 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); | |||
110 | extern asmlinkage void __gdbstub_bug_trap(void); | 110 | extern asmlinkage void __gdbstub_bug_trap(void); |
111 | extern asmlinkage void __gdbstub_pause(void); | 111 | extern asmlinkage void __gdbstub_pause(void); |
112 | 112 | ||
113 | #ifndef CONFIG_MN10300_CACHE_DISABLED | 113 | #ifdef CONFIG_MN10300_CACHE_ENABLED |
114 | extern asmlinkage void gdbstub_purge_cache(void); | 114 | extern 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 f7d4b0d285e8..fd96c180e649 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 | ||
158 | static inline void prefetch(const void *x) | 158 | static 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 | ||
169 | static inline void prefetchw(const void *x) | 169 | static 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 23f2ab67574c..c4289e388071 100644 --- a/arch/mn10300/kernel/Makefile +++ b/arch/mn10300/kernel/Makefile | |||
@@ -17,7 +17,7 @@ obj-$(CONFIG_GDBSTUB) += gdb-stub.o gdb-low.o | |||
17 | obj-$(CONFIG_GDBSTUB_ON_TTYSx) += gdb-io-serial.o gdb-io-serial-low.o | 17 | obj-$(CONFIG_GDBSTUB_ON_TTYSx) += gdb-io-serial.o gdb-io-serial-low.o |
18 | obj-$(CONFIG_GDBSTUB_ON_TTYSMx) += gdb-io-ttysm.o gdb-io-ttysm-low.o | 18 | obj-$(CONFIG_GDBSTUB_ON_TTYSMx) += gdb-io-ttysm.o gdb-io-ttysm-low.o |
19 | 19 | ||
20 | ifneq ($(CONFIG_MN10300_CACHE_DISABLED),y) | 20 | ifeq ($(CONFIG_MN10300_CACHE_ENABLED),y) |
21 | obj-$(CONFIG_GDBSTUB) += gdb-cache.o | 21 | obj-$(CONFIG_GDBSTUB) += gdb-cache.o |
22 | endif | 22 | endif |
23 | 23 | ||
diff --git a/arch/mn10300/kernel/head.S b/arch/mn10300/kernel/head.S index 14f27f3bfaf4..a81e34fba651 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 f5599f47ec15..56a88dd9c70c 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 | ||
32 | endchoice | 32 | endchoice |
33 | |||
34 | config MN10300_CACHE_ENABLED | ||
35 | def_bool y if !MN10300_CACHE_DISABLED | ||