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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Using LAN91C111 and LWIP in 16-bit mode?

Altera_Forum
Honored Contributor II
1,460 Views

Hello, 

 

Currently I’m working with the Cyclone Development Board and the Nios II to evaluate some things for a new system. The new board will be equipped with an EPC1C12 in a 240-PQFP package. To save some IO pins the CompactFlash, the standard Flash (which stores FPGA configuration data and program data) and the Ethernet MAC/PHY (LAN91C111) will share the same address and data signals. Because the CompactFlash and the standard Flash only need a 16-bit data bus the LAN91C111 should also work in 16-bit mode. 

 

Which SW/HW changes are needed to use the LAN91C111 in 16-bit mode with the stand alone LWIP?  

 

 

Thank you in advance, 

niosIIuser
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
692 Views

 

--- Quote Start ---  

originally posted by niosiiuser@Jul 21 2004, 08:48 AM 

hello, 

 

currently i’m working with the cyclone development board and the nios ii to evaluate some things for a new system. the new board will be equipped with an epc1c12 in a 240-pqfp package. to save some io pins the compactflash, the standard flash (which stores fpga configuration data and program data) and the ethernet mac/phy (lan91c111) will share the same address and data signals. because the compactflash and the standard flash only need a 16-bit data bus the lan91c111 should also work in 16-bit mode. 

 

which sw/hw changes are needed to use the lan91c111 in 16-bit mode with the stand alone lwip?  

 

 

thank you in advance, 

niosiiuser 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=521) 

--- quote end ---  

 

--- Quote End ---  

 

 

 

I dont&#39; know what cano you do, but i find this in altera_avalon_lan91c111.c source code of lan91C111 HAL library: 

 

int alt_avalon_lan91c111_init(alt_avalon_lan91c111_if *dev) 

int ret_code; 

 

if (dev->bus_width != 32) 

printf("This driver doesn&#39;t support the Ethernet add on card at present\n"); 

ret_code = -EIO; 

goto exit; 

 

........ 

 

I hope it can help you.
0 Kudos
Altera_Forum
Honored Contributor II
692 Views

Hi, 

 

I have the same problem when using Nir&#39;s Opencores MAC functions... can u pl tell me how to solve it? 

 

Raghu
0 Kudos
Altera_Forum
Honored Contributor II
692 Views

It has been done several times: 

 

http://forum.niosforum.com/forum/index.php...st=&#entry10776 (http://forum.niosforum.com/forum/index.php?showtopic=2788&pid=10776&mode=threaded&show=&st=&#entry10776) 

 

 

If the link does not work just search lan91c111
0 Kudos
Altera_Forum
Honored Contributor II
692 Views

 

--- Quote Start ---  

originally posted by tns1@Feb 24 2006, 12:48 PM 

it has been done several times: 

 

http://forum.niosforum.com/forum/index.php...st=&#entry10776 (http://forum.niosforum.com/forum/index.php?showtopic=2788&pid=10776&mode=threaded&show=&st=&#entry10776) 

 

 

if the link does not work just search lan91c111 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12953) 

--- quote end ---  

 

--- Quote End ---  

 

I wish some friendly sould posted the corrected driver for the Nios II comunity. Just to avoid doing this yet another time... I would really appreciate this. 

It would be really great if Altera included this fixed driver in their standard installation. I know, I am just dreaming.  

Anyway - anybody would like to share his/her 16-bit driver for LAN91C111?
0 Kudos
Altera_Forum
Honored Contributor II
692 Views

 

--- Quote Start ---  

originally posted by pszemol+mar 25 2006, 12:07 am--><div class='quotetop'>quote (pszemol @ mar 25 2006, 12:07 am)</div> 

--- quote start ---  

<!--quotebegin-tns1@Feb 24 2006, 12:48 PM 

it has been done several times: 

 

http://forum.niosforum.com/forum/index.php...st=&#entry10776 (http://forum.niosforum.com/forum/index.php?showtopic=2788&pid=10776&mode=threaded&show=&st=&#entry10776) 

 

 

if the link does not work just search lan91c111 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12953) 

--- quote end ---  

 

--- Quote End ---  

 

I wish some friendly sould posted the corrected driver for the Nios II comunity. Just to avoid doing this yet another time... I would really appreciate this. 

It would be really great if Altera included this fixed driver in their standard installation. I know, I am just dreaming.  

Anyway - anybody would like to share his/her 16-bit driver for LAN91C111? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13784)</div> 

[/b] 

--- Quote End ---  

 

 

The driver has already been posted 

 

http://forum.niosforum.com/forum/index.php?act=st&f=15&t=466 (http://forum.niosforum.com/forum/index.php?act=st&f=15&t=466)
0 Kudos
Altera_Forum
Honored Contributor II
692 Views

I&#39;ve found to make the LAN91c111 really work as a 16 bit device 

on the Nios2 development board, one has to modify the file "class.ptf" 

in the altera_avalon_lan91c111 component folder. 

When the &#39;LAN91C111 MAC/PHY On Daughtercard&#39; option is chosen then 

specifically these sections matter the most: 

$SPW/PORT byteenablen/width = "2"; 

$SPW/PORT address/width = "15"; 

$SPW/PORT data/width = "16"; 

$SBI/Data_Width = "16"; 

$SBI/Address_Width = "15"; 

$CONSTANTS/CONSTANT LAN91C111_REGISTERS_OFFSET/value = "0x0300"; 

$CONSTANTS/CONSTANT LAN91C111_DATA_BUS_WIDTH/value = "16"; 

 

After that the posted driver works great.
0 Kudos
Altera_Forum
Honored Contributor II
692 Views

Because the CompactFlash and the standard Flash only need a 16-bit data bus the LAN91C111 should also work in 16-bit mode 

 

i think you idea is not correct, the LAN91C111 can still work in 32-bit because the AVALON can suited it.yes or no??
0 Kudos
Reply