Commit 63f2206a authored by Russell King's avatar Russell King Committed by Catalin Marinas

[ARM] ARMv6: add CPU_HAS_ASID configuration

Presently, we check for the minimum ARM architecture that we're
building for to determine whether we need ASID support.  This is
wrong - if we're going to support a range of CPUs which include
ARMv6 or higher, we need the ASID.

Convert the checks to use a new configuration symbol, and arrange
for ARMv6 and higher CPU entries to select it.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 68a0e9ad
...@@ -85,7 +85,7 @@ int main(void) ...@@ -85,7 +85,7 @@ int main(void)
DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0)); DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0));
DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs));
BLANK(); BLANK();
#if __LINUX_ARM_ARCH__ >= 6 #ifdef CONFIG_CPU_HAS_ASID
DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id));
BLANK(); BLANK();
#endif #endif
......
...@@ -351,6 +351,7 @@ config CPU_V6 ...@@ -351,6 +351,7 @@ config CPU_V6
select CPU_CACHE_V6 select CPU_CACHE_V6
select CPU_CACHE_VIPT select CPU_CACHE_VIPT
select CPU_CP15_MMU select CPU_CP15_MMU
select CPU_HAS_ASID
select CPU_COPY_V6 if MMU select CPU_COPY_V6 if MMU
select CPU_TLB_V6 if MMU select CPU_TLB_V6 if MMU
...@@ -476,6 +477,12 @@ config CPU_TLB_V6 ...@@ -476,6 +477,12 @@ config CPU_TLB_V6
endif endif
config CPU_HAS_ASID
bool
help
This indicates whether the CPU has the ASID register; used to
tag TLB and possibly cache entries.
config CPU_CP15 config CPU_CP15
bool bool
help help
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
typedef struct { typedef struct {
#if __LINUX_ARM_ARCH__ >= 6 #ifdef CONFIG_CPU_HAS_ASID
unsigned int id; unsigned int id;
#endif #endif
unsigned int kvm_seq; unsigned int kvm_seq;
} mm_context_t; } mm_context_t;
#if __LINUX_ARM_ARCH__ >= 6 #ifdef CONFIG_CPU_HAS_ASID
#define ASID(mm) ((mm)->context.id & 255) #define ASID(mm) ((mm)->context.id & 255)
#else #else
#define ASID(mm) (0) #define ASID(mm) (0)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
void __check_kvm_seq(struct mm_struct *mm); void __check_kvm_seq(struct mm_struct *mm);
#if __LINUX_ARM_ARCH__ >= 6 #ifdef CONFIG_CPU_HAS_ASID
/* /*
* On ARMv6, we have the following structure in the Context ID: * On ARMv6, we have the following structure in the Context ID:
......
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