phy: Add support for Marvell 88E1118 PHY

This patch will add support for the Marvell 88E1118 PHY which supports gigabit ethernet among other things.

Signed-off-by: Ron Madrid <ron_madrid@sbcglobal.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Ron Madrid and committed by David S. Miller 605f196e d53b93f2

+66
+66
drivers/net/phy/marvell.c
··· 227 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 283 static int m88e1145_config_init(struct phy_device *phydev) 231 284 { 232 285 int err; ··· 467 414 .ack_interrupt = &marvell_ack_interrupt, 468 415 .config_intr = &marvell_config_intr, 469 416 .driver = { .owner = THIS_MODULE }, 417 + }, 418 + { 419 + .phy_id = 0x01410e10, 420 + .phy_id_mask = 0xfffffff0, 421 + .name = "Marvell 88E1118", 422 + .features = PHY_GBIT_FEATURES, 423 + .flags = PHY_HAS_INTERRUPT, 424 + .config_init = &m88e1118_config_init, 425 + .config_aneg = &m88e1118_config_aneg, 426 + .read_status = &genphy_read_status, 427 + .ack_interrupt = &marvell_ack_interrupt, 428 + .config_intr = &marvell_config_intr, 429 + .driver = {.owner = THIS_MODULE,}, 470 430 }, 471 431 { 472 432 .phy_id = 0x01410cd0,