aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2011-11-16 17:15:13 +0800
committerEric Miao <eric.miao@canonical.com>2011-12-05 14:39:20 +0800
commitadd9d3bec56f5a43736f368d36af4f42c34f52a0 (patch)
treef4b48d82a11366b2e7b9bc4e82ea60aa41ef5ec7
parent1cc4f638d93351b006d1b7e0fa99d8253334f8f6 (diff)
downloadlinux-linaro-add9d3bec56f5a43736f368d36af4f42c34f52a0.tar.gz
net: fec: add ksz9021_phy_fixup
For imx6q sabrelite board, set phy RGMII pad skew. Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
-rw-r--r--drivers/net/ethernet/freescale/fec.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 9dead08b634..d2bec4342d2 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1509,6 +1509,24 @@ static inline void fec_reset_phy(struct platform_device *pdev)
}
#endif /* CONFIG_OF */
+/* For imx6q sabrelite board: set KSZ9021 skew */
+static int ksz9021_phy_fixup(struct phy_device *phydev)
+{
+ /* prefer master mode, 1000 Base-T capable */
+ phy_write(phydev, 0x9, 0x0f00);
+
+ /* min rx data delay */
+ phy_write(phydev, 0x0b, 0x8105);
+ phy_write(phydev, 0x0c, 0x0000);
+
+ /* max rx/tx clock delay, min rx/tx control delay */
+ phy_write(phydev, 0x0b, 0x8104);
+ phy_write(phydev, 0x0c, 0xf0f0);
+ phy_write(phydev, 0x0b, 0x104);
+
+ return 0;
+}
+
static int __devinit
fec_probe(struct platform_device *pdev)
{
@@ -1591,6 +1609,10 @@ fec_probe(struct platform_device *pdev)
if (ret)
goto failed_init;
+ /* register the PHY board fixup (for Micrel KSZ9021) */
+ phy_register_fixup_for_uid(0x00221611, 0xfffffff0,
+ ksz9021_phy_fixup);
+
ret = fec_enet_mii_init(pdev);
if (ret)
goto failed_mii_init;