Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2021
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.72 KB | None | 0 0
  1. diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
  2. index 09701c17f3f6..e1654c827819 100644
  3. --- a/drivers/net/dsa/lantiq_gswip.c
  4. +++ b/drivers/net/dsa/lantiq_gswip.c
  5. @@ -92,9 +92,7 @@
  6.                      GSWIP_MDIO_PHY_FDUP_MASK)
  7.  
  8.  /* GSWIP MII Registers */
  9. -#define GSWIP_MII_CFG0         0x00
  10. -#define GSWIP_MII_CFG1         0x02
  11. -#define GSWIP_MII_CFG5         0x04
  12. +#define GSWIP_MII_CFGp(p)      (0x2 * (p))
  13.  #define  GSWIP_MII_CFG_EN      BIT(14)
  14.  #define  GSWIP_MII_CFG_LDCLKDIS        BIT(12)
  15.  #define  GSWIP_MII_CFG_MODE_MIIP   0x0
  16. @@ -392,17 +390,9 @@ static void gswip_mii_mask(struct gswip_priv *priv, u32 clear, u32 set,
  17.  static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 clear, u32 set,
  18.                    int port)
  19.  {
  20. -   switch (port) {
  21. -   case 0:
  22. -       gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG0);
  23. -       break;
  24. -   case 1:
  25. -       gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG1);
  26. -       break;
  27. -   case 5:
  28. -       gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG5);
  29. -       break;
  30. -   }
  31. +   /* There's no MII_CFG register for the CPU port */
  32. +   if (!dsa_is_cpu_port(priv->ds, port))
  33. +       gswip_mii_mask(priv, clear, set, GSWIP_MII_CFGp(port));
  34.  }
  35.  
  36.  static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 clear, u32 set,
  37. @@ -822,9 +812,8 @@ static int gswip_setup(struct dsa_switch *ds)
  38.     gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1);
  39.  
  40.     /* Disable the xMII link */
  41. -   gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 0);
  42. -   gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 1);
  43. -   gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 5);
  44. +   for (i = 0; i < priv->hw_info->max_ports; i++)
  45. +       gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, i);
  46.  
  47.     /* enable special tag insertion on cpu port */
  48.     gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN,
  49.  
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement