* [PATCH 1/1] dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches.
@ 2012-01-23 7:20 Chris Healy
2012-01-23 9:48 ` Florian Fainelli
0 siblings, 1 reply; 5+ messages in thread
From: Chris Healy @ 2012-01-23 7:20 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Lennert Buytenhek, netdev; +Cc: Chris Healy
Add reporting of silicon revision during the probe function for Marvell 88E6123/88E6161/88E6165 switches.
Signed-off-by: Chris Healy <cphealy@gmail.com>
---
drivers/net/dsa/mv88e6123_61_65.c | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/mv88e6123_61_65.c b/drivers/net/dsa/mv88e6123_61_65.c
index c0a458f..6f23c95 100644
--- a/drivers/net/dsa/mv88e6123_61_65.c
+++ b/drivers/net/dsa/mv88e6123_61_65.c
@@ -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";
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches.
2012-01-23 7:20 [PATCH 1/1] dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches Chris Healy
@ 2012-01-23 9:48 ` Florian Fainelli
2012-01-23 18:59 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Florian Fainelli @ 2012-01-23 9:48 UTC (permalink / raw)
To: Chris Healy; +Cc: David S. Miller, Ben Hutchings, Lennert Buytenhek, netdev
Hello,
On 01/23/12 08:20, Chris Healy wrote:
> Add reporting of silicon revision during the probe function for Marvell 88E6123/88E6161/88E6165 switches.
>
> Signed-off-by: Chris Healy<cphealy@gmail.com>
> ---
> drivers/net/dsa/mv88e6123_61_65.c | 21 +++++++++++++++++----
> 1 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6123_61_65.c b/drivers/net/dsa/mv88e6123_61_65.c
> index c0a458f..6f23c95 100644
> --- a/drivers/net/dsa/mv88e6123_61_65.c
> +++ b/drivers/net/dsa/mv88e6123_61_65.c
> @@ -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";
> }
What about a switch/case here?
--
Florian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches.
2012-01-23 9:48 ` Florian Fainelli
@ 2012-01-23 18:59 ` David Miller
2012-01-23 19:35 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-01-23 18:59 UTC (permalink / raw)
To: florian; +Cc: cphealy, ben, buytenh, netdev
From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 23 Jan 2012 10:48:10 +0100
> On 01/23/12 08:20, Chris Healy wrote:
>> + 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)"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches.
2012-01-23 18:59 ` David Miller
@ 2012-01-23 19:35 ` Ben Hutchings
2012-01-23 19:46 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2012-01-23 19:35 UTC (permalink / raw)
To: David Miller; +Cc: florian, cphealy, ben, buytenh, netdev
On Mon, 2012-01-23 at 13:59 -0500, David Miller wrote:
> From: Florian Fainelli <florian@openwrt.org>
> Date: Mon, 23 Jan 2012 10:48:10 +0100
>
> > On 01/23/12 08:20, Chris Healy wrote:
> >> + 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)"
Florian's mailer has mangled the quoted text; the original patch had
correct spacing.
Ben.
--
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches.
2012-01-23 19:35 ` Ben Hutchings
@ 2012-01-23 19:46 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-01-23 19:46 UTC (permalink / raw)
To: bhutchings; +Cc: florian, cphealy, ben, buytenh, netdev
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 23 Jan 2012 19:35:32 +0000
> On Mon, 2012-01-23 at 13:59 -0500, David Miller wrote:
>> From: Florian Fainelli <florian@openwrt.org>
>> Date: Mon, 23 Jan 2012 10:48:10 +0100
>>
>> > On 01/23/12 08:20, Chris Healy wrote:
>> >> + 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)"
>
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-23 19:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-23 7:20 [PATCH 1/1] dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches Chris Healy
2012-01-23 9:48 ` Florian Fainelli
2012-01-23 18:59 ` David Miller
2012-01-23 19:35 ` Ben Hutchings
2012-01-23 19:46 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).