Commit 344af921 authored by David Howells's avatar David Howells

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: default avatarDavid Howells <dhowells@redhat.com>
parent 0bc42d7f
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
/* /*
* physically-indexed cache management * physically-indexed cache management
*/ */
#ifndef CONFIG_MN10300_CACHE_DISABLED #ifdef CONFIG_MN10300_CACHE_ENABLED
extern void flush_icache_range(unsigned long start, unsigned long end); extern void flush_icache_range(unsigned long start, unsigned long end);
extern void flush_icache_page(struct vm_area_struct *vma, struct page *pg); 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,7 +61,7 @@ extern void flush_icache_page(struct vm_area_struct *vma, struct page *pg);
/* /*
* primitive routines * primitive routines
*/ */
#ifndef CONFIG_MN10300_CACHE_DISABLED #ifdef CONFIG_MN10300_CACHE_ENABLED
extern void mn10300_icache_inv(void); extern void mn10300_icache_inv(void);
extern void mn10300_dcache_inv(void); extern void mn10300_dcache_inv(void);
extern void mn10300_dcache_inv_page(unsigned start); extern void mn10300_dcache_inv_page(unsigned start);
...@@ -103,7 +103,7 @@ extern void mn10300_dcache_flush_inv_range2(unsigned start, unsigned size); ...@@ -103,7 +103,7 @@ extern void mn10300_dcache_flush_inv_range2(unsigned start, unsigned size);
#define mn10300_dcache_flush_page(start) do {} while (0) #define mn10300_dcache_flush_page(start) do {} while (0)
#define mn10300_dcache_flush_range(start, end) do {} while (0) #define mn10300_dcache_flush_range(start, end) do {} while (0)
#define mn10300_dcache_flush_range2(start, size) do {} while (0) #define mn10300_dcache_flush_range2(start, size) do {} while (0)
#endif /* CONFIG_MN10300_CACHE_DISABLED */ #endif /* CONFIG_MN10300_CACHE_ENABLED */
/* /*
* internal debugging function * internal debugging function
......
...@@ -110,7 +110,7 @@ extern asmlinkage void gdbstub_exception(struct pt_regs *, enum exception_code); ...@@ -110,7 +110,7 @@ extern asmlinkage void gdbstub_exception(struct pt_regs *, enum exception_code);
extern asmlinkage void __gdbstub_bug_trap(void); extern asmlinkage void __gdbstub_bug_trap(void);
extern asmlinkage void __gdbstub_pause(void); extern asmlinkage void __gdbstub_pause(void);
#ifndef CONFIG_MN10300_CACHE_DISABLED #ifdef CONFIG_MN10300_CACHE_ENABLED
extern asmlinkage void gdbstub_purge_cache(void); extern asmlinkage void gdbstub_purge_cache(void);
#else #else
#define gdbstub_purge_cache() do {} while (0) #define gdbstub_purge_cache() do {} while (0)
......
...@@ -157,7 +157,7 @@ unsigned long get_wchan(struct task_struct *p); ...@@ -157,7 +157,7 @@ unsigned long get_wchan(struct task_struct *p);
static inline void prefetch(const void *x) static inline void prefetch(const void *x)
{ {
#ifndef CONFIG_MN10300_CACHE_DISABLED #ifdef CONFIG_MN10300_CACHE_ENABLED
#ifdef CONFIG_MN10300_PROC_MN103E010 #ifdef CONFIG_MN10300_PROC_MN103E010
asm volatile ("nop; nop; dcpf (%0)" : : "r"(x)); asm volatile ("nop; nop; dcpf (%0)" : : "r"(x));
#else #else
...@@ -168,7 +168,7 @@ static inline void prefetch(const void *x) ...@@ -168,7 +168,7 @@ static inline void prefetch(const void *x)
static inline void prefetchw(const void *x) static inline void prefetchw(const void *x)
{ {
#ifndef CONFIG_MN10300_CACHE_DISABLED #ifdef CONFIG_MN10300_CACHE_ENABLED
#ifdef CONFIG_MN10300_PROC_MN103E010 #ifdef CONFIG_MN10300_PROC_MN103E010
asm volatile ("nop; nop; dcpf (%0)" : : "r"(x)); asm volatile ("nop; nop; dcpf (%0)" : : "r"(x));
#else #else
......
...@@ -17,7 +17,7 @@ obj-$(CONFIG_GDBSTUB) += gdb-stub.o gdb-low.o ...@@ -17,7 +17,7 @@ obj-$(CONFIG_GDBSTUB) += gdb-stub.o gdb-low.o
obj-$(CONFIG_GDBSTUB_ON_TTYSx) += gdb-io-serial.o gdb-io-serial-low.o obj-$(CONFIG_GDBSTUB_ON_TTYSx) += gdb-io-serial.o gdb-io-serial-low.o
obj-$(CONFIG_GDBSTUB_ON_TTYSMx) += gdb-io-ttysm.o gdb-io-ttysm-low.o obj-$(CONFIG_GDBSTUB_ON_TTYSMx) += gdb-io-ttysm.o gdb-io-ttysm-low.o
ifneq ($(CONFIG_MN10300_CACHE_DISABLED),y) ifeq ($(CONFIG_MN10300_CACHE_ENABLED),y)
obj-$(CONFIG_GDBSTUB) += gdb-cache.o obj-$(CONFIG_GDBSTUB) += gdb-cache.o
endif endif
......
...@@ -61,18 +61,18 @@ _start: ...@@ -61,18 +61,18 @@ _start:
btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
lne lne
#ifndef CONFIG_MN10300_CACHE_DISABLED #ifdef CONFIG_MN10300_CACHE_ENABLED
#ifdef CONFIG_MN10300_CACHE_WBACK #ifdef CONFIG_MN10300_CACHE_WBACK
#ifndef CONFIG_MN10300_CACHE_WBACK_NOWRALLOC #ifndef CONFIG_MN10300_CACHE_WBACK_NOWRALLOC
mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK,d0 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK,d0
#else #else
mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK|CHCTR_DCALMD,d0 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK|CHCTR_DCALMD,d0
#endif /* CACHE_DISABLED */ #endif /* NOWRALLOC */
#else #else
mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRTHROUGH,d0 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRTHROUGH,d0
#endif /* WBACK */ #endif /* WBACK */
movhu d0,(a0) # enable movhu d0,(a0) # enable
#endif /* NOWRALLOC */ #endif /* ENABLED */
# turn on RTS on the debug serial port if applicable # turn on RTS on the debug serial port if applicable
#ifdef CONFIG_MN10300_UNIT_ASB2305 #ifdef CONFIG_MN10300_UNIT_ASB2305
......
...@@ -30,3 +30,6 @@ config MN10300_CACHE_DISABLED ...@@ -30,3 +30,6 @@ config MN10300_CACHE_DISABLED
bool "Disabled" bool "Disabled"
endchoice endchoice
config MN10300_CACHE_ENABLED
def_bool y if !MN10300_CACHE_DISABLED
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment