summaryrefslogtreecommitdiff
path: root/cleopatre/u-boot-1.1.6/drivers/netspcmac_eth.c
diff options
context:
space:
mode:
authorsave2009-05-15 14:11:43 +0000
committersave2009-05-15 14:11:43 +0000
commit48326212aebf19a280fe2d5dbebb49420da3fa41 (patch)
tree4b21c8ec15b78434a8a66e175ebe20603b1cf195 /cleopatre/u-boot-1.1.6/drivers/netspcmac_eth.c
parent3fc897b1cb37b46f31f4f8a163837accc8a8bcdb (diff)
[CLEO][U-BOOT]Forced 10HD for arizona board
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4661 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cleopatre/u-boot-1.1.6/drivers/netspcmac_eth.c')
-rw-r--r--cleopatre/u-boot-1.1.6/drivers/netspcmac_eth.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/cleopatre/u-boot-1.1.6/drivers/netspcmac_eth.c b/cleopatre/u-boot-1.1.6/drivers/netspcmac_eth.c
index fadf13d3dc..ddac2e378f 100644
--- a/cleopatre/u-boot-1.1.6/drivers/netspcmac_eth.c
+++ b/cleopatre/u-boot-1.1.6/drivers/netspcmac_eth.c
@@ -30,6 +30,10 @@
#include <miiphy.h>
#include "netspcmac_eth.h"
+
+#define FORCE_10_HD 1
+
+
#define PHYSADDR(a) (((unsigned long)(a)) & 0xffffffff)
#if (CONFIG_COMMANDS & CFG_CMD_NET)
@@ -290,30 +294,27 @@ printf ("eth_phy_addr = %d\n", eth_phy_addr);
spcmac_mii_write (eth_phy_addr, MII_ADVERTISE, advertised_caps);
-/* To force speed and duplex settings, uncomment this part,
- * and comment out spcmac_phy_negotiate () andspcmac_phy_check_speed ()
- * functions in the bottom */
-#if 0
-// Disable AUTONEGOTIATION
-value = (unsigned int) spcmac_mii_read (eth_phy_addr, MII_BMCR);
+ /* To force speed and duplex settings, uncomment this part,
+ * and comment out spcmac_phy_negotiate () andspcmac_phy_check_speed ()
+ * functions in the bottom */
+#ifdef FORCE_10_HD
+ // Disable AUTONEGOTIATION
+ value = (unsigned int) spcmac_mii_read (eth_phy_addr, MII_BMCR);
+ value &= ~BMCR_ANENABLE;
+ spcmac_mii_write (eth_phy_addr, MII_BMCR, value);
-value &= ~BMCR_ANENABLE;
-spcmac_mii_write (eth_phy_addr, MII_BMCR, value);
-
-// Force 10Mbs Half Duplex
-value = (unsigned int) spcmac_mii_read (eth_phy_addr, MII_BMCR);
-value &= ~(BMCR_FULLDPLX | BMCR_SPEED1000);
-spcmac_mii_write (eth_phy_addr, MII_BMCR, value);
-value = (unsigned int) spcmac_mii_read (eth_phy_addr, MII_BMCR);
-printf ("PHY Control Register forced to: %#x\n", value);
-
-// set cap, force 10Mbs HALF DUPLEX
-//spcmac_set_mac_mii_cap (0, 10); // 10 Mbs HD
-spcmac_set_mac_mii_cap (1, 100); // 100 Mbs FD
-#endif
+ // Force 10Mbs Half Duplex
+ value = (unsigned int) spcmac_mii_read (eth_phy_addr, MII_BMCR);
+ value &= ~(BMCR_FULLDPLX | BMCR_SPEED100);
+ spcmac_mii_write (eth_phy_addr, MII_BMCR, value);
+ printf ("PHY forced to 10HD\n");
+ // set cap, force 10Mbs HALF DUPLEX
+ spcmac_set_mac_mii_cap (0, 10); // 10 Mbs HD
+#else
spcmac_phy_negotiate (eth_phy_addr);
spcmac_phy_check_speed (eth_phy_addr);
+#endif
return 0;
}
@@ -479,6 +480,15 @@ void spcmac_set_mac_mii_cap (int full_duplex, unsigned int speed)
ctrl &= ~MAC_CONTROL_DRO;
}
+ if(speed == 100)
+ {
+ ctrl |= MAC_CONTROL_FES100;
+ }
+ else
+ {
+ ctrl &= ~MAC_CONTROL_FES100;
+ }
+
SPCMAC_WRITE (flow, MAC_FLOW_CONTROL);
SPCMAC_WRITE (ctrl, MAC_CONTROL);