提交 1f6c52ff 编写于 作者: P Paul Burton 提交者: Ralf Baechle

MIPS: detect presence of MAARs

Detect the presence of MAAR using the MRP bit in Config5, and record
that presence using a CPU option bit. A cpu_has_maar macro will then
allow code to conditionalise upon the presence of MAARs.
Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7330/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 e19d5dba
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
#ifndef cpu_has_rixiex #ifndef cpu_has_rixiex
#define cpu_has_rixiex (cpu_data[0].options & MIPS_CPU_RIXIEX) #define cpu_has_rixiex (cpu_data[0].options & MIPS_CPU_RIXIEX)
#endif #endif
#ifndef cpu_has_maar
#define cpu_has_maar (cpu_data[0].options & MIPS_CPU_MAAR)
#endif
/* /*
* For the moment we don't consider R6000 and R8000 so we can assume that * For the moment we don't consider R6000 and R8000 so we can assume that
......
...@@ -367,6 +367,7 @@ enum cpu_type_enum { ...@@ -367,6 +367,7 @@ enum cpu_type_enum {
#define MIPS_CPU_EVA 0x80000000ull /* CPU supports Enhanced Virtual Addressing */ #define MIPS_CPU_EVA 0x80000000ull /* CPU supports Enhanced Virtual Addressing */
#define MIPS_CPU_HTW 0x100000000ull /* CPU support Hardware Page Table Walker */ #define MIPS_CPU_HTW 0x100000000ull /* CPU support Hardware Page Table Walker */
#define MIPS_CPU_RIXIEX 0x200000000ull /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */ #define MIPS_CPU_RIXIEX 0x200000000ull /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */
#define MIPS_CPU_MAAR 0x400000000ull /* MAAR(I) registers are present */
/* /*
* CPU ASE encodings * CPU ASE encodings
......
...@@ -405,6 +405,8 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c) ...@@ -405,6 +405,8 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c)
if (config5 & MIPS_CONF5_EVA) if (config5 & MIPS_CONF5_EVA)
c->options |= MIPS_CPU_EVA; c->options |= MIPS_CPU_EVA;
if (config5 & MIPS_CONF5_MRP)
c->options |= MIPS_CPU_MAAR;
return config5 & MIPS_CONF_M; return config5 & MIPS_CONF_M;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册