070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From d61615c366a489646a1bfe5b33455f916762d5f4 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  3. Date: Wed, 8 Feb 2023 10:16:37 +0100
  4. Subject: [PATCH] net: bgmac: fix BCM5358 support by setting correct flags
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
  9. incorrectly unified. Chip package values are not unique and cannot be
  10. checked independently. They are meaningful only in a context of a given
  11. chip.
  12. Packages BCM5358 and BCM47188 share the same value but then belong to
  13. different chips. Code unification resulted in treating BCM5358 as
  14. BCM47188 and broke its initialization.
  15. Link: https://github.com/openwrt/openwrt/issues/8278
  16. Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family")
  17. Cc: Jon Mason <[email protected]>
  18. Signed-off-by: Rafał Miłecki <[email protected]>
  19. Reviewed-by: Florian Fainelli <[email protected]>
  20. Link: https://lore.kernel.org/r/[email protected]
  21. Signed-off-by: Jakub Kicinski <[email protected]>
  22. ---
  23. drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 +++---
  24. 1 file changed, 3 insertions(+), 3 deletions(-)
  25. --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
  26. +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
  27. @@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_devic
  28. bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
  29. bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
  30. bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
  31. - if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
  32. - ci->pkg == BCMA_PKG_ID_BCM47186) {
  33. + if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
  34. + (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
  35. bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
  36. bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
  37. }
  38. - if (ci->pkg == BCMA_PKG_ID_BCM5358)
  39. + if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
  40. bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
  41. break;
  42. case BCMA_CHIP_ID_BCM53573: