]> git.itanic.dy.fi Git - linux-stable/commitdiff
[MIPS] Add macros to encode processor revisions.
authorRalf Baechle <ralf@linux-mips.org>
Fri, 6 Jul 2007 13:40:05 +0000 (14:40 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 6 Jul 2007 15:17:11 +0000 (16:17 +0100)
Older processors used to encode processor version and revision in two
4-bit bitfields, the 4K seems to simply count up and even newer MTI cores
have switched to use the 8-bits as 3:3:2 bitfield with the last field as
the patch number.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
include/asm-mips/cpu.h

index d38fdbf845b2612354a45c4fdfa6273f13aff156..2924069075e0a3b3a3342868d593de128ed880cc 100644 (file)
 #define PRID_REV_VR4181A       0x0070  /* Same as VR4122 */
 #define PRID_REV_VR4130                0x0080
 
+/*
+ * Older processors used to encode processor version and revision in two
+ * 4-bit bitfields, the 4K seems to simply count up and even newer MTI cores
+ * have switched to use the 8-bits as 3:3:2 bitfield with the last field as
+ * the patch number.  *ARGH*
+ */
+#define PRID_REV_ENCODE_44(ver, rev)                                   \
+       ((ver) << 4 | (rev))
+#define PRID_REV_ENCODE_332(ver, rev, patch)                           \
+       ((ver) << 5 | (rev) << 2 | (patch))
+
 /*
  * FPU implementation/revision register (CP1 control register 0).
  *