]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - cpu/arm920t/at91rm9200/lxt972.c
imported Freescale specific U-Boot additions for i.MX28,... release L2.6.31_10.08.01
[karo-tx-uboot.git] / cpu / arm920t / at91rm9200 / lxt972.c
index f12c59c158d6f4e9d97781316f81be5af450f9da..260d393cf0a3ae6134daec7fddd5dddfb7ec68a5 100755 (executable)
 #include <common.h>
 #include <at91rm9200_net.h>
 #include <net.h>
+#include <miiphy.h>
 #include <lxt971a.h>
 
 #ifdef CONFIG_DRIVER_ETHER
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*
  * Name:
@@ -51,8 +52,8 @@ unsigned int lxt972_IsPhyConnected (AT91PS_EMAC p_mac)
        unsigned short Id1, Id2;
 
        at91rm9200_EmacEnableMDIO (p_mac);
-       at91rm9200_EmacReadPhy (p_mac, PHY_COMMON_ID1, &Id1);
-       at91rm9200_EmacReadPhy (p_mac, PHY_COMMON_ID2, &Id2);
+       at91rm9200_EmacReadPhy(p_mac, PHY_PHYIDR1, &Id1);
+       at91rm9200_EmacReadPhy(p_mac, PHY_PHYIDR2, &Id2);
        at91rm9200_EmacDisableMDIO (p_mac);
 
        if ((Id1 == (0x0013)) && ((Id2  & 0xFFF0) == 0x78E0))
@@ -169,23 +170,23 @@ UCHAR lxt972_AutoNegotiate (AT91PS_EMAC p_mac, int *status)
        unsigned short value;
 
        /* Set lxt972 control register */
-       if (!at91rm9200_EmacReadPhy (p_mac, PHY_COMMON_CTRL, &value))
+       if (!at91rm9200_EmacReadPhy (p_mac, PHY_BMCR, &value))
                return FALSE;
 
        /* Restart Auto_negotiation  */
-       value |= PHY_COMMON_CTRL_RES_AUTO;
-       if (!at91rm9200_EmacWritePhy (p_mac, PHY_COMMON_CTRL, &value))
+       value |= PHY_BMCR_RST_NEG;
+       if (!at91rm9200_EmacWritePhy (p_mac, PHY_BMCR, &value))
                return FALSE;
 
        /*check AutoNegotiate complete */
        udelay (10000);
-       at91rm9200_EmacReadPhy (p_mac, PHY_COMMON_STAT, &value);
-       if (!(value & PHY_COMMON_STAT_AN_COMP))
+       at91rm9200_EmacReadPhy(p_mac, PHY_BMSR, &value);
+       if (!(value & PHY_BMSR_AUTN_COMP))
                return FALSE;
 
        return (lxt972_GetLinkSpeed (p_mac));
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 
 #endif /* CONFIG_DRIVER_ETHER */