* [PATCH] dsa/mv88e6060: support nonzero mii base address
@ 2011-03-07 15:49 Peter Korsgaard
2011-03-07 18:24 ` Lennert Buytenhek
0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2011-03-07 15:49 UTC (permalink / raw)
To: davem, buytenh, netdev; +Cc: Peter Korsgaard
The mv88e6060 uses either the lower 16 or upper 16 mii addresses,
depending on the value of the EE_CLK/ADDR4 pin. Support both
configurations by using the sw_addr setting as base address.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
net/dsa/mv88e6060.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/dsa/mv88e6060.c b/net/dsa/mv88e6060.c
index 83277f4..8f4ff5a 100644
--- a/net/dsa/mv88e6060.c
+++ b/net/dsa/mv88e6060.c
@@ -18,7 +18,7 @@
static int reg_read(struct dsa_switch *ds, int addr, int reg)
{
- return mdiobus_read(ds->master_mii_bus, addr, reg);
+ return mdiobus_read(ds->master_mii_bus, ds->pd->sw_addr + addr, reg);
}
#define REG_READ(addr, reg) \
@@ -34,7 +34,8 @@ static int reg_read(struct dsa_switch *ds, int addr, int reg)
static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val)
{
- return mdiobus_write(ds->master_mii_bus, addr, reg, val);
+ return mdiobus_write(ds->master_mii_bus, ds->pd->sw_addr + addr,
+ reg, val);
}
#define REG_WRITE(addr, reg, val) \
@@ -50,7 +51,7 @@ static char *mv88e6060_probe(struct mii_bus *bus, int sw_addr)
{
int ret;
- ret = mdiobus_read(bus, REG_PORT(0), 0x03);
+ ret = mdiobus_read(bus, sw_addr + REG_PORT(0), 0x03);
if (ret >= 0) {
ret &= 0xfff0;
if (ret == 0x0600)
--
1.7.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dsa/mv88e6060: support nonzero mii base address
2011-03-07 15:49 [PATCH] dsa/mv88e6060: support nonzero mii base address Peter Korsgaard
@ 2011-03-07 18:24 ` Lennert Buytenhek
2011-03-08 22:24 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Lennert Buytenhek @ 2011-03-07 18:24 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: davem, netdev
On Mon, Mar 07, 2011 at 04:49:47PM +0100, Peter Korsgaard wrote:
> The mv88e6060 uses either the lower 16 or upper 16 mii addresses,
> depending on the value of the EE_CLK/ADDR4 pin. Support both
> configurations by using the sw_addr setting as base address.
>
> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Looks good!
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dsa/mv88e6060: support nonzero mii base address
2011-03-07 18:24 ` Lennert Buytenhek
@ 2011-03-08 22:24 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-03-08 22:24 UTC (permalink / raw)
To: buytenh; +Cc: jacmet, netdev
From: Lennert Buytenhek <buytenh@wantstofly.org>
Date: Mon, 7 Mar 2011 19:24:13 +0100
> On Mon, Mar 07, 2011 at 04:49:47PM +0100, Peter Korsgaard wrote:
>
>> The mv88e6060 uses either the lower 16 or upper 16 mii addresses,
>> depending on the value of the EE_CLK/ADDR4 pin. Support both
>> configurations by using the sw_addr setting as base address.
>>
>> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
>
> Looks good!
>
> Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-08 22:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-07 15:49 [PATCH] dsa/mv88e6060: support nonzero mii base address Peter Korsgaard
2011-03-07 18:24 ` Lennert Buytenhek
2011-03-08 22:24 ` 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).