130
130
#define MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS BIT(12)
131
131
#define MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE BIT(14)
132
132
133
- #define MII_88E1121_PHY_LED_CTRL 16
133
+ #define MII_PHY_LED_CTRL 16
134
134
#define MII_88E1121_PHY_LED_DEF 0x0030
135
+ #define MII_88E1510_PHY_LED_DEF 0x1177
135
136
136
137
#define MII_M1011_PHY_STATUS 0x11
137
138
#define MII_M1011_PHY_STATUS_1000 0x8000
@@ -632,8 +633,40 @@ static int m88e1510_config_aneg(struct phy_device *phydev)
632
633
return err ;
633
634
}
634
635
636
+ static void marvell_config_led (struct phy_device * phydev )
637
+ {
638
+ u16 def_config ;
639
+ int err ;
640
+
641
+ switch (MARVELL_PHY_FAMILY_ID (phydev -> phy_id )) {
642
+ /* Default PHY LED config: LED[0] .. Link, LED[1] .. Activity */
643
+ case MARVELL_PHY_FAMILY_ID (MARVELL_PHY_ID_88E1121R ):
644
+ case MARVELL_PHY_FAMILY_ID (MARVELL_PHY_ID_88E1318S ):
645
+ def_config = MII_88E1121_PHY_LED_DEF ;
646
+ break ;
647
+ /* Default PHY LED config:
648
+ * LED[0] .. 1000Mbps Link
649
+ * LED[1] .. 100Mbps Link
650
+ * LED[2] .. Blink, Activity
651
+ */
652
+ case MARVELL_PHY_FAMILY_ID (MARVELL_PHY_ID_88E1510 ):
653
+ def_config = MII_88E1510_PHY_LED_DEF ;
654
+ break ;
655
+ default :
656
+ return ;
657
+ }
658
+
659
+ err = phy_write_paged (phydev , MII_MARVELL_LED_PAGE , MII_PHY_LED_CTRL ,
660
+ def_config );
661
+ if (err < 0 )
662
+ pr_warn ("Fail to config marvell phy LED.\n" );
663
+ }
664
+
635
665
static int marvell_config_init (struct phy_device * phydev )
636
666
{
667
+ /* Set defalut LED */
668
+ marvell_config_led (phydev );
669
+
637
670
/* Set registers from marvell,reg-init DT property */
638
671
return marvell_of_reg_init (phydev );
639
672
}
@@ -813,21 +846,6 @@ static int m88e1111_config_init(struct phy_device *phydev)
813
846
return genphy_soft_reset (phydev );
814
847
}
815
848
816
- static int m88e1121_config_init (struct phy_device * phydev )
817
- {
818
- int err ;
819
-
820
- /* Default PHY LED config: LED[0] .. Link, LED[1] .. Activity */
821
- err = phy_write_paged (phydev , MII_MARVELL_LED_PAGE ,
822
- MII_88E1121_PHY_LED_CTRL ,
823
- MII_88E1121_PHY_LED_DEF );
824
- if (err < 0 )
825
- return err ;
826
-
827
- /* Set marvell,reg-init configuration from device tree */
828
- return marvell_config_init (phydev );
829
- }
830
-
831
849
static int m88e1318_config_init (struct phy_device * phydev )
832
850
{
833
851
if (phy_interrupt_is_valid (phydev )) {
@@ -841,7 +859,7 @@ static int m88e1318_config_init(struct phy_device *phydev)
841
859
return err ;
842
860
}
843
861
844
- return m88e1121_config_init (phydev );
862
+ return marvell_config_init (phydev );
845
863
}
846
864
847
865
static int m88e1510_config_init (struct phy_device * phydev )
@@ -2087,7 +2105,7 @@ static struct phy_driver marvell_drivers[] = {
2087
2105
.features = PHY_GBIT_FEATURES ,
2088
2106
.flags = PHY_HAS_INTERRUPT ,
2089
2107
.probe = & m88e1121_probe ,
2090
- .config_init = & m88e1121_config_init ,
2108
+ .config_init = & marvell_config_init ,
2091
2109
.config_aneg = & m88e1121_config_aneg ,
2092
2110
.read_status = & marvell_read_status ,
2093
2111
.ack_interrupt = & marvell_ack_interrupt ,
0 commit comments