@@ -689,7 +689,7 @@ static void stmmac_release_ptp(struct stmmac_priv *priv)
689689 stmmac_ptp_unregister (priv );
690690}
691691
692- void setLedConfiguration (struct phy_device * phydev ) {
692+ void set_led_configuration_e (struct phy_device * phydev ) {
693693
694694 // disable EEE LED mode
695695 phy_write (phydev , 31 , 0x0005 );
@@ -727,6 +727,22 @@ void setLedConfiguration(struct phy_device *phydev) {
727727 phy_write (phydev , 31 , 0 );
728728}
729729
730+ void set_led_configuration_f (struct phy_device * phydev ) {
731+ // To switch Page0xd04
732+ phy_write (phydev , 31 , 0x0d04 );
733+
734+ //Disable EEELCR mode
735+ phy_write (phydev , 17 , 0 );
736+ printk ("%s: #### before setting led, Reg16 = 0x%x\n" , __func__ , phy_read (phydev , 16 ));
737+
738+ //LED Link speed default setting
739+ phy_write (phydev , 16 , 0x8910 );
740+ printk ("%s: #### after setting led, Reg16 = 0x%x\n" , __func__ , phy_read (phydev , 16 ));
741+
742+ //switch to PHY`s Page0
743+ phy_write (phydev , 31 , 0 );
744+ }
745+
730746void adjust_rgmii_driving (struct phy_device * phydev )
731747{
732748 // set to extension page
@@ -744,6 +760,21 @@ void adjust_rgmii_driving(struct phy_device *phydev)
744760 phy_write (phydev , 31 , 0 );
745761}
746762
763+ extern int get_board_id (void );
764+ void setConfiguration (struct phy_device * phydev ) {
765+ bool is_rtl8211f = get_board_id () >= 5 ? true: false;
766+ printk ("%s: #### hwid = %d, PYH is %s \n" , __func__ , get_board_id (), is_rtl8211f ? "RTL8211F" : "RTL8211E" );
767+ if (is_rtl8211f ) {
768+ // RTL8211F
769+ set_led_configuration_f (phydev );
770+ } else {
771+ // RTL8211E
772+ set_led_configuration_e (phydev );
773+ adjust_rgmii_driving (phydev );
774+ }
775+ }
776+
777+
747778/**
748779 * stmmac_adjust_link - adjusts the link parameters
749780 * @dev: net device structure
@@ -785,8 +816,7 @@ static void stmmac_adjust_link(struct net_device *dev)
785816
786817 if (phydev -> speed != priv -> speed ) {
787818 new_state = 1 ;
788- setLedConfiguration (phydev );
789- adjust_rgmii_driving (phydev );
819+ setConfiguration (phydev );
790820 switch (phydev -> speed ) {
791821 case 1000 :
792822 if (likely (priv -> plat -> has_gmac ))
0 commit comments