[U-Boot-Users] Ethernet loopback command

Thomas Schäfer thomas.schaefer at kontron.com
Mon Mar 7 18:35:54 CET 2005


The patch attached provides a command called 'ethloop' which allows to perform loopback testing on the current eth device. To achieve this, a new ethernet packet type (PROT_TEST, 0x0808, AFAIK this is not used otherwise) is introduced in net/net.c.
The patch is against SF CVS from 20050307.

The functions EthLoopStart, EthLoopSend and EthLoopHandler generate a simple ethernet frame with NetOurEther as destination address and packet type PROT_TEST. The looped back package is compared with the original one and a message is displayed.

It is necessary to set the ethernet line into loopback mode either by programming the PHY or using a loopback plug. I've tested this on our PPC405 custom board, but it should also work on all other systems because packet generation is independent of the underlying ethernet hardware.

Example usage:

=> mii w 0 0 7100		<-- sets PHY into loopback mode
=> ethloop
Using ppc_405x_eth0 device
Got ethernet loopback frame, len=64
loopback test successfully completed
=> mii w 0 0 8000		<-- PHY reset after test is completed

Maybe this is also useful for others..

Best regards,

Thomas Schäfer


Kontron Modular Computers GmbH

Konrad-Zuse-Str. 9
66115 Saarbrücken

Tel.: + 49 (0)681 / 95916 - 203
Fax:  + 49 (0)681 / 95916 - 100
E-mail: thomas.schaefer at kontron.com 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff.txt
Url: http://lists.denx.de/pipermail/u-boot/attachments/20050307/02a4284c/attachment.txt 

More information about the U-Boot mailing list