Skip to contentSkip to conversation

dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches.

PATCH In review Chris Healy 4 participants 5 messages Jan 23, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches.

Add reporting of silicon revision during the probe function for Marvell 88E6123/88E6161/88E6165 switches.

---
 drivers/net/dsa/mv88e6123_61_65.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
drivers/net/dsa/mv88e6123_61_65.c +17 -4
index c0a458f..6f23c95 100644
@@ -20,12 +20,25 @@ static char *mv88e6123_61_65_probe(struct mii_bus *bus, int sw_addr)
 
 	ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03);
 	if (ret >= 0) {
-		ret &= 0xfff0;
-		if (ret == 0x1210)
+		if (ret == 0x1212)
+			return "Marvell 88E6123 (A1)";
+		if (ret == 0x1213)
+			return "Marvell 88E6123 (A2)";
+		if ((ret & 0xfff0) == 0x1210)
 			return "Marvell 88E6123";
-		if (ret == 0x1610)
+
+		if (ret == 0x1612)
+			return "Marvell 88E6161 (A1)";
+		if (ret == 0x1613)
+			return "Marvell 88E6161 (A2)";
+		if ((ret & 0xfff0) == 0x1610)
 			return "Marvell 88E6161";
-		if (ret == 0x1650)
+
+		if (ret == 0x1652)
+			return "Marvell 88E6165 (A1)";
+		if (ret == 0x1653)
+			return "Marvell 88e6165 (A2)";
+		if ((ret & 0xfff0) == 0x1650)
 			return "Marvell 88E6165";
 	}
 
Signature · 1 line
1.7.5.4
#1 lore raw

Hello,

Quoted 30 lines · Chris Healy

Add reporting of silicon revision during the probe function for Marvell 88E6123/88E6161/88E6165 switches.

---
  drivers/net/dsa/mv88e6123_61_65.c |   21 +++++++++++++++++----
  1 files changed, 17 insertions(+), 4 deletions(-)
drivers/net/dsa/mv88e6123_61_65.c +11 -3
index c0a458f..6f23c95 100644
@@ -20,12 +20,25 @@ static char *mv88e6123_61_65_probe(struct mii_bus *bus, int sw_addr)
 
  	ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03);
  	if (ret>= 0) {
-		ret&= 0xfff0;
-		if (ret == 0x1210)
+		if (ret == 0x1212)
+			return "Marvell 88E6123 (A1)";
+		if (ret == 0x1213)
+			return "Marvell 88E6123 (A2)";
+		if ((ret&  0xfff0) == 0x1210)
  			return "Marvell 88E6123";
-		if (ret == 0x1610)
+
+		if (ret == 0x1612)
+			return "Marvell 88E6161 (A1)";
+		if (ret == 0x1613)
+			return "Marvell 88E6161 (A2)";
+		if ((ret&  0xfff0) == 0x1610)

drivers/net/dsa/mv88e6123_61_65.c static char *mv88e6123_61_65_probe(struct mii_bus *bus, int sw_addr) · line 43

Quoted 10 lines
drivers/net/dsa/mv88e6123_61_65.c +6 -1
  			return "Marvell 88E6161";
-		if (ret == 0x1650)
+
+		if (ret == 0x1652)
+			return "Marvell 88E6165 (A1)";
+		if (ret == 0x1653)
+			return "Marvell 88e6165 (A2)";
+		if ((ret&  0xfff0) == 0x1650)
  			return "Marvell 88E6165";
  	}

What about a switch/case here?
--
Florian

maintainer
#2 lore raw

From: Florian Fainelli <[email protected]>
Date: Mon, 23 Jan 2012 10:48:10 +0100

Quoted 6 lines · Chris Healy

drivers/net/dsa/mv88e6123_61_65.c static char *mv88e6123_61_65_probe(struct mii_bus *bus, int sw_addr) · line 43

Quoted 3 lines
drivers/net/dsa/mv88e6123_61_65.c +1 -0
+		if ((ret&  0xfff0) == 0x1650)
  			return "Marvell 88E6165";
  	}

What about a switch/case here?

I don't think you can express "(ret& 0xfff0) == 0x1650)" using a switch statement.

But BTW, the formatting of that expression needs to be cleaned up. It should be "(ret & 0xfff0) == 0x1650)"

#3 lore raw
Quoted 10 lines · David Miller

From: Florian Fainelli <[email protected]>
Date: Mon, 23 Jan 2012 10:48:10 +0100

Quoted 6 lines · Chris Healy

drivers/net/dsa/mv88e6123_61_65.c static char *mv88e6123_61_65_probe(struct mii_bus *bus, int sw_addr) · line 43

Quoted 3 lines
drivers/net/dsa/mv88e6123_61_65.c +1 -0
+		if ((ret&  0xfff0) == 0x1650)
  			return "Marvell 88E6165";
  	}

What about a switch/case here?

Quoted 5 lines

I don't think you can express "(ret& 0xfff0) == 0x1650)" using a switch statement.

But BTW, the formatting of that expression needs to be cleaned up. It should be "(ret & 0xfff0) == 0x1650)"

Florian's mailer has mangled the quoted text; the original patch had correct spacing.

Ben.

Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
maintainer
#4 lore raw

From: Ben Hutchings <[email protected]>
Date: Mon, 23 Jan 2012 19:35:32 +0000

Quoted 11 lines · David Miller
Quoted 10 lines

From: Florian Fainelli <[email protected]>
Date: Mon, 23 Jan 2012 10:48:10 +0100

Quoted 6 lines · Chris Healy

drivers/net/dsa/mv88e6123_61_65.c static char *mv88e6123_61_65_probe(struct mii_bus *bus, int sw_addr) · line 43

Quoted 3 lines
drivers/net/dsa/mv88e6123_61_65.c +1 -0
+		if ((ret&  0xfff0) == 0x1650)
  			return "Marvell 88E6165";
  	}

What about a switch/case here?

Quoted 8 lines
Quoted 5 lines

I don't think you can express "(ret& 0xfff0) == 0x1650)" using a switch statement.

But BTW, the formatting of that expression needs to be cleaned up. It should be "(ret & 0xfff0) == 0x1650)"

Florian's mailer has mangled the quoted text; the original patch had correct spacing.

Thanks for pointing that out, then the patch is fine, applied.