remove RGMII TX delay fixup k54
authorDavid Bauer <[email protected]>
Sun, 19 Jan 2020 13:37:17 +0000 (14:37 +0100)
committerDavid Bauer <[email protected]>
Sun, 19 Jan 2020 14:06:12 +0000 (15:06 +0100)
target/linux/generic/pending-5.4/734-net-phy-at803x-allow-to-configure-via-pdata.patch
target/linux/generic/pending-5.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
target/linux/generic/pending-5.4/736-net-phy-at803x-allow-to-configure-via-dt.patch

index bc635b5a24058cd09b338186281b42d3beb48623..fe75f53948c672e1c9d873e3fd7011e1bcb8500c 100644 (file)
@@ -48,7 +48,7 @@ Signed-off-by: Gabor Juhos <[email protected]>
  };
  
  struct at803x_context {
-@@ -256,8 +264,16 @@ static int at803x_probe(struct phy_devic
+@@ -256,6 +264,13 @@ static int at803x_probe(struct phy_devic
        return 0;
  }
  
@@ -61,84 +61,26 @@ Signed-off-by: Gabor Juhos <[email protected]>
 +
  static int at803x_config_init(struct phy_device *phydev)
  {
-+      struct at803x_platform_data *pdata;
        int ret;
-       /* The RX and TX delay default is:
-@@ -315,6 +331,9 @@ static int at803x_config_intr(struct phy
- static void at803x_link_change_notify(struct phy_device *phydev)
- {
-+      struct at803x_platform_data *pdata;
-+      pdata = dev_get_platdata(&phydev->mdio.dev);
-+
-       /*
-        * Conduct a hardware reset for AT8030/2 every time a link loss is
-        * signalled. This is necessary to circumvent a hardware bug that
-@@ -336,6 +355,25 @@ static void at803x_link_change_notify(st
-               phydev_dbg(phydev, "%s(): phy was reset\n", __func__);
-       }
-+
-+      if (pdata && pdata->fixup_rgmii_tx_delay &&
-+          phydev->speed != priv->prev_speed) {
-+              switch (phydev->speed) {
-+              case SPEED_10:
-+              case SPEED_100:
-+                      at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
-+                                            AT803X_DEBUG_TX_CLK_DLY_EN);
-+                      break;
-+              case SPEED_1000:
-+                      at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5,
-+                                            AT803X_DEBUG_TX_CLK_DLY_EN, 0);
-+                      break;
-+              default:
-+                      break;
-+              }
-+
-+              priv->prev_speed = phydev->speed;
-+      }
- }
- static int at803x_aneg_done(struct phy_device *phydev)
-@@ -423,6 +461,26 @@ static int at803x_read_status(struct phy
+@@ -423,6 +438,10 @@ static int at803x_read_status(struct phy
        if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete)
                phy_resolve_aneg_pause(phydev);
  
-+      pdata = dev_get_platdata(&phydev->mdio.dev);
-+      if (pdata) {
-+              if (pdata->disable_smarteee)
-+                      at803x_disable_smarteee(phydev);
-+
-+              if (pdata->enable_rgmii_rx_delay)
-+                      at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
-+                              AT803X_DEBUG_RX_CLK_DLY_EN);
-+              else
-+                      at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0,
-+                              AT803X_DEBUG_RX_CLK_DLY_EN, 0);
-+
-+              if (pdata->enable_rgmii_tx_delay)
-+                      at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
-+                              AT803X_DEBUG_TX_CLK_DLY_EN);
-+              else
-+                      at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5,
-+                              AT803X_DEBUG_TX_CLK_DLY_EN, 0);
-+      }
++      struct at803x_platform_data *pdata = dev_get_platdata(&phydev->mdio.dev);
++      if (pdata && pdata->disable_smarteee)
++              at803x_disable_smarteee(phydev);
 +
        return 0;
  }
  
 --- /dev/null
 +++ b/include/linux/platform_data/phy-at803x.h
-@@ -0,0 +1,11 @@
+@@ -0,0 +1,8 @@
 +#ifndef _PHY_AT803X_PDATA_H
 +#define _PHY_AT803X_PDATA_H
 +
 +struct at803x_platform_data {
 +      int disable_smarteee:1;
-+      int enable_rgmii_tx_delay:1;
-+      int enable_rgmii_rx_delay:1;
-+      int fixup_rgmii_tx_delay:1;
 +};
 +
 +#endif /* _PHY_AT803X_PDATA_H */
index 00a96a33551f7f94ab4681e38c52604b7279fc30..db6668d105d0b9a84e70ff6bec0711403cb7ee6b 100644 (file)
@@ -21,9 +21,9 @@ Signed-off-by: Roman Yeryomin <[email protected]>
  
  #define AT803X_PCS_SMART_EEE_CTRL3                    0x805D
  #define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_MASK  0x3
-@@ -275,6 +276,27 @@ static int at803x_config_init(struct phy
+@@ -274,6 +275,27 @@ static void at803x_disable_smarteee(stru
+ static int at803x_config_init(struct phy_device *phydev)
  {
-       struct at803x_platform_data *pdata;
        int ret;
 +      u32 v;
 +
index a9f7fcf310c963243905f18c98a98eb9d8872cfb..f18492d1402828a56017280a26ce25c8a7997ad5 100644 (file)
@@ -1,37 +1,8 @@
 --- a/drivers/net/phy/at803x.c
 +++ b/drivers/net/phy/at803x.c
-@@ -355,6 +355,7 @@ static void at803x_link_change_notify(st
- {
-       struct at803x_platform_data *pdata;
-       pdata = dev_get_platdata(&phydev->mdio.dev);
-+      u8 fixup_rgmii_tx_delay = 0;
-       /*
-        * Conduct a hardware reset for AT8030/2 every time a link loss is
-@@ -378,8 +379,18 @@ static void at803x_link_change_notify(st
-               phydev_dbg(phydev, "%s(): phy was reset\n", __func__);
-       }
--      if (pdata && pdata->fixup_rgmii_tx_delay &&
--          phydev->speed != priv->prev_speed) {
-+      if (pdata && pdata->fixup_rgmii_tx_delay)
-+              fixup_rgmii_tx_delay = 1;
-+
-+#ifdef CONFIG_OF_MDIO
-+      if (phydev->mdio.dev.of_node &&
-+          of_property_read_bool(phydev->mdio.dev.of_node,
-+                                "at803x-fixup-rgmii-tx-delay")) {
-+              fixup_rgmii_tx_delay = 1;
-+      }
-+#endif
-+
-+      if (fixup_rgmii_tx_delay && phydev->speed != priv->prev_speed) {
-               switch (phydev->speed) {
-               case SPEED_10:
-               case SPEED_100:
-@@ -503,6 +514,14 @@ static int at803x_read_status(struct phy
-                               AT803X_DEBUG_TX_CLK_DLY_EN, 0);
-       }
+@@ -464,6 +464,14 @@ static int at803x_read_status(struct phy
+       if (pdata && pdata->disable_smarteee)
+               at803x_disable_smarteee(phydev);
  
 +#ifdef CONFIG_OF_MDIO
 +      if (phydev->mdio.dev.of_node &&