[U-Boot-Users] Ethernet loopback command

Hi,
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@kontron.com

Hello,
in message D9F0B2AD4531B0449D51C1F09199D484081F14@mail.kom-saarbruecken.com you wrote:
The patch attached provides a command called 'ethloop' which allows to perform loopback testing on the current eth device. To achieve this, a
Sorry, but I reject this patch. Test functions like this one should be added as part of the existing POST framework (which probably needs to be extended for better architecture support; see the archives for the previous discussions about this).
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.
I also don't understand why specific ethernet packet types must be invented. I don't like such non-standard solutions.
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
So you really should add this as part of the POST code where appropirate provisions can be doen. At first glance your patch looks like it was universal, which it isn't. Actually I don;t see which additional information you can get from this test that cannot be gotten from existing network code like ping.
Also, the code is not completely configurable, and was obviously not well tested. You add some variables even in case the command is not cnfigured, which wastes memory and causes compiler warnings.
Best regards,
Wolfgang Denk

Hi all,
I'm testing the ethernet loopback test on POWERPC 460EX canyonlands Board. I'm making the ethernet loopback mode by programming the phy control register.(mii w 0 0 5140)
Then i'm running the ethtool command. But it is showing "loopback test failed". I have gone through the code whatever i have patched, as per my understanding it is correct.
can any one suggest me correct solution for this..! or if u know the another ethernet loopback test method kindly suggest me..!
Thanks in advance for your help...!
with cheers, Ramu

On Monday 16 April 2012 08:00:42 Ramappa Hugar wrote:
I'm testing the ethernet loopback test on POWERPC 460EX canyonlands Board. I'm making the ethernet loopback mode by programming the phy control register.(mii w 0 0 5140)
Then i'm running the ethtool command.
"ethtool" command? This is not part of U-Boot.
But it is showing "loopback test failed". I have gone through the code whatever i have patched, as per my understanding it is correct.
can any one suggest me correct solution for this..! or if u know the another ethernet loopback test method kindly suggest me..!
I suggest that you take a look at the POST (Power On Self Test) framework. It has support for ethernet loopback test for PPC4xx. E.g. board sequoia. Look for CONFIG_SYS_POST_ETHER and take a look at the following file:
post/cpu/ppc4xx/ether.c
Thanks, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de

Stefan Roese <sr <at> denx.de> writes:
On Monday 16 April 2012 08:00:42 Ramappa Hugar wrote:
I'm testing the ethernet loopback test on POWERPC 460EX canyonlands Board. I'm making the ethernet loopback mode by programming the phy control register.(mii w 0 0 5140)
Then i'm running the ethtool command.
"ethtool" command? This is not part of U-Boot.
But it is showing "loopback test failed". I have gone through the code whatever i have patched, as per my understanding it is correct.
can any one suggest me correct solution for this..! or if u know the another ethernet loopback test method kindly suggest me..!
I suggest that you take a look at the POST (Power On Self Test) framework. It has support for ethernet loopback test for PPC4xx. E.g. board sequoia. Look for CONFIG_SYS_POST_ETHER and take a look at the following file:
post/cpu/ppc4xx/ether.c
Thanks, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office <at> denx.de
i have enabled the POST support in the header file by defining macro and build the u-boot.bin.
my doubt is whether it will support for canyalands board or not.. and how to run the post test using "diag" command. and whether i need to configure the phy control register to loopback mode before testing.
Thanks Ramappa

On Tuesday 17 April 2012 07:47:35 Ramu wrote:
I suggest that you take a look at the POST (Power On Self Test) framework. It has support for ethernet loopback test for PPC4xx. E.g. board sequoia. Look for CONFIG_SYS_POST_ETHER and take a look at the following file:
post/cpu/ppc4xx/ether.c
Thanks, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office <at> denx.de
i have enabled the POST support in the header file by defining macro and build the u-boot.bin.
my doubt is whether it will support for canyalands board or not..
Not sure. Might be that this driver needs minimal changes for 460EX. But chances are good that it works out-of-the-box for 460EX/GX too.
and how to run the post test using "diag" command.
Help (?) is your fried. Use "log show" to display the results of the POST tests. And "diag run ethernet" to re-run this test.
and whether i need to configure the phy control register to loopback mode before testing.
No. No need to change PHY registers. The loopback is configured in the PPC4xx MAC.
Thanks, Stefan
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de
participants (5)
-
Ramappa Hugar
-
Ramu
-
Stefan Roese
-
Thomas Schäfer
-
Wolfgang Denk