Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phylib: Add support for Marvell 88E1149R devices.

The 88E1149R is 10/100/1000 quad-gigabit Ethernet PHY. The
.config_aneg function can be shared with 88E1118, but it needs its own
.config_init.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Cc: Cyril Chemparathy <cyril@ti.com>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Daney and committed by
David S. Miller
90600732 27d916d6

+41
+40
drivers/net/phy/marvell.c
··· 433 433 return 0; 434 434 } 435 435 436 + static int m88e1149_config_init(struct phy_device *phydev) 437 + { 438 + int err; 439 + 440 + /* Change address */ 441 + err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 0x0002); 442 + if (err < 0) 443 + return err; 444 + 445 + /* Enable 1000 Mbit */ 446 + err = phy_write(phydev, 0x15, 0x1048); 447 + if (err < 0) 448 + return err; 449 + 450 + /* Reset address */ 451 + err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 0x0); 452 + if (err < 0) 453 + return err; 454 + 455 + err = phy_write(phydev, MII_BMCR, BMCR_RESET); 456 + if (err < 0) 457 + return err; 458 + 459 + return 0; 460 + } 461 + 436 462 static int m88e1145_config_init(struct phy_device *phydev) 437 463 { 438 464 int err; ··· 712 686 .driver = { .owner = THIS_MODULE }, 713 687 }, 714 688 { 689 + .phy_id = MARVELL_PHY_ID_88E1149R, 690 + .phy_id_mask = MARVELL_PHY_ID_MASK, 691 + .name = "Marvell 88E1149R", 692 + .features = PHY_GBIT_FEATURES, 693 + .flags = PHY_HAS_INTERRUPT, 694 + .config_init = &m88e1149_config_init, 695 + .config_aneg = &m88e1118_config_aneg, 696 + .read_status = &genphy_read_status, 697 + .ack_interrupt = &marvell_ack_interrupt, 698 + .config_intr = &marvell_config_intr, 699 + .driver = { .owner = THIS_MODULE }, 700 + }, 701 + { 715 702 .phy_id = MARVELL_PHY_ID_88E1240, 716 703 .phy_id_mask = MARVELL_PHY_ID_MASK, 717 704 .name = "Marvell 88E1240", ··· 775 736 { 0x01410e10, 0xfffffff0 }, 776 737 { 0x01410cb0, 0xfffffff0 }, 777 738 { 0x01410cd0, 0xfffffff0 }, 739 + { 0x01410e50, 0xfffffff0 }, 778 740 { 0x01410e30, 0xfffffff0 }, 779 741 { 0x01410e90, 0xfffffff0 }, 780 742 { }
+1
include/linux/marvell_phy.h
··· 11 11 #define MARVELL_PHY_ID_88E1118 0x01410e10 12 12 #define MARVELL_PHY_ID_88E1121R 0x01410cb0 13 13 #define MARVELL_PHY_ID_88E1145 0x01410cd0 14 + #define MARVELL_PHY_ID_88E1149R 0x01410e50 14 15 #define MARVELL_PHY_ID_88E1240 0x01410e30 15 16 #define MARVELL_PHY_ID_88E1318S 0x01410e90 16 17