700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  2. Date: Mon, 15 Feb 2021 23:59:26 +0100
  3. Subject: [PATCH] net: dsa: bcm_sf2: enable GPHY for switch probing
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. GPHY needs to be enabled to succesfully probe & setup switch port
  8. connected to it. Otherwise hardcoding PHY OUI would be required.
  9. Before:
  10. brcm-sf2 80080000.switch lan4 (uninitialized): PHY [800c05c0.mdio--1:08] driver [Generic PHY] (irq=POLL)
  11. brcm-sf2 80080000.switch lan3 (uninitialized): PHY [800c05c0.mdio--1:09] driver [Generic PHY] (irq=POLL)
  12. brcm-sf2 80080000.switch lan2 (uninitialized): PHY [800c05c0.mdio--1:0a] driver [Generic PHY] (irq=POLL)
  13. brcm-sf2 80080000.switch lan1 (uninitialized): PHY [800c05c0.mdio--1:0b] driver [Generic PHY] (irq=POLL)
  14. brcm-sf2 80080000.switch wan (uninitialized): error -5 setting up PHY for tree 0, switch 0, port 7
  15. After:
  16. brcm-sf2 80080000.switch lan4 (uninitialized): PHY [800c05c0.mdio--1:08] driver [Generic PHY] (irq=POLL)
  17. brcm-sf2 80080000.switch lan3 (uninitialized): PHY [800c05c0.mdio--1:09] driver [Generic PHY] (irq=POLL)
  18. brcm-sf2 80080000.switch lan2 (uninitialized): PHY [800c05c0.mdio--1:0a] driver [Generic PHY] (irq=POLL)
  19. brcm-sf2 80080000.switch lan1 (uninitialized): PHY [800c05c0.mdio--1:0b] driver [Generic PHY] (irq=POLL)
  20. brcm-sf2 80080000.switch wan (uninitialized): PHY [800c05c0.mdio--1:0c] driver [Generic PHY] (irq=POLL)
  21. Signed-off-by: Rafał Miłecki <[email protected]>
  22. ---
  23. drivers/net/dsa/bcm_sf2.c | 4 ++++
  24. 1 file changed, 4 insertions(+)
  25. --- a/drivers/net/dsa/bcm_sf2.c
  26. +++ b/drivers/net/dsa/bcm_sf2.c
  27. @@ -1548,10 +1548,14 @@ static int bcm_sf2_sw_probe(struct platf
  28. rev = reg_readl(priv, REG_PHY_REVISION);
  29. priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;
  30. + bcm_sf2_gphy_enable_set(priv->dev->ds, true);
  31. +
  32. ret = b53_switch_register(dev);
  33. if (ret)
  34. goto out_mdio;
  35. + bcm_sf2_gphy_enable_set(priv->dev->ds, false);
  36. +
  37. dev_info(&pdev->dev,
  38. "Starfighter 2 top: %x.%02x, core: %x.%02x, IRQs: %d, %d\n",
  39. priv->hw_params.top_rev >> 8, priv->hw_params.top_rev & 0xff,