#include <config.h>
#include <net.h>
-#if defined(CONFIG_ETHER_ON_FCC) && (CONFIG_COMMANDS & CFG_CMD_NET) && \
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+#include <miiphy.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET) && \
defined(CONFIG_NET_MULTI)
static struct ether_fcc_info_s
for(i=0; rtx.txbd[txIdx].cbd_sc & BD_ENET_TX_READY; i++) {
if (i >= TOUT_LOOP) {
- printf("fec: tx buffer not ready\n");
+ puts ("fec: tx buffer not ready\n");
goto out;
}
}
for(i=0; rtx.txbd[txIdx].cbd_sc & BD_ENET_TX_READY; i++) {
if (i >= TOUT_LOOP) {
- printf("fec: tx error\n");
+ puts ("fec: tx error\n");
goto out;
}
}
dev->recv = fec_recv;
eth_register(dev);
+
+#if (defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) \
+ && defined(CONFIG_BITBANGMII)
+ miiphy_register(dev->name,
+ bb_miiphy_read, bb_miiphy_write);
+#endif
}
return 1;
for (i = 0; i < nbase; i++)
printf (" Channel %d", i);
- puts ("\n");
+ putc ('\n');
while (dp < edp) {
printf (" %10u", val);
}
- puts ("\n");
+ putc ('\n');
dp++;
}
return (((x & 0xff) << 8) | ((x & 0xff00) >> 8));
}
+/* broadcast is not an error - we send them like that */
+#define BD_ENET_RX_ERRS (BD_ENET_RX_STATS & ~BD_ENET_RX_BC)
+
void
eth_loopback_test (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
volatile immap_t *immr = (immap_t *)CFG_IMMR;
volatile cpm8260_t *cp = &(immr->im_cpm);
int c, nclosed;
ecp->rxeacc._f++;
}
- if (sc & BD_ENET_RX_STATS) {
+ if (sc & BD_ENET_RX_ERRS) {
ulong n;
/*
ecp->rxeacc.cl++;
bdp->cbd_sc &= \
- ~BD_ENET_RX_STATS;
+ ~BD_ENET_RX_ERRS;
}
else {
ushort datlen = bdp->cbd_datlen;
printf ("\tFirst %d rx errs:", nerr);
for (i = 0; i < nerr; i++)
printf (" %04x", ecp->rxerrs[i]);
- puts ("\n");
+ putc ('\n');
}
if ((nerr = ecp->ntxerr) > 0) {
printf ("\tFirst %d tx errs:", nerr);
for (i = 0; i < nerr; i++)
printf (" %04x", ecp->txerrs[i]);
- puts ("\n");
+ putc ('\n');
}
}
#endif /* CONFIG_ETHER_LOOPBACK_TEST */
-#endif /* CONFIG_ETHER_ON_FCC && CFG_CMD_NET && CONFIG_NET_MULTI */
+#endif