701-powerpc_ibm_apm82181_phyclk_fix.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --- a/drivers/net/ethernet/ibm/emac/core.c
  2. +++ b/drivers/net/ethernet/ibm/emac/core.c
  3. @@ -129,6 +129,7 @@ static inline void emac_report_timeout_e
  4. {
  5. if (emac_has_feature(dev, EMAC_FTR_440GX_PHY_CLK_FIX |
  6. EMAC_FTR_460EX_PHY_CLK_FIX |
  7. + EMAC_FTR_APM821XX_PHY_CLK_FIX |
  8. EMAC_FTR_440EP_PHY_CLK_FIX))
  9. DBG(dev, "%s" NL, error);
  10. else if (net_ratelimit())
  11. @@ -146,6 +147,10 @@ static inline void emac_rx_clk_tx(struct
  12. if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX))
  13. dcri_clrset(SDR0, SDR0_MFR,
  14. 0, SDR0_MFR_ECS >> dev->cell_index);
  15. +
  16. + if (emac_has_feature(dev, EMAC_FTR_APM821XX_PHY_CLK_FIX))
  17. + dcri_clrset(SDR0, SDR0_ETH_CFG,
  18. + 0, 0x00000100 >> dev->cell_index);
  19. #endif
  20. }
  21. @@ -155,6 +160,10 @@ static inline void emac_rx_clk_default(s
  22. if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX))
  23. dcri_clrset(SDR0, SDR0_MFR,
  24. SDR0_MFR_ECS >> dev->cell_index, 0);
  25. +
  26. + if (emac_has_feature(dev, EMAC_FTR_APM821XX_PHY_CLK_FIX))
  27. + dcri_clrset(SDR0, SDR0_ETH_CFG,
  28. + 0x00000100 >> dev->cell_index, 0);
  29. #endif
  30. }
  31. @@ -2605,7 +2614,7 @@ static int emac_init_config(struct emac_
  32. if (of_device_is_compatible(np, "ibm,emac-apm821xx")) {
  33. dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE |
  34. EMAC_FTR_APM821XX_NO_HALF_DUPLEX |
  35. - EMAC_FTR_460EX_PHY_CLK_FIX);
  36. + EMAC_FTR_APM821XX_PHY_CLK_FIX);
  37. }
  38. } else if (of_device_is_compatible(np, "ibm,emac4")) {
  39. dev->features |= EMAC_FTR_EMAC4;
  40. --- a/drivers/net/ethernet/ibm/emac/core.h
  41. +++ b/drivers/net/ethernet/ibm/emac/core.h
  42. @@ -333,6 +333,8 @@ struct emac_instance {
  43. */
  44. #define EMAC_FTR_APM821XX_NO_HALF_DUPLEX 0x00001000
  45. +#define EMAC_FTR_APM821XX_PHY_CLK_FIX 0x000002000
  46. +
  47. /* Right now, we don't quite handle the always/possible masks on the
  48. * most optimal way as we don't have a way to say something like
  49. * always EMAC4. Patches welcome.