]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00160709-3 Move board specific code out of FEC driver
authorMahesh Mahadevan <r9aadq@freescale.com>
Tue, 25 Oct 2011 13:29:34 +0000 (08:29 -0500)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:09:47 +0000 (14:09 +0200)
Move the board specific code out of the FEC driver to the platform
layer

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
arch/arm/mach-mx6/board-mx6q_sabreauto.c

index 9149cb68e9756ddac2ab2fc2dff66c4ca41a56f5..9f56e92834894706a1053cc1dd81ebd46d38a1c0 100644 (file)
@@ -422,7 +422,31 @@ static inline void mx6q_sabreauto_init_uart(void)
        imx6q_add_imx_uart(3, NULL);
 }
 
+static int mx6q_sabreauto_fec_phy_init(struct phy_device *phydev)
+{
+       unsigned short val;
+
+       /* To enable AR8031 ouput a 125MHz clk from CLK_25M */
+       phy_write(phydev, 0xd, 0x7);
+       phy_write(phydev, 0xe, 0x8016);
+       phy_write(phydev, 0xd, 0x4007);
+       val = phy_read(phydev, 0xe);
+
+       val &= 0xffe3;
+       val |= 0x18;
+       phy_write(phydev, 0xe, val);
+
+       /* introduce tx clock delay */
+       phy_write(phydev, 0x1d, 0x5);
+       val = phy_read(phydev, 0x1e);
+       val |= 0x0100;
+       phy_write(phydev, 0x1e, val);
+
+       return 0;
+}
+
 static struct fec_platform_data fec_data __initdata = {
+       .init = mx6q_sabreauto_fec_phy_init,
        .phy = PHY_INTERFACE_MODE_RGMII,
 };