diff options
| author | Markos Chandras <markos.chandras@imgtec.com> | 2014-12-02 04:46:19 -0500 |
|---|---|---|
| committer | Markos Chandras <markos.chandras@imgtec.com> | 2015-02-17 10:37:36 -0500 |
| commit | 5aed9da128be27275b0892fb413f3a0af64e00a6 (patch) | |
| tree | 26e82f80645bce9b6eec9db18d219c736fbc925a | |
| parent | 28d6f93d201d20ce47a9e8414655569a78f0353c (diff) | |
MIPS: Add LLB bit and related feature for the Config 5 CP0 register
The LLBIT (bit 4) in the Config5 CP0 register indicates the software
availability of the Load-Linked bit. This bit is only set by hardware
and it has the following meaning:
0: LLB functionality is not supported
1: LLB functionality is supported. The following feature are also
supported:
- ERETNC instruction. Similar to ERET but it does not clear the LLB
bit in the LLAddr register.
- CP0 LLAddr/LLB bit must be set
- LLbit is software accessible through the LLAddr[0]
This will be used later on to emulate R2 LL/SC instructions.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
| -rw-r--r-- | arch/mips/include/asm/cpu-features.h | 3 | ||||
| -rw-r--r-- | arch/mips/include/asm/cpu.h | 1 | ||||
| -rw-r--r-- | arch/mips/include/asm/mipsregs.h | 1 | ||||
| -rw-r--r-- | arch/mips/kernel/cpu-probe.c | 2 |
4 files changed, 7 insertions, 0 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index 08d1bbe905eb..e686131ff995 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
| @@ -38,6 +38,9 @@ | |||
| 38 | #ifndef cpu_has_maar | 38 | #ifndef cpu_has_maar |
| 39 | #define cpu_has_maar (cpu_data[0].options & MIPS_CPU_MAAR) | 39 | #define cpu_has_maar (cpu_data[0].options & MIPS_CPU_MAAR) |
| 40 | #endif | 40 | #endif |
| 41 | #ifndef cpu_has_rw_llb | ||
| 42 | #define cpu_has_rw_llb (cpu_data[0].options & MIPS_CPU_RW_LLB) | ||
| 43 | #endif | ||
| 41 | 44 | ||
| 42 | /* | 45 | /* |
| 43 | * For the moment we don't consider R6000 and R8000 so we can assume that | 46 | * For the moment we don't consider R6000 and R8000 so we can assume that |
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h index f604523aec3d..15687234d70a 100644 --- a/arch/mips/include/asm/cpu.h +++ b/arch/mips/include/asm/cpu.h | |||
| @@ -376,6 +376,7 @@ enum cpu_type_enum { | |||
| 376 | #define MIPS_CPU_RIXIEX 0x200000000ull /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */ | 376 | #define MIPS_CPU_RIXIEX 0x200000000ull /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */ |
| 377 | #define MIPS_CPU_MAAR 0x400000000ull /* MAAR(I) registers are present */ | 377 | #define MIPS_CPU_MAAR 0x400000000ull /* MAAR(I) registers are present */ |
| 378 | #define MIPS_CPU_FRE 0x800000000ull /* FRE & UFE bits implemented */ | 378 | #define MIPS_CPU_FRE 0x800000000ull /* FRE & UFE bits implemented */ |
| 379 | #define MIPS_CPU_RW_LLB 0x1000000000ull /* LLADDR/LLB writes are allowed */ | ||
| 379 | 380 | ||
| 380 | /* | 381 | /* |
| 381 | * CPU ASE encodings | 382 | * CPU ASE encodings |
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 5e4aef304b02..093cd70e56ec 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
| @@ -653,6 +653,7 @@ | |||
| 653 | #define MIPS_CONF5_NF (_ULCAST_(1) << 0) | 653 | #define MIPS_CONF5_NF (_ULCAST_(1) << 0) |
| 654 | #define MIPS_CONF5_UFR (_ULCAST_(1) << 2) | 654 | #define MIPS_CONF5_UFR (_ULCAST_(1) << 2) |
| 655 | #define MIPS_CONF5_MRP (_ULCAST_(1) << 3) | 655 | #define MIPS_CONF5_MRP (_ULCAST_(1) << 3) |
| 656 | #define MIPS_CONF5_LLB (_ULCAST_(1) << 4) | ||
| 656 | #define MIPS_CONF5_MVH (_ULCAST_(1) << 5) | 657 | #define MIPS_CONF5_MVH (_ULCAST_(1) << 5) |
| 657 | #define MIPS_CONF5_FRE (_ULCAST_(1) << 8) | 658 | #define MIPS_CONF5_FRE (_ULCAST_(1) << 8) |
| 658 | #define MIPS_CONF5_UFE (_ULCAST_(1) << 9) | 659 | #define MIPS_CONF5_UFE (_ULCAST_(1) << 9) |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 1b9488a17f88..81f0aedbba0f 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
| @@ -514,6 +514,8 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c) | |||
| 514 | c->options |= MIPS_CPU_EVA; | 514 | c->options |= MIPS_CPU_EVA; |
| 515 | if (config5 & MIPS_CONF5_MRP) | 515 | if (config5 & MIPS_CONF5_MRP) |
| 516 | c->options |= MIPS_CPU_MAAR; | 516 | c->options |= MIPS_CPU_MAAR; |
| 517 | if (config5 & MIPS_CONF5_LLB) | ||
| 518 | c->options |= MIPS_CPU_RW_LLB; | ||
| 517 | 519 | ||
| 518 | return config5 & MIPS_CONF_M; | 520 | return config5 & MIPS_CONF_M; |
| 519 | } | 521 | } |
