diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2011-03-07 00:49:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-08 17:24:20 -0500 |
commit | fdb838cdae4d4f2a478e5cfdd84026f7960b69dd (patch) | |
tree | e61fa3c8515f41770af377fd1bfc35c20c01bf4a /net/dsa/mv88e6060.c | |
parent | c01c6af84e5c397917496212f8c3f2942ec7012d (diff) |
dsa/mv88e6060: support nonzero mii base address
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>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/mv88e6060.c')
-rw-r--r-- | 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 83277f463af7..8f4ff5a2c813 100644 --- a/net/dsa/mv88e6060.c +++ b/net/dsa/mv88e6060.c | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | static int reg_read(struct dsa_switch *ds, int addr, int reg) | 19 | static int reg_read(struct dsa_switch *ds, int addr, int reg) |
20 | { | 20 | { |
21 | return mdiobus_read(ds->master_mii_bus, addr, reg); | 21 | return mdiobus_read(ds->master_mii_bus, ds->pd->sw_addr + addr, reg); |
22 | } | 22 | } |
23 | 23 | ||
24 | #define REG_READ(addr, reg) \ | 24 | #define REG_READ(addr, reg) \ |
@@ -34,7 +34,8 @@ static int reg_read(struct dsa_switch *ds, int addr, int reg) | |||
34 | 34 | ||
35 | static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val) | 35 | static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val) |
36 | { | 36 | { |
37 | return mdiobus_write(ds->master_mii_bus, addr, reg, val); | 37 | return mdiobus_write(ds->master_mii_bus, ds->pd->sw_addr + addr, |
38 | reg, val); | ||
38 | } | 39 | } |
39 | 40 | ||
40 | #define REG_WRITE(addr, reg, val) \ | 41 | #define REG_WRITE(addr, reg, val) \ |
@@ -50,7 +51,7 @@ static char *mv88e6060_probe(struct mii_bus *bus, int sw_addr) | |||
50 | { | 51 | { |
51 | int ret; | 52 | int ret; |
52 | 53 | ||
53 | ret = mdiobus_read(bus, REG_PORT(0), 0x03); | 54 | ret = mdiobus_read(bus, sw_addr + REG_PORT(0), 0x03); |
54 | if (ret >= 0) { | 55 | if (ret >= 0) { |
55 | ret &= 0xfff0; | 56 | ret &= 0xfff0; |
56 | if (ret == 0x0600) | 57 | if (ret == 0x0600) |