diff options
Diffstat (limited to 'drivers/net/phy')
| -rw-r--r-- | drivers/net/phy/marvell.c | 66 | ||||
| -rw-r--r-- | drivers/net/phy/mdio_bus.c | 2 | ||||
| -rw-r--r-- | drivers/net/phy/phy_device.c | 4 |
3 files changed, 69 insertions, 3 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 4aa54794704..eb6411c4694 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
| @@ -227,6 +227,59 @@ static int m88e1111_config_init(struct phy_device *phydev) | |||
| 227 | return 0; | 227 | return 0; |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | static int m88e1118_config_aneg(struct phy_device *phydev) | ||
| 231 | { | ||
| 232 | int err; | ||
| 233 | |||
| 234 | err = phy_write(phydev, MII_BMCR, BMCR_RESET); | ||
| 235 | if (err < 0) | ||
| 236 | return err; | ||
| 237 | |||
| 238 | err = phy_write(phydev, MII_M1011_PHY_SCR, | ||
| 239 | MII_M1011_PHY_SCR_AUTO_CROSS); | ||
| 240 | if (err < 0) | ||
| 241 | return err; | ||
| 242 | |||
| 243 | err = genphy_config_aneg(phydev); | ||
| 244 | return 0; | ||
| 245 | } | ||
| 246 | |||
| 247 | static int m88e1118_config_init(struct phy_device *phydev) | ||
| 248 | { | ||
| 249 | int err; | ||
| 250 | |||
| 251 | /* Change address */ | ||
| 252 | err = phy_write(phydev, 0x16, 0x0002); | ||
| 253 | if (err < 0) | ||
| 254 | return err; | ||
| 255 | |||
| 256 | /* Enable 1000 Mbit */ | ||
| 257 | err = phy_write(phydev, 0x15, 0x1070); | ||
| 258 | if (err < 0) | ||
| 259 | return err; | ||
| 260 | |||
| 261 | /* Change address */ | ||
| 262 | err = phy_write(phydev, 0x16, 0x0003); | ||
| 263 | if (err < 0) | ||
| 264 | return err; | ||
| 265 | |||
| 266 | /* Adjust LED Control */ | ||
| 267 | err = phy_write(phydev, 0x10, 0x021e); | ||
| 268 | if (err < 0) | ||
| 269 | return err; | ||
| 270 | |||
| 271 | /* Reset address */ | ||
| 272 | err = phy_write(phydev, 0x16, 0x0); | ||
| 273 | if (err < 0) | ||
| 274 | return err; | ||
| 275 | |||
| 276 | err = phy_write(phydev, MII_BMCR, BMCR_RESET); | ||
| 277 | if (err < 0) | ||
| 278 | return err; | ||
| 279 | |||
| 280 | return 0; | ||
| 281 | } | ||
| 282 | |||
| 230 | static int m88e1145_config_init(struct phy_device *phydev) | 283 | static int m88e1145_config_init(struct phy_device *phydev) |
| 231 | { | 284 | { |
| 232 | int err; | 285 | int err; |
| @@ -416,6 +469,19 @@ static struct phy_driver marvell_drivers[] = { | |||
| 416 | .driver = { .owner = THIS_MODULE }, | 469 | .driver = { .owner = THIS_MODULE }, |
| 417 | }, | 470 | }, |
| 418 | { | 471 | { |
| 472 | .phy_id = 0x01410e10, | ||
| 473 | .phy_id_mask = 0xfffffff0, | ||
| 474 | .name = "Marvell 88E1118", | ||
| 475 | .features = PHY_GBIT_FEATURES, | ||
| 476 | .flags = PHY_HAS_INTERRUPT, | ||
| 477 | .config_init = &m88e1118_config_init, | ||
| 478 | .config_aneg = &m88e1118_config_aneg, | ||
| 479 | .read_status = &genphy_read_status, | ||
| 480 | .ack_interrupt = &marvell_ack_interrupt, | ||
| 481 | .config_intr = &marvell_config_intr, | ||
| 482 | .driver = {.owner = THIS_MODULE,}, | ||
| 483 | }, | ||
| 484 | { | ||
| 419 | .phy_id = 0x01410cd0, | 485 | .phy_id = 0x01410cd0, |
| 420 | .phy_id_mask = 0xfffffff0, | 486 | .phy_id_mask = 0xfffffff0, |
| 421 | .name = "Marvell 88E1145", | 487 | .name = "Marvell 88E1145", |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index d0ed1ef284a..536bda1f428 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
| @@ -136,7 +136,7 @@ void mdiobus_unregister(struct mii_bus *bus) | |||
| 136 | BUG_ON(bus->state != MDIOBUS_REGISTERED); | 136 | BUG_ON(bus->state != MDIOBUS_REGISTERED); |
| 137 | bus->state = MDIOBUS_UNREGISTERED; | 137 | bus->state = MDIOBUS_UNREGISTERED; |
| 138 | 138 | ||
| 139 | device_unregister(&bus->dev); | 139 | device_del(&bus->dev); |
| 140 | for (i = 0; i < PHY_MAX_ADDR; i++) { | 140 | for (i = 0; i < PHY_MAX_ADDR; i++) { |
| 141 | if (bus->phy_map[i]) | 141 | if (bus->phy_map[i]) |
| 142 | device_unregister(&bus->phy_map[i]->dev); | 142 | device_unregister(&bus->phy_map[i]->dev); |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index e11b03b2b25..8fb1faca883 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
| @@ -227,8 +227,8 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr) | |||
| 227 | if (r) | 227 | if (r) |
| 228 | return ERR_PTR(r); | 228 | return ERR_PTR(r); |
| 229 | 229 | ||
| 230 | /* If the phy_id is all Fs, there is no device there */ | 230 | /* If the phy_id is all Fs or all 0s, there is no device there */ |
| 231 | if (0xffffffff == phy_id) | 231 | if ((0xffff == phy_id) || (0x00 == phy_id)) |
| 232 | return NULL; | 232 | return NULL; |
| 233 | 233 | ||
| 234 | dev = phy_device_create(bus, addr, phy_id); | 234 | dev = phy_device_create(bus, addr, phy_id); |
