]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00163040 - FEC : Fix ethernet cannot work after system sleep.
authorFugang Duan <B38611@freescale.com>
Fri, 25 Nov 2011 10:27:29 +0000 (18:27 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:10:09 +0000 (14:10 +0200)
- Descript:
  Ethernet can't work in uboot and kernel DHCP throught press
 'reset' key when send sleep command 'echo mem > /sys/power/state'
- Cause:
  FEC driver will power down phy when system sleep. If just reset the
  board, FEC driver cannot run resume function. So, need power on phy
  in uboot and linux driver.

Signed-off-by: Fugang Duan <B38611@freescale.com>
arch/arm/mach-mx6/board-mx6q_arm2.c

index 4274d3d220084bb2cbdfa9d69f788da5774e025e..053d3574bfa20afe8da6feec82a601c6dd58abb2 100644 (file)
 #define MX6Q_SMD_CSI0_RST              IMX_GPIO_NR(4, 5)
 #define MX6Q_SMD_CSI0_PWN              IMX_GPIO_NR(5, 23)
 
+#define BMCR_PDOWN             0x0800 /* PHY Powerdown */
+
 void __init early_console_setup(unsigned long base, struct clk *clk);
 static struct clk *sata_clk;
 static int esai_record;
@@ -506,6 +508,10 @@ static int mx6q_arm2_fec_phy_init(struct phy_device *phydev)
        val |= 0x0100;
        phy_write(phydev, 0x1e, val);
 
+       /*check phy power*/
+       val = phy_read(phydev, 0x0);
+       if (val & BMCR_PDOWN)
+               phy_write(phydev, 0x0, (val & ~BMCR_PDOWN));
        return 0;
 }