072-14-bgmac-reset-all-4-GMAC-cores-on-init.patch 835 B

12345678910111213141516171819202122232425262728
  1. From: Felix Fietkau <nbd@nbd.name>
  2. Date: Mon, 13 Apr 2015 15:56:26 +0200
  3. Subject: [PATCH] bgmac: reset all 4 GMAC cores on init
  4. On a BCM4709 based device, I found that GMAC cores may be enabled at
  5. probe time, but only become usable after a full reset.
  6. Disable cores before re-enabling them to ensure that they are properly
  7. reset.
  8. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  9. ---
  10. --- a/drivers/net/ethernet/broadcom/bgmac.c
  11. +++ b/drivers/net/ethernet/broadcom/bgmac.c
  12. @@ -1623,8 +1623,11 @@ static int bgmac_probe(struct bcma_devic
  13. ns_core = bcma_find_core_unit(core->bus,
  14. BCMA_CORE_MAC_GBIT,
  15. ns_gmac);
  16. - if (ns_core && !bcma_core_is_enabled(ns_core))
  17. - bcma_core_enable(ns_core, 0);
  18. + if (!ns_core)
  19. + continue;
  20. +
  21. + bcma_core_disable(ns_core, 0);
  22. + bcma_core_enable(ns_core, 0);
  23. }
  24. }