m68k-coldfire-fec.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. diff -Nur linux-3.16.1.orig/drivers/net/ethernet/freescale/fec_main.c linux-3.16.1/drivers/net/ethernet/freescale/fec_main.c
  2. --- linux-3.16.1.orig/drivers/net/ethernet/freescale/fec_main.c 2014-08-14 04:36:35.000000000 +0200
  3. +++ linux-3.16.1/drivers/net/ethernet/freescale/fec_main.c 2014-08-28 14:14:15.573666435 +0200
  4. @@ -154,7 +154,7 @@
  5. module_param_array(macaddr, byte, NULL, 0);
  6. MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
  7. -#if defined(CONFIG_M5272)
  8. +#if defined(CONFIG_COLDFIRE)
  9. /*
  10. * Some hardware gets it MAC address out of local flash memory.
  11. * if this is non-zero then assume it is the address to get MAC from.
  12. @@ -165,14 +165,14 @@
  13. #define FEC_FLASHMAC 0xf0006000
  14. #elif defined(CONFIG_CANCam)
  15. #define FEC_FLASHMAC 0xf0020000
  16. -#elif defined (CONFIG_M5272C3)
  17. +#elif defined (CONFIG_COLDFIREC3)
  18. #define FEC_FLASHMAC (0xffe04000 + 4)
  19. #elif defined(CONFIG_MOD5272)
  20. #define FEC_FLASHMAC 0xffc0406b
  21. #else
  22. #define FEC_FLASHMAC 0
  23. #endif
  24. -#endif /* CONFIG_M5272 */
  25. +#endif /* CONFIG_COLDFIRE */
  26. /* Interrupt events/masks. */
  27. #define FEC_ENET_HBERR ((uint)0x80000000) /* Heartbeat error */
  28. @@ -826,7 +826,9 @@
  29. const struct platform_device_id *id_entry =
  30. platform_get_device_id(fep->pdev);
  31. int i;
  32. +#if !defined(CONFIG_COLDFIRE)
  33. u32 val;
  34. +#endif
  35. u32 temp_mac[2];
  36. u32 rcntl = OPT_FRAME_SIZE | 0x04;
  37. u32 ecntl = 0x2; /* ETHEREN */
  38. @@ -892,7 +894,7 @@
  39. /* Set MII speed */
  40. writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
  41. -#if !defined(CONFIG_M5272)
  42. +#if !defined(CONFIG_COLDFIRE)
  43. /* set RX checksum */
  44. val = readl(fep->hwp + FEC_RACC);
  45. if (fep->csum_flags & FLAG_RX_CSUM_ENABLED)
  46. @@ -953,7 +955,7 @@
  47. #endif
  48. }
  49. -#if !defined(CONFIG_M5272)
  50. +#if !defined(CONFIG_COLDFIRE)
  51. /* enable pause frame*/
  52. if ((fep->pause_flag & FEC_PAUSE_FLAG_ENABLE) ||
  53. ((fep->pause_flag & FEC_PAUSE_FLAG_AUTONEG) &&
  54. @@ -971,13 +973,13 @@
  55. } else {
  56. rcntl &= ~FEC_ENET_FCE;
  57. }
  58. -#endif /* !defined(CONFIG_M5272) */
  59. +#endif /* !defined(CONFIG_COLDFIRE) */
  60. writel(rcntl, fep->hwp + FEC_R_CNTRL);
  61. /* Setup multicast filter. */
  62. set_multicast_list(ndev);
  63. -#ifndef CONFIG_M5272
  64. +#ifndef CONFIG_COLDFIRE
  65. writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
  66. writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
  67. #endif
  68. @@ -992,7 +994,7 @@
  69. if (fep->bufdesc_ex)
  70. ecntl |= (1 << 4);
  71. -#ifndef CONFIG_M5272
  72. +#ifndef CONFIG_COLDFIRE
  73. /* Enable the MIB statistic event counters */
  74. writel(0 << 31, fep->hwp + FEC_MIB_CTRLSTAT);
  75. #endif
  76. @@ -1442,7 +1444,7 @@
  77. * 3) from flash or fuse (via platform data)
  78. */
  79. if (!is_valid_ether_addr(iap)) {
  80. -#ifdef CONFIG_M5272
  81. +#ifdef CONFIG_COLDFIRE
  82. if (FEC_FLASHMAC)
  83. iap = (unsigned char *)FEC_FLASHMAC;
  84. #else
  85. @@ -1667,7 +1669,7 @@
  86. /* mask with MAC supported features */
  87. if (id_entry->driver_data & FEC_QUIRK_HAS_GBIT) {
  88. phy_dev->supported &= PHY_GBIT_FEATURES;
  89. -#if !defined(CONFIG_M5272)
  90. +#if !defined(CONFIG_COLDFIRE)
  91. phy_dev->supported |= SUPPORTED_Pause;
  92. #endif
  93. }
  94. @@ -1853,7 +1855,7 @@
  95. }
  96. }
  97. -#if !defined(CONFIG_M5272)
  98. +#if !defined(CONFIG_COLDFIRE)
  99. static void fec_enet_get_pauseparam(struct net_device *ndev,
  100. struct ethtool_pauseparam *pause)
  101. @@ -1999,7 +2001,7 @@
  102. return -EOPNOTSUPP;
  103. }
  104. }
  105. -#endif /* !defined(CONFIG_M5272) */
  106. +#endif /* !defined(CONFIG_COLDFIRE) */
  107. static int fec_enet_nway_reset(struct net_device *dev)
  108. {
  109. @@ -2013,7 +2015,7 @@
  110. }
  111. static const struct ethtool_ops fec_enet_ethtool_ops = {
  112. -#if !defined(CONFIG_M5272)
  113. +#if !defined(CONFIG_COLDFIRE)
  114. .get_pauseparam = fec_enet_get_pauseparam,
  115. .set_pauseparam = fec_enet_set_pauseparam,
  116. #endif
  117. @@ -2023,7 +2025,7 @@
  118. .get_link = ethtool_op_get_link,
  119. .get_ts_info = fec_enet_get_ts_info,
  120. .nway_reset = fec_enet_nway_reset,
  121. -#ifndef CONFIG_M5272
  122. +#ifndef CONFIG_COLDFIRE
  123. .get_ethtool_stats = fec_enet_get_ethtool_stats,
  124. .get_strings = fec_enet_get_strings,
  125. .get_sset_count = fec_enet_get_sset_count,
  126. @@ -2500,7 +2502,7 @@
  127. /* setup board info structure */
  128. fep = netdev_priv(ndev);
  129. -#if !defined(CONFIG_M5272)
  130. +#if !defined(CONFIG_COLDFIRE)
  131. /* default enable pause frame auto negotiation */
  132. if (pdev->id_entry &&
  133. (pdev->id_entry->driver_data & FEC_QUIRK_HAS_GBIT))