1
0

076-v4.11-0005-net-phy-broadcom-use-auxctl-reading-helper-in-BCM546.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  2. Date: Wed, 25 Jan 2017 21:00:25 +0100
  3. Subject: [PATCH] net: phy: broadcom: use auxctl reading helper in BCM54612E
  4. code
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Starting with commit 5b4e29005123 ("net: phy: broadcom: add
  9. bcm54xx_auxctl_read") we have a reading helper so use it and avoid code
  10. duplication.
  11. It also means we don't need MII_BCM54XX_AUXCTL_SHDWSEL_MISC define as
  12. it's the same as MII_BCM54XX_AUXCTL_SHDWSEL_MISC just for reading needs
  13. (same value shifted by 12 bits).
  14. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  15. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
  16. Signed-off-by: David S. Miller <davem@davemloft.net>
  17. ---
  18. --- a/drivers/net/phy/broadcom.c
  19. +++ b/drivers/net/phy/broadcom.c
  20. @@ -395,10 +395,8 @@ static int bcm54612e_config_aneg(struct
  21. (phydev->interface != PHY_INTERFACE_MODE_RGMII_RXID)) {
  22. u16 reg;
  23. - /* Errata: reads require filling in the write selector field */
  24. - bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC,
  25. - MII_BCM54XX_AUXCTL_MISC_RDSEL_MISC);
  26. - reg = phy_read(phydev, MII_BCM54XX_AUX_CTL);
  27. + reg = bcm54xx_auxctl_read(phydev,
  28. + MII_BCM54XX_AUXCTL_SHDWSEL_MISC);
  29. /* Disable RXD to RXC delay (default set) */
  30. reg &= ~MII_BCM54XX_AUXCTL_MISC_RXD_RXC_SKEW;
  31. /* Clear shadow selector field */
  32. --- a/include/linux/brcmphy.h
  33. +++ b/include/linux/brcmphy.h
  34. @@ -111,7 +111,6 @@
  35. #define MII_BCM54XX_AUXCTL_MISC_WREN 0x8000
  36. #define MII_BCM54XX_AUXCTL_MISC_FORCE_AMDIX 0x0200
  37. -#define MII_BCM54XX_AUXCTL_MISC_RDSEL_MISC 0x7000
  38. #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC 0x0007
  39. #define MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT 12
  40. #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN (1 << 8)