diff -NurbB u-boot/common/cmd_net.c u-boot-work/common/cmd_net.c
--- u-boot/common/cmd_net.c	2005-03-07 16:47:57.000000000 +0100
+++ u-boot-work/common/cmd_net.c	2005-03-04 13:26:59.000000000 +0100
@@ -236,6 +236,30 @@
 );
 #endif	/* CFG_CMD_PING */
 
+#if (CONFIG_COMMANDS & CFG_CMD_ETHLOOP)
+int do_ethloop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	if (argc != 1)
+		return -1;
+
+	if (NetLoop(ETHLOOP) < 0) {
+		printf("loopback test failed\n");
+		return 1;
+	}
+
+	printf("loopback test successfully completed\n");
+	return 0;
+}
+
+U_BOOT_CMD(
+	ethloop, 1, 1, do_ethloop,
+	"ethloop\t- loopback test using ethernet test package\n",
+	"- send and receive ethernet test package\n"
+	"\t  Ensure that EMAC/PHY loopback mode has been\n"
+	"\t  set before or use a loopback plug\n"
+);
+#endif	/* CFG_CMD_ETHLOOP */
+
 #if (CONFIG_COMMANDS & CFG_CMD_CDP)
 
 static void cdp_update_env(void)
diff -NurbB u-boot/include/cmd_confdefs.h u-boot-work/include/cmd_confdefs.h
--- u-boot/include/cmd_confdefs.h	2005-03-07 16:45:39.000000000 +0100
+++ u-boot-work/include/cmd_confdefs.h	2005-03-04 11:28:33.000000000 +0100
@@ -92,6 +92,7 @@
 #define CFG_CMD_XIMG	0x0400000000000000ULL	/* Load part of Multi Image	*/
 #define CFG_CMD_UNIVERSE 0x0800000000000000ULL	/* Tundra Universe Support      */
 #define CFG_CMD_EXT2    0x1000000000000000ULL	/* EXT2 Support                 */
+#define CFG_CMD_ETHLOOP 0x2000000000000000ULL /* ETH loopback test */
 
 #define CFG_CMD_ALL	0xFFFFFFFFFFFFFFFFULL	/* ALL commands			*/
 
diff -NurbB u-boot/include/net.h u-boot-work/include/net.h
--- u-boot/include/net.h	2005-03-07 16:49:17.000000000 +0100
+++ u-boot-work/include/net.h	2005-03-07 13:47:03.000000000 +0100
@@ -163,6 +163,7 @@
 
 #define PROT_IP		0x0800		/* IP protocol			*/
 #define PROT_ARP	0x0806		/* IP ARP protocol		*/
+#define PROT_TEST	0x0808		/* Ethernet loopback test */
 #define PROT_RARP	0x8035		/* IP ARP protocol		*/
 #define PROT_VLAN	0x8100		/* IEEE 802.1q protocol		*/
 
@@ -335,7 +336,7 @@
 extern int		NetRestartWrap;		/* Tried all network devices	*/
 #endif
 
-typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS } proto_t;
+typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS, ETHLOOP } proto_t;
 
 /* from net/net.c */
 extern char	BootFile[128];			/* Boot File name		*/
diff -NurbB u-boot/net/net.c u-boot-work/net/net.c
--- u-boot/net/net.c	2005-03-07 16:44:08.000000000 +0100
+++ u-boot-work/net/net.c	2005-03-07 14:03:17.000000000 +0100
@@ -93,6 +93,8 @@
 #define ET_DEBUG
 #endif
 
+#define ETHLOOP_LEN		64
+
 /** BOOTP EXTENTIONS **/
 
 IPaddr_t	NetOurSubnetMask=0;		/* Our subnet mask (0=unknown)	*/
@@ -121,6 +123,8 @@
 			{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 uchar		NetEtherNullAddr[6] =
 			{ 0, 0, 0, 0, 0, 0 };
+uchar		EtherPacket[ETHLOOP_LEN];	/* buffer for loopback test frame */
+
 #if (CONFIG_COMMANDS & CFG_CMD_CDP)
 uchar		NetCDPAddr[6] =		/* Ethernet bcast address		*/
 			{ 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
@@ -144,6 +148,12 @@
 static void PingStart(void);
 #endif
 
+#if (CONFIG_COMMANDS & CFG_CMD_ETHLOOP)
+
+
+static void EthLoopStart(void);
+#endif
+
 #if (CONFIG_COMMANDS & CFG_CMD_CDP)
 static void CDPStart(void);
 #endif
@@ -313,6 +323,11 @@
 #if (CONFIG_COMMANDS & CFG_CMD_PING)
 	case PING:
 #endif
+#if (CONFIG_COMMANDS & CFG_CMD_ETHLOOP)
+	case ETHLOOP:
+
+
+#endif
 	case NETCONS:
 	case TFTP:
 		NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
@@ -402,6 +417,12 @@
 			PingStart();
 			break;
 #endif
+#if (CONFIG_COMMANDS & CFG_CMD_ETHLOOP)
+		case ETHLOOP:
+
+			EthLoopStart();
+			break;
+#endif
 #if (CONFIG_COMMANDS & CFG_CMD_NFS)
 		case NFS:
 			NfsStart();
@@ -745,6 +766,55 @@
 }
 #endif	/* CFG_CMD_PING */
 
+#if (CONFIG_COMMANDS & CFG_CMD_ETHLOOP)
+int EthLoopSend(void)
+{
+	int i;
+	uchar *pkt;
+
+	for (i=0 ; i<ETHLOOP_LEN ; i++) {
+		EtherPacket[i] = i;
+	}
+	pkt = (uchar *)EtherPacket;
+	pkt += NetSetEther (pkt, NetOurEther, PROT_TEST); /* set our MAC address as destination address */
+	(void) eth_send(EtherPacket, ETHLOOP_LEN);
+
+	return 1;	/* waiting */
+}
+
+static void EthLoopTimeout (void)
+{
+	eth_halt();
+	NetState = NETLOOP_FAIL;	/* we did not get the reply */
+}
+
+static void EthLoopHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
+{
+	int i;
+
+	NetState = NETLOOP_SUCCESS;
+	for (i=ETHER_HDR_SIZE ; i<len ; i++) {
+		if (EtherPacket[i] != pkt[i]) {
+			printf ("ETH Loopback: RX data error\n");
+			NetState = NETLOOP_FAIL;
+			break;
+		}
+	}
+}
+
+static void EthLoopStart(void)
+{
+#if defined(CONFIG_NET_MULTI)
+
+		printf ("Using %s device\n", eth_get_name());
+#endif	/* CONFIG_NET_MULTI */
+	NetSetTimeout (1 * CFG_HZ, EthLoopTimeout);
+	NetSetHandler (EthLoopHandler);
+
+	EthLoopSend();
+}
+#endif	/* CFG_CMD_ETHLOOP */
+
 #if (CONFIG_COMMANDS & CFG_CMD_CDP)
 
 #define CDP_DEVICE_ID_TLV		0x0001
@@ -1108,7 +1178,7 @@
 	ushort cti = 0, vlanid = VLAN_NONE, myvlanid, mynvlanid;
 
 #ifdef ET_DEBUG
-	printf("packet received\n");
+	printf("packet received, len: %d\n", len);
 #endif
 
 	NetRxPkt = inpkt;
@@ -1408,6 +1478,23 @@
 						ntohs(ip->udp_src),
 						ntohs(ip->udp_len) - 8);
 		break;
+	case PROT_TEST:
+
+			printf ("Got ethernet loopback frame, len=%d\n", NetRxPktLen);
+
+
+
+#if 0
+		if (!NetCksumOk((uchar *)ip, IP_HDR_SIZE_NO_UDP / 2)) {
+			puts ("checksum bad\n");
+			return;
+		}
+#endif
+		/*
+		 *	Ethernet header OK.  Pass the packet to the current handler.
+		 */
+		(*packetHandler)((uchar *)NetRxPkt, 0, 0, NetRxPktLen);
+		break;
 	}
 }
 
