kernel: backport upstream mediatek WED changes
[openwrt/staging/pepe2k.git] / target / linux / generic / pending-5.15 / 737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch
index b85b1364e181341bf0b6e8494670d1a8f85366c1..29f565d312b0b7817deb17ab8d990af9920eb2cb 100644 (file)
@@ -249,7 +249,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 -
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -431,6 +431,30 @@ static void mtk_setup_bridge_switch(stru
+@@ -432,6 +432,30 @@ static void mtk_setup_bridge_switch(stru
                MTK_GSW_CFG);
  }
  
@@ -280,7 +280,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  static struct phylink_pcs *mtk_mac_select_pcs(struct phylink_config *config,
                                              phy_interface_t interface)
  {
-@@ -439,12 +463,20 @@ static struct phylink_pcs *mtk_mac_selec
+@@ -440,12 +464,20 @@ static struct phylink_pcs *mtk_mac_selec
        struct mtk_eth *eth = mac->hw;
        unsigned int sid;
  
@@ -307,7 +307,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        }
  
        return NULL;
-@@ -500,7 +532,22 @@ static void mtk_mac_config(struct phylin
+@@ -501,7 +533,22 @@ static void mtk_mac_config(struct phylin
                                        goto init_err;
                        }
                        break;
@@ -330,7 +330,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
                        break;
                default:
                        goto err_phy;
-@@ -555,8 +602,6 @@ static void mtk_mac_config(struct phylin
+@@ -556,8 +603,6 @@ static void mtk_mac_config(struct phylin
                val &= ~SYSCFG0_GE_MODE(SYSCFG0_GE_MASK, mac->id);
                val |= SYSCFG0_GE_MODE(ge_mode, mac->id);
                regmap_write(eth->ethsys, ETHSYS_SYSCFG0, val);
@@ -339,7 +339,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        }
  
        /* SGMII */
-@@ -573,21 +618,40 @@ static void mtk_mac_config(struct phylin
+@@ -574,21 +619,40 @@ static void mtk_mac_config(struct phylin
  
                /* Save the syscfg0 value for mac_finish */
                mac->syscfg0 = val;
@@ -387,7 +387,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        return;
  
  err_phy:
-@@ -633,10 +697,13 @@ static void mtk_mac_link_down(struct phy
+@@ -634,10 +698,13 @@ static void mtk_mac_link_down(struct phy
  {
        struct mtk_mac *mac = container_of(config, struct mtk_mac,
                                           phylink_config);
@@ -404,7 +404,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  }
  
  static void mtk_set_queue_speed(struct mtk_eth *eth, unsigned int idx,
-@@ -708,13 +775,11 @@ static void mtk_set_queue_speed(struct m
+@@ -709,13 +776,11 @@ static void mtk_set_queue_speed(struct m
        mtk_w32(eth, val, soc->reg_map->qdma.qtx_sch + ofs);
  }
  
@@ -422,7 +422,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        u32 mcr;
  
        mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
-@@ -748,6 +813,55 @@ static void mtk_mac_link_up(struct phyli
+@@ -749,6 +814,55 @@ static void mtk_mac_link_up(struct phyli
        mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
  }
  
@@ -478,7 +478,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  static const struct phylink_mac_ops mtk_phylink_ops = {
        .validate = phylink_generic_validate,
        .mac_select_pcs = mtk_mac_select_pcs,
-@@ -4562,8 +4676,21 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4563,8 +4677,21 @@ static int mtk_add_mac(struct mtk_eth *e
                phy_interface_zero(mac->phylink_config.supported_interfaces);
                __set_bit(PHY_INTERFACE_MODE_INTERNAL,
                          mac->phylink_config.supported_interfaces);
@@ -500,7 +500,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        phylink = phylink_create(&mac->phylink_config,
                                 of_fwnode_handle(mac->of_node),
                                 phy_mode, &mtk_phylink_ops);
-@@ -4756,6 +4883,13 @@ static int mtk_probe(struct platform_dev
+@@ -4757,6 +4884,13 @@ static int mtk_probe(struct platform_dev
  
                if (err)
                        return err;