summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJason Jin <Jason.jin@freescale.com>2012-07-26 15:16:42 +0800
committerJustin Waters <justin.waters@timesys.com>2012-09-07 15:22:42 -0400
commit98f181be8e400434698fd89b13e04dbda9e8935d (patch)
tree61b7b7c453922db8cdcd401257701937da921cbb /drivers
parentbff87b6f514af75ace7d8820e750461078ea6551 (diff)
Add Vybrid ENET support
Signed-off-by: TsiChung Liew <tsicliew@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/mcffec.c18
-rw-r--r--drivers/net/mcfmii.c4
2 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index a08ff278bfd..1f59794102c 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -33,7 +33,11 @@
#include <miiphy.h>
#include <asm/fec.h>
+#ifdef CONFIG_COLDFIRE
#include <asm/immap.h>
+#endif
+#ifdef CONFIG_VYBRID
+#endif
#undef ET_DEBUG
#undef MII_DEBUG
@@ -116,7 +120,7 @@ void setFecDuplexSpeed(volatile fec_t * fecp, bd_t * bd, int dup_spd)
}
if ((dup_spd & 0xFFFF) == _100BASET) {
-#ifdef CONFIG_MCF5445x
+#if defined(CONFIG_MCF5445x) || defined(CONFIG_VYBRID)
fecp->rcr &= ~0x200; /* disabled 10T base */
#endif
#ifdef MII_DEBUG
@@ -124,7 +128,7 @@ void setFecDuplexSpeed(volatile fec_t * fecp, bd_t * bd, int dup_spd)
#endif
bd->bi_ethspeed = 100;
} else {
-#ifdef CONFIG_MCF5445x
+#if defined(CONFIG_MCF5445x) || defined(CONFIG_VYBRID)
fecp->rcr |= 0x200; /* enabled 10T base */
#endif
#ifdef MII_DEBUG
@@ -182,7 +186,7 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length)
j = 0;
while ((info->txbd[info->txIdx].cbd_sc & BD_ENET_TX_READY) &&
(j < MCFFEC_TOUT_LOOP)) {
- udelay(1);
+ udelay(10);
j++;
}
if (j >= MCFFEC_TOUT_LOOP) {
@@ -515,7 +519,12 @@ int fec_init(struct eth_device *dev, bd_t * bd)
fecp->etdsr = (unsigned int)(&info->txbd[0]);
/* Now enable the transmit and receive processing */
+#ifdef CONFIG_VYBRID
+ /*Big Endian*/
+ fecp->ecr |= FEC_ECR_ETHER_EN | 0x100;
+#else
fecp->ecr |= FEC_ECR_ETHER_EN;
+#endif
/* And last, try to fill Rx Buffer Descriptors */
fecp->rdar = 0x01000000; /* Descriptor polling active */
@@ -621,6 +630,7 @@ int mcffec_initialize(bd_t * bis)
/* default speed */
bis->bi_ethspeed = 10;
-
+ /*Ugly workaround for FEC to work in kernel, TODO Jason*/
+ mii_init();
return 0;
}
diff --git a/drivers/net/mcfmii.c b/drivers/net/mcfmii.c
index 471c5efea1d..63f1fd98ade 100644
--- a/drivers/net/mcfmii.c
+++ b/drivers/net/mcfmii.c
@@ -31,7 +31,9 @@
#else
#include <asm/fec.h>
#endif
+#ifdef CONFIG_COLDFIRE
#include <asm/immap.h>
+#endif
DECLARE_GLOBAL_DATA_PTR;
@@ -83,6 +85,7 @@ phy_info_t phyinfo[] = {
{0x20005CE1, "N83640"}, /* National 83640 */
{0x20005C90, "N83848"}, /* National 83848 */
{0x20005CA2, "N83849"}, /* National 83849 */
+ {0x0007C0F1, "SMSC8720A"}, /* SMSC 8720a */
{0x01814400, "QS6612"}, /* QS6612 */
#if defined(CONFIG_SYS_UNSPEC_PHYID) && defined(CONFIG_SYS_UNSPEC_STRID)
{CONFIG_SYS_UNSPEC_PHYID, CONFIG_SYS_UNSPEC_STRID},
@@ -122,7 +125,6 @@ uint mii_send(uint mii_cmd)
info = dev->priv;
ep = (FEC_T *) info->miibase;
-
ep->mmfr = mii_cmd; /* command to phy */
/* wait for mii complete */