]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: MIPS16e2: Identify ASE presence
authorMaciej W. Rozycki <macro@imgtec.com>
Tue, 23 May 2017 12:37:05 +0000 (13:37 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 5 Jul 2017 12:06:44 +0000 (14:06 +0200)
Identify the presence of the MIPS16e2 ASE as per the architecture
specification[1], by checking for CP0 Config5.CA2 bit being 1[2].

References:

[1] "MIPS32 Architecture for Programmers: MIPS16e2 Application-Specific
    Extension Technical Reference Manual", Imagination Technologies
    Ltd., Document Number: MD01172, Revision 01.00, April 26, 2016,
    Section 1.2 "Software Detection of the ASE", p. 5

[2] "MIPS32 interAptiv Multiprocessing System Software User's Manual",
    Imagination Technologies Ltd., Document Number: MD00904, Revision
    02.01, June 15, 2016, Section 2.2.1.6 "Device Configuration 5 --
    Config5 (CP0 Register 16, Select 5)", pp. 71-72

Signed-off-by: Maciej W. Rozycki <macro@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16094/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/cpu-features.h
arch/mips/include/asm/cpu.h
arch/mips/include/asm/mipsregs.h
arch/mips/kernel/cpu-probe.c

index d6ea8e7c510794084b6e8a7397279f5e7718bc7c..8baa9033b181d2ca2e3f6e469315bdb8bf5345b5 100644 (file)
 #ifndef cpu_has_mips16
 #define cpu_has_mips16         (cpu_data[0].ases & MIPS_ASE_MIPS16)
 #endif
+#ifndef cpu_has_mips16e2
+#define cpu_has_mips16e2       (cpu_data[0].ases & MIPS_ASE_MIPS16E2)
+#endif
 #ifndef cpu_has_mdmx
 #define cpu_has_mdmx           (cpu_data[0].ases & MIPS_ASE_MDMX)
 #endif
index ce798594c868ab18de9ea16dd89b24a4ee3a2159..d0c152b989f8eea1f6d8380386f7997483329f70 100644 (file)
@@ -436,5 +436,6 @@ enum cpu_type_enum {
 #define MIPS_ASE_VZ            0x00000080 /* Virtualization ASE */
 #define MIPS_ASE_MSA           0x00000100 /* MIPS SIMD Architecture */
 #define MIPS_ASE_DSP3          0x00000200 /* Signal Processing ASE Rev 3*/
+#define MIPS_ASE_MIPS16E2      0x00000400 /* MIPS16e2 */
 
 #endif /* _ASM_CPU_H */
index 6875b69f59f763b9c492a054e2c027754866869c..dbb0eceda2c6d5cf05b347f561fc54cf19f7e635 100644 (file)
 #define MIPS_CONF5_SBRI                (_ULCAST_(1) << 6)
 #define MIPS_CONF5_FRE         (_ULCAST_(1) << 8)
 #define MIPS_CONF5_UFE         (_ULCAST_(1) << 9)
+#define MIPS_CONF5_CA2         (_ULCAST_(1) << 14)
 #define MIPS_CONF5_MSAEN       (_ULCAST_(1) << 27)
 #define MIPS_CONF5_EVA         (_ULCAST_(1) << 28)
 #define MIPS_CONF5_CV          (_ULCAST_(1) << 29)
index 3f0d43ce994ab7ce52cbf5527076d5f5b03d1ccd..d08afc7dc5072db9c55d4ca056a4422c03ab927e 100644 (file)
@@ -845,6 +845,8 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c)
                c->options |= MIPS_CPU_MVH;
        if (cpu_has_mips_r6 && (config5 & MIPS_CONF5_VP))
                c->options |= MIPS_CPU_VP;
+       if (config5 & MIPS_CONF5_CA2)
+               c->ases |= MIPS_ASE_MIPS16E2;
 
        return config5 & MIPS_CONF_M;
 }