net: dsa: Report known silicon revisions for Marvell 88E6131
authorGuenter Roeck <linux@roeck-us.net>
Wed, 29 Oct 2014 17:44:55 +0000 (10:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Oct 2014 18:54:10 +0000 (14:54 -0400)
Report known silicon revisions when probing Marvell 88E6131 switches.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6131.c

index 244c735014fa47421b25091efd9b70077e1089e0..1230f52aa70e8c4d31e8be1d397f59eab9c4b7eb 100644 (file)
@@ -21,6 +21,7 @@
 #define ID_6085                0x04a0
 #define ID_6095                0x0950
 #define ID_6131                0x1060
+#define ID_6131_B2     0x1066
 
 static char *mv88e6131_probe(struct device *host_dev, int sw_addr)
 {
@@ -32,12 +33,15 @@ static char *mv88e6131_probe(struct device *host_dev, int sw_addr)
 
        ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03);
        if (ret >= 0) {
-               ret &= 0xfff0;
-               if (ret == ID_6085)
+               int ret_masked = ret & 0xfff0;
+
+               if (ret_masked == ID_6085)
                        return "Marvell 88E6085";
-               if (ret == ID_6095)
+               if (ret_masked == ID_6095)
                        return "Marvell 88E6095/88E6095F";
-               if (ret == ID_6131)
+               if (ret == ID_6131_B2)
+                       return "Marvell 88E6131 (B2)";
+               if (ret_masked == ID_6131)
                        return "Marvell 88E6131";
        }