|
@@ -23,6 +23,7 @@
|
|
|
#include <asm/cpu-type.h>
|
|
|
#include <asm/fpu.h>
|
|
|
#include <asm/mipsregs.h>
|
|
|
+#include <asm/msa.h>
|
|
|
#include <asm/watch.h>
|
|
|
#include <asm/elf.h>
|
|
|
#include <asm/spram.h>
|
|
@@ -126,6 +127,20 @@ static inline int __cpu_has_fpu(void)
|
|
|
return ((cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE);
|
|
|
}
|
|
|
|
|
|
+static inline unsigned long cpu_get_msa_id(void)
|
|
|
+{
|
|
|
+ unsigned long status, conf5, msa_id;
|
|
|
+
|
|
|
+ status = read_c0_status();
|
|
|
+ __enable_fpu(FPU_64BIT);
|
|
|
+ conf5 = read_c0_config5();
|
|
|
+ enable_msa();
|
|
|
+ msa_id = read_msa_ir();
|
|
|
+ write_c0_config5(conf5);
|
|
|
+ write_c0_status(status);
|
|
|
+ return msa_id;
|
|
|
+}
|
|
|
+
|
|
|
static inline void cpu_probe_vmbits(struct cpuinfo_mips *c)
|
|
|
{
|
|
|
#ifdef __NEED_VMBITS_PROBE
|
|
@@ -301,6 +316,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
|
|
|
c->ases |= MIPS_ASE_VZ;
|
|
|
if (config3 & MIPS_CONF3_SC)
|
|
|
c->options |= MIPS_CPU_SEGMENTS;
|
|
|
+ if (config3 & MIPS_CONF3_MSA)
|
|
|
+ c->ases |= MIPS_ASE_MSA;
|
|
|
|
|
|
return config3 & MIPS_CONF_M;
|
|
|
}
|
|
@@ -1178,6 +1195,9 @@ void cpu_probe(void)
|
|
|
else
|
|
|
c->srsets = 1;
|
|
|
|
|
|
+ if (cpu_has_msa)
|
|
|
+ c->msa_id = cpu_get_msa_id();
|
|
|
+
|
|
|
cpu_probe_vmbits(c);
|
|
|
|
|
|
#ifdef CONFIG_64BIT
|
|
@@ -1194,4 +1214,6 @@ void cpu_report(void)
|
|
|
smp_processor_id(), c->processor_id, cpu_name_string());
|
|
|
if (c->options & MIPS_CPU_FPU)
|
|
|
printk(KERN_INFO "FPU revision is: %08x\n", c->fpu_id);
|
|
|
+ if (cpu_has_msa)
|
|
|
+ pr_info("MSA revision is: %08x\n", c->msa_id);
|
|
|
}
|