]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
altera_tse: m88e1111s: Honor device flags regarding PHY interface mode
authorJoachim Foerster <joachim.foerster@missinglinkelectronics.com>
Tue, 25 Oct 2011 22:39:57 +0000 (22:39 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 26 Oct 2011 19:28:18 +0000 (21:28 +0200)
Note: This is kind of guess work. The current code is preserved for
all RGMII related modes. It is different for flags=0 (GMII) and flags=5
(SGMII). The last case, SGMII, is successfully tested on
Altera's Terasic DE4.

Signed-off-by: Joachim Foerster <joachim.foerster@missinglinkelectronics.com>
drivers/net/altera_tse.c

index afd8e3126c4020069100c50060f9343408792df2..8b18ad0b0d5ef54fd8306ac0701a0528f34112e5 100644 (file)
@@ -583,7 +583,11 @@ static uint mii_m88e1111s_setmode_sr(uint mii_reg, struct altera_tse_priv *priv)
 {
        uint mii_data = tse_mdio_read(priv, mii_reg);
        mii_data &= 0xfff0;
-       mii_data |= 0xb;
+       if ((priv->flags >= 1) && (priv->flags <= 4))
+               mii_data |= 0xb;
+       else if (priv->flags == 5)
+               mii_data |= 0x4;
+
        return mii_data;
 }
 
@@ -591,7 +595,9 @@ static uint mii_m88e1111s_setmode_cr(uint mii_reg, struct altera_tse_priv *priv)
 {
        uint mii_data = tse_mdio_read(priv, mii_reg);
        mii_data &= ~0x82;
-       mii_data |= 0x82;
+       if ((priv->flags >= 1) && (priv->flags <= 4))
+               mii_data |= 0x82;
+
        return mii_data;
 }