Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,10 @@
#include "FreeRTOS_IP_Private.h"
#include "NetworkBufferManagement.h"

#define NOP() asm ( "nop" );

#define phyMIN_PHY_ADDRESS 0
#define phyMAX_PHY_ADDRESS 31

void test_sleep( uint32_t uxTicks )
{
for( uint32_t j = 0U; j < uxTicks; j++ )
{
for( uint32_t i = 0U; i < 100000000U; i++ )
{
NOP();
}
}
}

void my_sleep( uint32_t uxTicks )
{
sleep( uxTicks );
}
#define MINIMUM_SLEEP_TIME ( ( TickType_t ) 1 * configTICK_RATE_HZ )

/*** IMPORTANT: Define PEEP in xemacpsif.h and sys_arch_raw.c
*** to run it on a PEEP board
Expand Down Expand Up @@ -474,7 +458,7 @@ static uint32_t get_TI_phy_speed( XEmacPs * xemacpsp,

while( !( status & IEEE_STAT_AUTONEGOTIATE_COMPLETE ) )
{
my_sleep( 1 );
vTaskDelay( MINIMUM_SLEEP_TIME );
timeout_counter++;

if( timeout_counter == 30 )
Expand Down Expand Up @@ -572,7 +556,7 @@ static uint32_t get_Marvell_phy_speed( XEmacPs * xemacpsp,

while( !( status & IEEE_STAT_AUTONEGOTIATE_COMPLETE ) )
{
my_sleep( 1 );
vTaskDelay( MINIMUM_SLEEP_TIME );
XEmacPs_PhyRead( xemacpsp, phy_addr,
IEEE_COPPER_SPECIFIC_STATUS_REG_2, &temp );
timeout_counter++;
Expand Down Expand Up @@ -663,7 +647,7 @@ static uint32_t get_Realtek_phy_speed( XEmacPs * xemacpsp,

while( !( status & IEEE_STAT_AUTONEGOTIATE_COMPLETE ) )
{
my_sleep( 1 );
vTaskDelay( MINIMUM_SLEEP_TIME );
timeout_counter++;

if( timeout_counter == 30 )
Expand Down Expand Up @@ -804,7 +788,7 @@ static uint32_t get_AR8035_phy_speed( XEmacPs * xemacpsp,
while( pdTRUE )
{
uint32_t status;
my_sleep( 1 );
vTaskDelay( MINIMUM_SLEEP_TIME );

timeout_counter++;

Expand Down Expand Up @@ -967,6 +951,7 @@ static uint32_t get_IEEE_phy_speed_US( XEmacPs * xemacpsp,
&phy_identity );

const char * pcPHYName = pcGetPHIName( phy_identity );

FreeRTOS_printf( ( "Start %s PHY autonegotiation. ID = 0x%04X\n", pcPHYName, phy_identity ) );

/* Just to prevent compiler warnings about unused variablies. */
Expand Down Expand Up @@ -1377,19 +1362,19 @@ u32 Phy_Setup_US( XEmacPs * xemacpsp,
link_speed = 1000;
configure_IEEE_phy_speed_US( xemacpsp, link_speed );
convspeeddupsetting = XEMACPS_GMII2RGMII_SPEED1000_FD;
my_sleep( 1 );
vTaskDelay( MINIMUM_SLEEP_TIME );
#elif defined( ipconfigNIC_LINKSPEED100 )
SetUpSLCRDivisors( xemacpsp->Config.BaseAddress, 100 );
link_speed = 100;
configure_IEEE_phy_speed_US( xemacpsp, link_speed, phy_addr );
convspeeddupsetting = XEMACPS_GMII2RGMII_SPEED100_FD;
my_sleep( 1 );
vTaskDelay( MINIMUM_SLEEP_TIME );
#elif defined( ipconfigNIC_LINKSPEED10 )
SetUpSLCRDivisors( xemacpsp->Config.BaseAddress, 10 );
link_speed = 10;
configure_IEEE_phy_speed_US( xemacpsp, link_speed, , phy_addr );
convspeeddupsetting = XEMACPS_GMII2RGMII_SPEED10_FD;
my_sleep( 1 );
vTaskDelay( MINIMUM_SLEEP_TIME );
#endif /* ifdef ipconfigNIC_LINKSPEED_AUTODETECT */

if( conv_present )
Expand Down