rk: support dcache disable

This commit is contained in:
黄涛
2013-08-29 15:05:43 +08:00
parent 9ba1b1bcc5
commit bd9ac2a8d9
6 changed files with 9 additions and 7 deletions

View File

@@ -27,7 +27,7 @@
#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_set(v,i) (((v)->counter) = (i))
#if __LINUX_ARM_ARCH__ >= 6
#if __LINUX_ARM_ARCH__ >= 6 && !defined(CONFIG_CPU_DCACHE_DISABLE)
/*
* ARMv6 UP and SMP safe atomic ops. We use load exclusive and

View File

@@ -12,7 +12,7 @@
#ifndef __ASM_PROC_LOCKS_H
#define __ASM_PROC_LOCKS_H
#if __LINUX_ARM_ARCH__ >= 6
#if __LINUX_ARM_ARCH__ >= 6 && !defined(CONFIG_CPU_DCACHE_DISABLE)
#define __down_op(ptr,fail) \
({ \

View File

@@ -269,14 +269,14 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
#ifdef swp_is_buggy
unsigned long flags;
#endif
#if __LINUX_ARM_ARCH__ >= 6
#if __LINUX_ARM_ARCH__ >= 6 && !defined(CONFIG_CPU_DCACHE_DISABLE)
unsigned int tmp;
#endif
smp_mb();
switch (size) {
#if __LINUX_ARM_ARCH__ >= 6
#if __LINUX_ARM_ARCH__ >= 6 && !defined(CONFIG_CPU_DCACHE_DISABLE)
case 1:
asm volatile("@ __xchg1\n"
"1: ldrexb %0, [%3]\n"
@@ -346,7 +346,7 @@ void cpu_idle_wait(void);
#include <asm-generic/cmpxchg-local.h>
#if __LINUX_ARM_ARCH__ < 6
#if __LINUX_ARM_ARCH__ < 6 || defined(CONFIG_CPU_DCACHE_DISABLE)
/* min ARCH < ARMv6 */
#ifdef CONFIG_SMP

View File

@@ -905,7 +905,7 @@ __kuser_cmpxchg: @ 0xffff0fc0
ldmfd sp!, {r7, pc}
1: .word __ARM_NR_cmpxchg
#elif __LINUX_ARM_ARCH__ < 6
#elif __LINUX_ARM_ARCH__ < 6 || defined(CONFIG_CPU_DCACHE_DISABLE)
#ifdef CONFIG_MMU

View File

@@ -1,4 +1,4 @@
#if __LINUX_ARM_ARCH__ >= 6
#if __LINUX_ARM_ARCH__ >= 6 && !defined(CONFIG_CPU_DCACHE_DISABLE)
.macro bitop, instr
ands ip, r1, #3
strneb r1, [ip] @ assert word-aligned

View File

@@ -721,6 +721,8 @@ config CPU_ICACHE_DISABLE
config CPU_DCACHE_DISABLE
bool "Disable D-Cache (C-bit)"
depends on CPU_CP15
depends on !SMP && !SWP_EMULATE
select GENERIC_ATOMIC64
help
Say Y here to disable the processor data cache. Unless
you have a reason not to or are unsure, say N.