]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00162013 - FEC : Fix loss interrupt when add "rootwait"
authorFugang Duan <B38611@freescale.com>
Fri, 11 Nov 2011 06:25:11 +0000 (14:25 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:10:04 +0000 (14:10 +0200)
- MII timeout when config ipg 40MHz mode and add "rootwait"
  para in uboot. Kernel will delay before peripheral equipment
  are ready, which lead to CPU loss interrupt.
- So, prolong the timeout time, and increase the MII clock.

Signed-off-by: Fugang Duan <B38611@freescale.com>
drivers/net/fec.c

index f9f73505891e5f2d669c46f04d736589edf0fbef..dc6349c2edf790bf9c173827270b6d7aaef3fa29 100644 (file)
@@ -238,7 +238,7 @@ struct fec_enet_private {
 #define FEC_MMFR_TA            (2 << 16)
 #define FEC_MMFR_DATA(v)       (v & 0xffff)
 
-#define FEC_MII_TIMEOUT                1000 /* us */
+#define FEC_MII_TIMEOUT                2000 /* us */
 
 /* Transmitter timeout */
 #define TX_TIMEOUT (2 * HZ)
@@ -885,9 +885,13 @@ static int fec_enet_mii_init(struct platform_device *pdev)
         */
        fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000) << 1;
 
-       if (cpu_is_mx6q())
-               /* FIXME: hard code to 0x1a for clock issue */
-               fep->phy_speed = 0x11a;
+       if (cpu_is_mx6q()) {
+               /* FIXME: non-1588 MII clk: 66MHz, 1588 mode : 40MHz */
+               if (fep->ptimer_present)
+                       fep->phy_speed = 0xe;
+               else
+                       fep->phy_speed = 0x11a;
+       }
 
        writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);