Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

how to set the ethernet speed

Altera_Forum
Honored Contributor II
1,222 Views

Hi 

 

I am looking for a solution to force the lan91c111 ethernet controller to 10baseT (as the board I have does strange things 

at higher speeds). I tried to understand the driver code in eCOS, but this seams not to be simple... 

Does anybody have an idea how to do this?  

 

Thanks 

Yves
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
510 Views

There are many ways to skin this cat. For all of them though you will need to change the driver which can be found in  

altera\kits\nios2\components\ecos\ecos-2.0\packages\devs\eth\smsc\lan91cxx\v2_0\src\if_lan91cxx.c 

 

The current driver auto negotiates the link speed. 

 

You could either: 

1. Set the PHY register 4 Auto Negotiation Adevrtisement regiser to not advertise that 100MBps is supported 

Probably best to do this just before Auto Negotiation is started on line 375 

 

2. Change the code at line 375 which starts Aut Negotiation to set the RPCR register to select 10 MBps, to not AutoNegotiate and sed the LEDS as you desire 

 

I think replacing the code with  

put_reg(sc, LAN91CXX_RPCR, LAN91CXX_RPCR_LEDA_RX | LAN91CXX_RPCR_LEDB_LINK); 

 

However I haven't tested it, and if it doesn't work you'll need to look at the lan91c11 datasheet to see what I missed.
0 Kudos
Altera_Forum
Honored Contributor II
510 Views

Thanks a lot for your hint, it works great! 

(I use the second method you explained in your reply) 

 

Greetings 

Yves
0 Kudos
Reply