summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/msa.h
diff options
context:
space:
mode:
authorSteven J. Hill <Steven.Hill@imgtec.com>2014-04-15 23:06:49 +0200
committerRalf Baechle <ralf@linux-mips.org>2014-06-04 22:50:41 +0200
commitd96cc3d1ec5dcbb49a5a990d699239d590624799 (patch)
tree5e37b4ff0bb650e046b78a57e63f999a5b5c6ffd /arch/mips/include/asm/msa.h
parentMIPS: Replace calls to obsolete strict_strto call with kstrto* equivalents. (diff)
downloadlinux-d96cc3d1ec5dcbb49a5a990d699239d590624799.tar.xz
linux-d96cc3d1ec5dcbb49a5a990d699239d590624799.zip
MIPS: Add microMIPS MSA support.
This patch adds support for the microMIPS implementation of the MSA instructions. Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com> Reviewed-by: Paul Burton <Paul.Burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6763/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/msa.h')
-rw-r--r--arch/mips/include/asm/msa.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/mips/include/asm/msa.h b/arch/mips/include/asm/msa.h
index a2aba6c3ec05..52450a040f44 100644
--- a/arch/mips/include/asm/msa.h
+++ b/arch/mips/include/asm/msa.h
@@ -96,6 +96,13 @@ static inline void write_msa_##name(unsigned int val) \
* allow compilation with toolchains that do not support MSA. Once all
* toolchains in use support MSA these can be removed.
*/
+#ifdef CONFIG_CPU_MICROMIPS
+#define CFC_MSA_INSN 0x587e0056
+#define CTC_MSA_INSN 0x583e0816
+#else
+#define CFC_MSA_INSN 0x787e0059
+#define CTC_MSA_INSN 0x783e0819
+#endif
#define __BUILD_MSA_CTL_REG(name, cs) \
static inline unsigned int read_msa_##name(void) \
@@ -104,7 +111,8 @@ static inline unsigned int read_msa_##name(void) \
__asm__ __volatile__( \
" .set push\n" \
" .set noat\n" \
- " .word 0x787e0059 | (" #cs " << 11)\n" \
+ " .insn\n" \
+ " .word #CFC_MSA_INSN | (" #cs " << 11)\n" \
" move %0, $1\n" \
" .set pop\n" \
: "=r"(reg)); \
@@ -117,7 +125,8 @@ static inline void write_msa_##name(unsigned int val) \
" .set push\n" \
" .set noat\n" \
" move $1, %0\n" \
- " .word 0x783e0819 | (" #cs " << 6)\n" \
+ " .insn\n" \
+ " .word #CTC_MSA_INSN | (" #cs " << 6)\n" \
" .set pop\n" \
: : "r"(val)); \
}