4 #include "eth-phy/mvEthPhy.h"
5 #include "mvBoardEnvLib.h"
7 /*******************************************************************************
9 * Name : gbe_link_detect_test
10 * Description : GbE Link Detection Test
14 * Return : Returns 1 on failure, else 0
15 *******************************************************************************/
17 int gbe_link_detect_test()
20 unsigned int result
= 0;
22 /* read specific status reg */
23 if( mvEthPhyRegRead( mvBoardPhyAddrGet(0), ETH_PHY_SPEC_STATUS_REG
, &val
) != MV_OK
)
26 switch (val
& ETH_PHY_SPEC_STATUS_SPEED_MASK
)
28 case ETH_PHY_SPEC_STATUS_SPEED_1000MBPS
:
29 printf( "\tSpeed: 1000 Mbps, " );
31 case ETH_PHY_SPEC_STATUS_SPEED_100MBPS
:
32 printf( "\tSpeed: 100 Mbps, " );
34 case ETH_PHY_SPEC_STATUS_SPEED_10MBPS
:
35 printf( "\tSpeed: 10 Mbps, " );
37 printf( "\tSpeed: Uknown, " );
41 if( val
& ETH_PHY_SPEC_STATUS_DUPLEX_MASK
)
43 printf( "Duplex: Full, " );
47 printf( "Duplex: Half, " );
50 if( val
& ETH_PHY_SPEC_STATUS_LINK_MASK
)
57 printf("Link: down\n");
60 printf("\tGbE link detect test ");
61 printf(((result
)? "PASSED\n":"FAILED\n"));
66 /*******************************************************************************
68 * Name : gbe_mac_loopback_test
69 * Description : GbE MAC Loopback Test
73 * Return : Returns 1 on failure, else 0
74 *******************************************************************************/
76 int gbe_mac_loopback_test(void)
78 printf("\tGbE mac loopback test ");
84 /*******************************************************************************
86 * Name : gbe_external_loopback_test
87 * Description : GbE External Loopback Test
90 * Return : Returns 1 on failure, else 0
91 *******************************************************************************/
93 int gbe_external_loopback_test(void)
95 printf("\tGbE external loopback test ");