arm:omap:am335x: CPSW autonegotiates to 10 mbps for beaglebone
authorChandan Nath <chandan.nath@ti.com>
Wed, 19 Oct 2011 09:51:43 +0000 (15:21 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:33 +0000 (00:44 +0530)
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>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
arch/arm/mach-omap2/board-am335xevm.c

index 69ed4faf1a2e0378a6cc7bf7f08df565628af04a..d2618b6dcb010417889f4d7e51227f0efc7bf68a 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/wl12xx.h>
+#include <linux/ethtool.h>
 
 /* LCD controller is similar to DA850 */
 #include <video/da8xx-fb.h>
 #define TLK110_PHY_ID          0x2000A201
 #define TLK110_PHY_MASK                0xfffffff0
 
+/* BBB PHY IDs */
+#define BBB_PHY_ID             0x7c0f1
+#define BBB_PHY_MASK           0xfffffffe
+
 /* TLK110 PHY register offsets */
 #define TLK110_COARSEGAIN_REG  0x00A3
 #define TLK110_LPFHPF_REG      0x00AC
@@ -1059,6 +1064,15 @@ static void spi1_init(int evm_id, int profile)
        return;
 }
 
+
+static int beaglebone_phy_fixup(struct phy_device *phydev)
+{
+       phydev->supported &= ~(SUPPORTED_100baseT_Half |
+                               SUPPORTED_100baseT_Full);
+
+       return 0;
+}
+
 #ifdef CONFIG_TLK110_WORKAROUND
 static int am335x_tlk110_phy_fixup(struct phy_device *phydev)
 {
@@ -1274,6 +1288,9 @@ static void setup_beaglebone_old(void)
        am335x_mmc[0].gpio_wp = -EINVAL;
 
        _configure_device(LOW_COST_EVM, beaglebone_old_dev_cfg, PROFILE_NONE);
+
+       phy_register_fixup_for_uid(BBB_PHY_ID, BBB_PHY_MASK,
+                                       beaglebone_phy_fixup);
 }
 
 /* BeagleBone after Rev A3 */