Commit 72e9d52328966be91be595cf6ec01a2c9576aded

Authored by Chandan Nath
Committed by Afzal Mohammed
1 parent dbc48cd484
Exists in master

ARM:omap:am335x: CPSW autonegotiates to 10 mbps for beaglebone

This patch is added as an workaround for cpsw in case of beaglebone
board to autonegotiates to 10 mbps speed even if it is connected to
100 mbps link. The reason for this is to overcome hardware issue of
100 mbps speed. However, CPSW works fine for both 10 and 100 mbps
speed in case of am335x evm.

Signed-off-by: Chandan Nath <chandan.nath@ti.com>

Showing 1 changed file with 17 additions and 0 deletions Side-by-side Diff

arch/arm/mach-omap2/board-am335xevm.c
... ... @@ -27,6 +27,7 @@
27 27 #include <linux/clk.h>
28 28 #include <linux/err.h>
29 29 #include <linux/wl12xx.h>
  30 +#include <linux/ethtool.h>
30 31  
31 32 /* LCD controller is similar to DA850 */
32 33 #include <video/da8xx-fb.h>
... ... @@ -58,6 +59,10 @@
58 59 #define TLK110_PHY_ID 0x2000A201
59 60 #define TLK110_PHY_MASK 0xfffffff0
60 61  
  62 +/* BBB PHY IDs */
  63 +#define BBB_PHY_ID 0x7c0f1
  64 +#define BBB_PHY_MASK 0xfffffffe
  65 +
61 66 /* TLK110 PHY register offsets */
62 67 #define TLK110_COARSEGAIN_REG 0x00A3
63 68 #define TLK110_LPFHPF_REG 0x00AC
... ... @@ -1085,6 +1090,15 @@
1085 1090 return;
1086 1091 }
1087 1092  
  1093 +
  1094 +static int beaglebone_phy_fixup(struct phy_device *phydev)
  1095 +{
  1096 + phydev->supported &= ~(SUPPORTED_100baseT_Half |
  1097 + SUPPORTED_100baseT_Full);
  1098 +
  1099 + return 0;
  1100 +}
  1101 +
1088 1102 #ifdef CONFIG_TLK110_WORKAROUND
1089 1103 static int am335x_tlk110_phy_fixup(struct phy_device *phydev)
1090 1104 {
... ... @@ -1273,6 +1287,9 @@
1273 1287 pr_info("The board is a AM335x Beaglebone.\n");
1274 1288  
1275 1289 _configure_device(LOW_COST_EVM, beaglebone_dev_cfg, PROFILE_NONE);
  1290 +
  1291 + phy_register_fixup_for_uid(BBB_PHY_ID, BBB_PHY_MASK,
  1292 + beaglebone_phy_fixup);
1276 1293 }
1277 1294  
1278 1295 static void am335x_setup_daughter_board(struct memory_accessor *m, void *c)