[MIPS] IP22/IP28: fix extracting board/chip rev
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>
Sun, 25 Nov 2007 10:27:06 +0000 (11:27 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 29 Jan 2008 10:14:58 +0000 (10:14 +0000)
Taken from Peter Fuersts IP28 patches

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
include/asm-mips/sgi/ioc.h

index f3e3dc9..343ed15 100644 (file)
@@ -138,8 +138,8 @@ struct sgioc_regs {
        u8 _sysid[3];
        volatile u8 sysid;
 #define SGIOC_SYSID_FULLHOUSE  0x01
-#define SGIOC_SYSID_BOARDREV(x)        ((x & 0xe0) > 5)
-#define SGIOC_SYSID_CHIPREV(x) ((x & 0x1e) > 1)
+#define SGIOC_SYSID_BOARDREV(x)        (((x) & 0x1e) >> 1)
+#define SGIOC_SYSID_CHIPREV(x) (((x) & 0xe0) >> 5)
        u32 _unused2;
        u8 _read[3];
        volatile u8 read;